diff --git a/measure_extinction/utils/make_obsdata_from_model.py b/measure_extinction/utils/make_obsdata_from_model.py index 3ab20c0..6a1e98a 100644 --- a/measure_extinction/utils/make_obsdata_from_model.py +++ b/measure_extinction/utils/make_obsdata_from_model.py @@ -299,17 +299,6 @@ def make_obsdata_from_model( # dictionary to saye names of spectroscopic filenames specinfo = {} - full_file = "%s_full.fits" % (output_filebase) - if not only_dat: - # save the full spectrum to a binary FITS table - otable = QTable() - otable["WAVELENGTH"] = Column(wave_rebin, unit=u.angstrom) - otable["FLUX"] = Column(flux_rebin, unit=fluxunit) - otable["SIGMA"] = Column(flux_rebin * 0.01, unit=fluxunit) - otable["NPTS"] = Column(npts_rebin) - otable.write("%s/Models/%s" % (output_path, full_file), overwrite=True) - specinfo["MODEL_FULL"] = full_file - # rebin to R=100 for speed of reddened photometry calculation # use a wavelength range that spans FUSE to Spitzer IRS rbres_lowres = 100.0 @@ -319,14 +308,25 @@ def make_obsdata_from_model( full_file_lowres = "%s_full_lowres.fits" % (output_filebase) if not only_dat: # save the full spectrum to a binary FITS table - otable = QTable() - otable["WAVELENGTH"] = Column(wave_rebin_lowres, unit=u.angstrom) - otable["FLUX"] = Column(flux_rebin_lowres, unit=fluxunit) - otable["SIGMA"] = Column(flux_rebin_lowres * 0.01, unit=fluxunit) - otable["NPTS"] = Column(npts_rebin_lowres) - otable.write("%s/Models/%s" % (output_path, full_file_lowres), overwrite=True) + otable_lowres = QTable() + otable_lowres["WAVELENGTH"] = Column(wave_rebin_lowres, unit=u.angstrom) + otable_lowres["FLUX"] = Column(flux_rebin_lowres, unit=fluxunit) + otable_lowres["SIGMA"] = Column(flux_rebin_lowres * 0.01, unit=fluxunit) + otable_lowres["NPTS"] = Column(npts_rebin_lowres) + otable_lowres.write("%s/Models/%s" % (output_path, full_file_lowres), overwrite=True) specinfo["MODEL_FULL_LOWRES"] = full_file_lowres + full_file = "%s_full.fits" % (output_filebase) + if not only_dat: + # save the full spectrum to a binary FITS table + otable = QTable() + otable["WAVELENGTH"] = Column(wave_rebin, unit=u.angstrom) + otable["FLUX"] = Column(flux_rebin, unit=fluxunit) + otable["SIGMA"] = Column(flux_rebin * 0.01, unit=fluxunit) + otable["NPTS"] = Column(npts_rebin) + otable.write("%s/Models/%s" % (output_path, full_file), overwrite=True) + specinfo["MODEL_FULL"] = full_file + iue_file = "%s_iue.fits" % (output_filebase) if not only_dat: # IUE mock observation