Skip to content
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

GMOS tilted slits #1827

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions pypeit/spectrographs/gemini_gmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,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.
Expand Down Expand Up @@ -694,7 +691,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],
Expand All @@ -711,15 +708,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):
Expand Down Expand Up @@ -747,6 +745,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):
Expand Down
Loading