Skip to content

Commit

Permalink
Remove MICADO-specific things
Browse files Browse the repository at this point in the history
  • Loading branch information
oczoske committed Jun 19, 2023
1 parent 0ccad52 commit f1a8239
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 11 additions & 3 deletions scopesim/effects/spectral_trace_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,16 @@ def rectify_traces(self, hdulist, xi_min=None, xi_max=None, interps=None,
inhdul = hdulist

# Crude attempt to get a useful wavelength range
# Problematic because different instruments use different
# keywords for the filter... We try to make it work for METIS
# and MICADO for the time being.
try:
filter_name = from_currsys("!OBS.filter_name")
except ValueError:
filter_name = from_currsys("!OBS.filter_name_fw1")

filtcurve = FilterCurve(
filter_name=from_currsys("!OBS.filter_name_fw1"),
filter_name=filter_name,
filename_format=from_currsys("!INST.filter_file_format"))
filtwaves = filtcurve.table['wavelength']
filtwave = filtwaves[filtcurve.table['transmission'] > 0.01]
Expand Down Expand Up @@ -287,8 +295,8 @@ def rectify_traces(self, hdulist, xi_min=None, xi_max=None, interps=None,

pdu = fits.PrimaryHDU()
pdu.header['FILETYPE'] = "Rectified spectra"
pdu.header['INSTRUME'] = inhdul[0].header['HIERARCH ESO OBS INSTRUME']
pdu.header['FILTER'] = from_currsys("!OBS.filter_name_fw1")
#pdu.header['INSTRUME'] = inhdul[0].header['HIERARCH ESO OBS INSTRUME']
#pdu.header['FILTER'] = from_currsys("!OBS.filter_name_fw1")
outhdul = fits.HDUList([pdu])

for i, trace_id in enumerate(self.spectral_traces):
Expand Down
5 changes: 3 additions & 2 deletions scopesim/effects/spectral_trace_list_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ def rectify(self, hdulist, interps=None, wcs=None, **kwargs):
The WCS can also be set up via the following keywords:
bin_width : float [um]
The spectral bin width.
The spectral bin width. This is best computed automatically from the
spectral dispersion of the trace.
wave_min, wave_max : float [um]
Limits of the wavelength range to extract. The default is the
the full range on which the `SpectralTrace` is defined. This may
Expand All @@ -317,7 +318,7 @@ def rectify(self, hdulist, interps=None, wcs=None, **kwargs):
bin_width = kwargs.get("bin_width", None)
if bin_width is None:
self._set_dispersion(wave_min, wave_max)
bin_width = self.dlam_per_pix.y.min()
bin_width = np.abs(self.dlam_per_pix.y).min()
logging.info(" Bin width %.02g um", bin_width)

pixscale = from_currsys(self.meta['pixel_scale'])
Expand Down

0 comments on commit f1a8239

Please sign in to comment.