Skip to content

Commit b8122e6

Browse files
expose min_snr in adjustWavelengthZeroPoint. It was failing in some higher GNIRS XD order because the sky lines are a bit weak. The error message said to adjust the min_snr but it was hardcoded and the user had no way to adjust it. Now it is a parameter to the primitive and it solves the problem.
1 parent 3f39fcd commit b8122e6

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

geminidr/core/parameters_spect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class adjustWavelengthZeroPointConfig(config.Config):
4141
min=1, optional=True)
4242
shift = config.RangeField("Shift to apply in pixels (None: determine automatically)",
4343
float, 0, min=-2048, max=2048, optional=True)
44+
min_snr = config.RangeField("Minimum SNR for peak detection", float, 10., min=1.)
4445
verbose = config.Field("Print extra information", bool, False,
4546
optional=True)
4647
debug_max_shift = config.RangeField("Maximum shift to allow (in pixels)",

geminidr/core/primitives_spect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def _add_shift_model_to_wcs(shift, ext):
136136
sfx = params["suffix"]
137137
center = params["center"]
138138
shift = params["shift"]
139+
min_snr = params["min_snr"]
139140
max_shift = params["debug_max_shift"]
140141
verbose = params["verbose"]
141142

@@ -181,7 +182,7 @@ def _add_shift_model_to_wcs(shift, ext):
181182
"center": center,
182183
"nsum": 10,
183184
"fwidth": None,
184-
"min_snr": 10,
185+
"min_snr": min_snr,
185186
"min_sep": 2,
186187
"weighting": "local",
187188
"nbright": 0,

0 commit comments

Comments
 (0)