-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wave rms refactor #1672
wave rms refactor #1672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff. If you can inspect the outputs for a few of the ones I mentioned, that would be great. Maybe you have already. :)
pypeit/core/wavecal/autoid.py
Outdated
@@ -1712,6 +1724,10 @@ class HolyGrail: | |||
islinelist : bool, optional | |||
Is lamps a linelist (True), or a list of ions (False) | |||
The former is not recommended except by expert users/developers | |||
rms_thresh : float, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't optional, right?
@@ -1712,6 +1724,10 @@ class HolyGrail: | |||
islinelist : bool, optional | |||
Is lamps a linelist (True), or a list of ions (False) | |||
The former is not recommended except by expert users/developers | |||
rms_thresh : float, optional | |||
RMS threshold for the wavelength solution fit | |||
measured_fwhms : ndarray, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe explain what happens if it isn't provided?
pypeit/spectrographs/gemini_gnirs.py
Outdated
@@ -322,7 +322,8 @@ def config_specific_par(self, scifile, inp_par=None): | |||
par['calibrations']['slitedges']['fit_min_spec_length'] = 0.5 | |||
|
|||
# Wavelengths | |||
par['calibrations']['wavelengths']['rms_threshold'] = 1.0 # Might be grating dependent.. | |||
par['calibrations']['wavelengths']['rms_thresh_frac_fwhm'] = 0.4 # Might be grating dependent.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am a bit surprised at how high this is, but it was before.
@jhennawi -- does this make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know where I got 2.5 for fwhm
, it's more like 4 (the default) from the dev suite. I changed that. The RMS values for 32/mm
are pretty high in the Dev Suite (even before these changes), the calibration wasn't that great. See below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pypeit/spectrographs/gemini_gnirs.py
Outdated
@@ -354,7 +355,7 @@ def config_specific_par(self, scifile, inp_par=None): | |||
par['calibrations']['slitedges']['sync_predict'] = 'nearest' | |||
|
|||
# Wavelengths | |||
par['calibrations']['wavelengths']['rms_threshold'] = 1.0 # Might be grating dependent.. | |||
par['calibrations']['wavelengths']['rms_thresh_frac_fwhm'] = 1.0 # Might be grating dependent.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. we should inspect the solutions for GNIRS and see if this makes sense..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have forgotten to change this. I checked the values in the Dev Suite and rms is ~0.1 (fwhm ~3pixels), so I changed this to 0.05
@@ -391,9 +392,9 @@ def default_pypeit_par(cls): | |||
|
|||
# Wavelengths | |||
# 1D wavelength solution with arc lines | |||
par['calibrations']['wavelengths']['rms_threshold'] = 1.0 | |||
par['calibrations']['wavelengths']['rms_thresh_frac_fwhm'] = 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be 0.05 given we reduced the FWHM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to 0.05, but it does not matter much, since FIRE long uses the template
method and the rms threshold is not used.
@@ -310,7 +310,7 @@ def default_pypeit_par(cls): | |||
par['calibrations']['wavelengths']['lamps'] = ['NeI', 'ArI', 'HgI'] | |||
# Wavelengths | |||
# 1D wavelength solution | |||
par['calibrations']['wavelengths']['rms_threshold'] = 0.5 | |||
par['calibrations']['wavelengths']['rms_thresh_frac_fwhm'] = 0.17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 0.1? I'm assuming you found a higher value was better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that the measured fwhm is more like 3 pixels (but 2x binned), therefore rms_thresh_frac_fwhm
would become 0.17. The datasets that we have in the Dev Suite use the template
method anyway.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## develop #1672 +/- ##
===========================================
- Coverage 41.33% 41.09% -0.25%
===========================================
Files 189 189
Lines 43296 43544 +248
===========================================
- Hits 17896 17893 -3
- Misses 25400 25651 +251
|
@jhennawi I set for all the spectrographs to use the measured fwhm. The Dev Suite run is successful. These are the slits/orders that have a difference of RMS >0.1 compared to a
|
#embed() | ||
|
||
return new_bad_slits | ||
# This routine is commented out because it is not used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we move to deprecated.
# plt.show() | ||
# #embed() | ||
# | ||
# return new_bad_slits | ||
|
||
def get_use_tcent_old(self, corr, cut=True, arr_err=None, weak=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It this ever used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Great work here.
For the records, full Dev suite tests pass.
|
As titled. The parameter
rms_thresh
is now replaced byrms_thresh_frac_fwhm
, which is expressed as a fraction of FWHM.I run the Dev Suite and it passed. I compared the wavelength calibration with these changes to a Dev Suite run in the
develop
branch, see plots. What do you think?