diff --git a/doc/releases/1.16.1dev.rst b/doc/releases/1.16.1dev.rst index 9efeb5437..e038495ae 100644 --- a/doc/releases/1.16.1dev.rst +++ b/doc/releases/1.16.1dev.rst @@ -64,6 +64,11 @@ Instrument-specific Updates - Platescale updated from an order-dependent value, to being 0.164 arcsec/pixel for all orders - Add new P200/DBSP reid_arxiv template for 1200/7100 with D55 dichroic +- GMOS-South: PypeIt reductions of GMOS-South MOS observations now properly + account for tilted slits in the mask design file. Previously, these data + could only be reduced without including any information from the slitmask + design. + Script Changes -------------- diff --git a/pypeit/spectrographs/gemini_gmos.py b/pypeit/spectrographs/gemini_gmos.py index 3c861056a..955cf41d6 100644 --- a/pypeit/spectrographs/gemini_gmos.py +++ b/pypeit/spectrographs/gemini_gmos.py @@ -618,11 +618,8 @@ def get_slitmask(self, filename): offsets = np.sqrt( mask_tbl['slitpos_x'].to('arcsec').value**2 + mask_tbl['slitpos_y'].to('arcsec').value**2) - # NOT READY FOR TILTS - if np.any(np.invert(np.isclose(mask_tbl['slittilt'].value, 0.))): - msgs.error('NOT READY FOR TILTED SLITS') - # NOT SURE WE HAVE THE TILT SIGN CORRECT - slit_pas = posx_pa + mask_tbl['slittilt'].to('deg').value + # Sign here checked by Jack O'Donnell + slit_pas = posx_pa - mask_tbl['slittilt'].to('deg').value off_signs = np.ones_like(slit_pas) negy = mask_tbl['slitpos_y'] < 0. off_signs[negy] = -1. @@ -695,7 +692,7 @@ def get_maskdef_slitedges(self, ccdnum=None, filename=None, debug=None, self.get_slitmask(maskfile) # Binning of flat - _, bin_spat= parse.parse_binning(binning) + _, bin_spat = parse.parse_binning(binning) # Slit center slit_coords = SkyCoord(ra=self.slitmask.onsky[:,0], @@ -712,15 +709,16 @@ def get_maskdef_slitedges(self, ccdnum=None, filename=None, debug=None, left_edges = [] right_edges = [] for islit in range(self.slitmask.nslits): - # DEBUGGING - #islit = 14 # 10043 + # JOD: Need to adjust predicted images by slit tilt (which is + # slit PA relative to mask PA) + slittilt = self.slitmask.onsky[islit,4] - self.slitmask.posx_pa # Left coord left_coord = slit_coords[islit].directional_offset_by( self.slitmask.onsky[islit,4]*units.deg - 180.*units.deg, - self.slitmask.onsky[islit,2]*units.arcsec/2.) + self.slitmask.onsky[islit,2]*units.arcsec/2./np.cos(np.radians(slittilt))) right_coord = slit_coords[islit].directional_offset_by( self.slitmask.onsky[islit,4]*units.deg, - self.slitmask.onsky[islit,2]*units.arcsec/2.) + self.slitmask.onsky[islit,2]*units.arcsec/2./np.cos(np.radians(slittilt))) got_it = False for kk, iwcs in enumerate(wcss): @@ -748,6 +746,7 @@ def get_maskdef_slitedges(self, ccdnum=None, filename=None, debug=None, left_edges = np.array(left_edges).astype(float) right_edges = np.array(right_edges).astype(float) sortindx = np.argsort(left_edges) + return left_edges, right_edges, sortindx, self.slitmask class GeminiGMOSSHamSpectrograph(GeminiGMOSSpectrograph):