From 7c4f6856a094b0064c122a0616a77db601073bd1 Mon Sep 17 00:00:00 2001 From: Karl Gordon Date: Tue, 27 Feb 2024 11:47:38 -0500 Subject: [PATCH] making plot work with only_dat --- .../utils/make_obsdata_from_model.py | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/measure_extinction/utils/make_obsdata_from_model.py b/measure_extinction/utils/make_obsdata_from_model.py index bcea27a..49a4d0f 100644 --- a/measure_extinction/utils/make_obsdata_from_model.py +++ b/measure_extinction/utils/make_obsdata_from_model.py @@ -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")