Skip to content

Commit

Permalink
making plot work with only_dat
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Feb 27, 2024
1 parent a15ab57 commit 7c4f685
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions measure_extinction/utils/make_obsdata_from_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,27 +444,28 @@ def make_obsdata_from_model(
ax.plot(wave_rebin * 1e-4, flux_rebin * 2.0, "b-")
ax.plot(bandinfo.waves, bandinfo.fluxes, "ro")

(indxs,) = np.where(rb_stis_uv["NPTS"] > 0)
ax.plot(
rb_stis_uv["WAVELENGTH"][indxs].to(u.micron),
rb_stis_uv["FLUX"][indxs],
"m-",
)
(indxs,) = np.where(rb_stis_opt["NPTS"] > 0)
ax.plot(
rb_stis_opt["WAVELENGTH"][indxs].to(u.micron),
rb_stis_opt["FLUX"][indxs],
"g-",
)

(indxs,) = np.where(rb_nrc["NPTS"] > 0)
ax.plot(rb_nrc["WAVELENGTH"][indxs].to(u.micron), rb_nrc["FLUX"][indxs], "c-")

(indxs,) = np.where(rb_lrs["NPTS"] > 0)
ax.plot(rb_lrs["WAVELENGTH"][indxs].to(u.micron), rb_lrs["FLUX"][indxs], "r:")

(indxs,) = np.where(rb_mrs["NPTS"] > 0)
ax.plot(rb_mrs["WAVELENGTH"][indxs].to(u.micron), rb_mrs["FLUX"][indxs], "r-")
if not only_dat:
(indxs,) = np.where(rb_stis_uv["NPTS"] > 0)
ax.plot(
rb_stis_uv["WAVELENGTH"][indxs].to(u.micron),
rb_stis_uv["FLUX"][indxs],
"m-",
)
(indxs,) = np.where(rb_stis_opt["NPTS"] > 0)
ax.plot(
rb_stis_opt["WAVELENGTH"][indxs].to(u.micron),
rb_stis_opt["FLUX"][indxs],
"g-",
)

(indxs,) = np.where(rb_nrc["NPTS"] > 0)
ax.plot(rb_nrc["WAVELENGTH"][indxs].to(u.micron), rb_nrc["FLUX"][indxs], "c-")

(indxs,) = np.where(rb_lrs["NPTS"] > 0)
ax.plot(rb_lrs["WAVELENGTH"][indxs].to(u.micron), rb_lrs["FLUX"][indxs], "r:")

(indxs,) = np.where(rb_mrs["NPTS"] > 0)
ax.plot(rb_mrs["WAVELENGTH"][indxs].to(u.micron), rb_mrs["FLUX"][indxs], "r-")

ax.set_xscale("log")
ax.set_yscale("log")
Expand Down

0 comments on commit 7c4f685

Please sign in to comment.