Skip to content

Commit

Permalink
replaced hardcoded wavelength in microns with nm
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-simpson committed Jan 9, 2025
1 parent 7fddb56 commit 65e3194
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions geminidr/core/primitives_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5211,11 +5211,11 @@ def _uses_atran_linelist(self, cenwave, absorption):
Parameters
----------
cenwave: float
central wavelength in um
central wavelength in nm
absorption: bool
is wavecal done from absorption lines?
"""
return True if (absorption is True) or (cenwave >= 2.8) else False
return absorption or (cenwave >= 2800)

def _get_atran_linelist(self, ext, config):
"""
Expand Down Expand Up @@ -5475,7 +5475,8 @@ def _make_refplot_data(self, ext, refplot_linelist, config=None, model_params=No
# Use ATRAN models for generating reference plots
# for wavecal from sky absorption lines in science spectrum,
# and for wavecal from sky emission lines in L- and M-bands
if self._uses_atran_linelist(absorption=absorption, cenwave=ext.central_wavelength(asMicrometers=True)):
if self._uses_atran_linelist(absorption=absorption,
cenwave=ext.central_wavelength(asNanometers=True)):
if refplot_spec is None:
refplot_spec, _ = self._get_convolved_atran(ext, model_params)
if refplot_y_axis_label is None:
Expand Down
2 changes: 1 addition & 1 deletion gempy/library/wavecal.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def get_all_input_data(ext, p, config, linelist=None, bad_bits=0,
f"(nm/pixel):\n{waves} {dw0:.4f}")

# Is ATRAN line list used for this mode?
uses_atran_linelist = p._uses_atran_linelist(cenwave=ext.central_wavelength(asMicrometers=True),
uses_atran_linelist = p._uses_atran_linelist(cenwave=ext.central_wavelength(asNanometers=True),
absorption=config.get("absorption", False))
refplot_dict = None

Expand Down

0 comments on commit 65e3194

Please sign in to comment.