diff --git a/scopesim/effects/spectral_efficiency.py b/scopesim/effects/spectral_efficiency.py index 4798a86d..6261a567 100644 --- a/scopesim/effects/spectral_efficiency.py +++ b/scopesim/effects/spectral_efficiency.py @@ -38,9 +38,9 @@ def get_efficiencies_from_file(self, fname): for hdu in hdul[2:]: name = hdu.header['EXTNAME'] lam = hdu.data['wavelength'] * u.um # check units explicitely - trans = hdu.data['transmission'] - effic = TERCurve(wavelength=lam, transmission=trans) - efficiencies[name] = effic + efficiency = hdu.data['efficiency'] + effic_curve = TERCurve(wavelength=lam, transmission=efficiency) + efficiencies[name] = effic_curve hdul.close() return efficiencies @@ -76,10 +76,7 @@ def apply_to(self, obj, **kwargs): wave_cube = (wave_cube * u.Unit(wcs.wcs.cunit[0])).to(u.AA) print(wave_cube) print(effic.throughput(wave_cube)) - np.savetxt(f"efficcurve_{trace_id}.txt", (wave_cube, effic.throughput(wave_cube))) - obj.hdu.writeto(f"before_{trace_id}.fits") obj.hdu = apply_throughput_to_cube(obj.hdu, effic.throughput) - obj.hdu.writeto(f"after_{trace_id}.fits") return obj def plot(self): diff --git a/scopesim/effects/spectral_trace_list_utils.py b/scopesim/effects/spectral_trace_list_utils.py index 5917f2a1..cf0f15c1 100644 --- a/scopesim/effects/spectral_trace_list_utils.py +++ b/scopesim/effects/spectral_trace_list_utils.py @@ -437,7 +437,6 @@ def __init__(self, fov, dlam_per_pix): # add_cube_layer method cube_wcs = WCS(fov.cube.header, key=' ') wcs_lam = cube_wcs.sub([3]) - fits.writeto(f"xilam_cube_{fov.meta['trace_id']}.fits", data=fov.cube.data) d_xi = fov.cube.header['CDELT1'] d_xi *= u.Unit(fov.cube.header['CUNIT1']).to(u.arcsec) d_eta = fov.cube.header['CDELT2'] diff --git a/scopesim/tests/mocks/files/TER_grating.fits b/scopesim/tests/mocks/files/TER_grating.fits index da324e81..42787cd1 100644 Binary files a/scopesim/tests/mocks/files/TER_grating.fits and b/scopesim/tests/mocks/files/TER_grating.fits differ