Skip to content

Commit

Permalink
Column renamed to efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
oczoske committed Jun 12, 2023
1 parent f71cd2c commit 8b6e085
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
9 changes: 3 additions & 6 deletions scopesim/effects/spectral_efficiency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Check warning on line 80 in scopesim/effects/spectral_efficiency.py

View check run for this annotation

Codecov / codecov/patch

scopesim/effects/spectral_efficiency.py#L67-L80

Added lines #L67 - L80 were not covered by tests

def plot(self):
Expand Down
1 change: 0 additions & 1 deletion scopesim/effects/spectral_trace_list_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Binary file modified scopesim/tests/mocks/files/TER_grating.fits
Binary file not shown.

0 comments on commit 8b6e085

Please sign in to comment.