Skip to content

Commit

Permalink
Merge branch 'master' of github.com:GeminiDRSoftware/DRAGONS
Browse files Browse the repository at this point in the history
  • Loading branch information
KathleenLabrie committed Mar 30, 2023
2 parents a9886ed + 72ab152 commit 3682b37
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion geminidr/core/primitives_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,10 +1222,11 @@ def determineSlitEdges(self, adinputs=None, **params):

# Get the expected slit center and length for long slit.
if (edges1 is not None) and (edges2 is not None):
log.fullinfo('Using user-supplied edges.')
log.stdinfo('Using user-supplied edges.')
exp_edges_1, exp_edges_2 = edges1, edges2
elif (edges1 is None) and (edges2 is None):
exp_edges_1, exp_edges_2 = self._get_slit_edge_estimates(ad)
log.debug('Estimating fit edges...')
else:
log.warning("Both `edges1` and `edges2` parameters need to be "
"provided in order to use them. Using "
Expand Down
8 changes: 8 additions & 0 deletions geminidr/core/tests/test_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def test_sky_correct_from_slit_with_multiple_sources():
@pytest.mark.preprocessed_data
@pytest.mark.parametrize('filename,instrument',
[('N20121118S0375_stack.fits', 'GNIRS'),
('N20180605S0138_stack.fits', 'GNIRS'),
('S20040413S0268_stack.fits', 'GNIRS'),
('N20110718S0129_stack.fits', 'GNIRS'),
('S20140728S0282_stack.fits', 'F2'),
Expand All @@ -363,6 +364,13 @@ def test_determine_slit_edges(filename, instrument, change_working_dir,
'c2': (-0.008639441981396224, -0.008639441981396224),
'c3': (0.006629301489564899, 0.006629301489564899)
},
'N20180605S0138_stack.fits': {
# GNIRS 111/mm LongBlue, off left edge of detector
'c0': (-16.666408005668814, 975.6436215963819),
'c1': (-7.318016142494172, -7.318016142494172),
'c2': (-0.029505932328147154, -0.029505932328147154),
'c3': (0.03802744314590496, 0.03802744314590496)
},
'S20040413S0268_stack.fits': {
# GNIRS 32/mm ShortRed, centered
'c0': (175.1038780784617, 833.0919423028884),
Expand Down
6 changes: 6 additions & 0 deletions geminidr/gmos/primitives_gmos_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,12 @@ def standardizeWCS(self, adinputs=None, **params):
return adinputs

def _get_arc_linelist(self, waves=None, ad=None):
# There aren't many lines in the very red, so one way to improve the
# wavecal might have been to take out any blocking filter to get all the
# lines from ~500 nm at twice the wavelength. The GMOS team doesn't do
# that, however, so it would just results in a bunch of extra lines that
# don't actually exist, so keep use_second_order = False here; the code
# is left as a template for how such stuff might operate.
use_second_order = waves.max() > 1000 and abs(np.diff(waves).mean()) < 0.2

use_second_order = False
Expand Down
8 changes: 7 additions & 1 deletion geminidr/gnirs/primitives_gnirs_longslit.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ def addMDF(self, adinputs=None, suffix=None, mdf=None):
mdf['slitsize_mx'][0] = corrections['slit_long_north']

if ('LongBlue' in ad.camera()):
mdf['x_ccd'][0] = corrections['x_longblue_north']
if not ('111/mm' in ad.disperser()):
# 111/mm can have the illuminated region shifted to
# either side 😔, see e.g. N20120419S0097.fits (right
# edge visible) and N20121213S0312.fits (left edge
# visible). Better to leave it uncorrected and trust
# determineSlitEdges to find the edge in that case.
mdf['x_ccd'][0] = corrections['x_longblue_north']


# For GNIRS, the 'slitsize_mx' column is in arcsec, so grab it:
Expand Down

0 comments on commit 3682b37

Please sign in to comment.