-
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
Adds R4K support for MDM OSMOS #1710
Changes from all commits
409a31a
3a77f1f
7a841d2
a336074
4f134be
3f3ff96
7e5d029
af6c573
064e7f8
a234a40
3892870
f3425fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
********* | ||
MDM OSMOS | ||
********* | ||
|
||
|
||
Overview | ||
======== | ||
|
||
This file summarizes items related to MDM OSMOS | ||
|
||
|
||
R4K | ||
=== | ||
|
||
It is common for only a portion of | ||
the data one receives to have been | ||
windowed. You may therefore need to | ||
window the rest. There is a Notebook | ||
in the DevSuite that shows an example of | ||
how to do this. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ def default_pypeit_par(cls): | |
""" | ||
par = super().default_pypeit_par() | ||
|
||
|
||
# Ignore PCA | ||
par['calibrations']['slitedges']['sync_predict'] = 'nearest' | ||
|
||
|
@@ -233,3 +234,135 @@ def check_frame_type(self, ftype, fitstbl, exprng=None): | |
msgs.warn('Cannot determine if frames are of type {0}.'.format(ftype)) | ||
return np.zeros(len(fitstbl), dtype=bool) | ||
|
||
|
||
class MDMOSMOSR4KSpectrograph(MDMOSMOSMDM4KSpectrograph): | ||
""" | ||
Child to handle MDM OSMOS R4K instrument+detector | ||
""" | ||
ndet = 1 | ||
name = 'mdm_osmos_r4k' | ||
camera = 'R4K' | ||
url = 'https://www.astronomy.ohio-state.edu/martini.10/osmos/' | ||
header_name = 'OSMOS' | ||
supported = True | ||
comment = 'MDM OSMOS spectrometer for the red. Requires calibrations windowed down to the science frame.' | ||
|
||
def get_detector_par(self, det, hdu=None): | ||
""" | ||
Return metadata for the selected detector. | ||
|
||
THIS IS FOR WINDOWED SCIENCE FRAMES | ||
AND WE ARE HACKING THE CALIBS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should consider providing a script that does this. I realize this is pretty specific because it's only needed for this instrument, but I imagine users would be happier calling something like |
||
|
||
Args: | ||
det (:obj:`int`): | ||
1-indexed detector number. | ||
hdu (`astropy.io.fits.HDUList`_, optional): | ||
The open fits file with the raw image of interest. If not | ||
provided, frame-dependent parameters are set to a default. | ||
|
||
Returns: | ||
:class:`~pypeit.images.detector_container.DetectorContainer`: | ||
Object with the detector metadata. | ||
""" | ||
# Detector 1 | ||
detector_dict = dict( | ||
binning = '1,1' if hdu is None | ||
else self.get_meta_value(self.get_headarr(hdu), 'binning'), | ||
det=1, | ||
dataext = 0, | ||
specaxis = 1, | ||
specflip = True, | ||
spatflip = False, | ||
xgap = 0., | ||
ygap = 0., | ||
ysize = 1., | ||
platescale = 0.273, | ||
mincounts = -1e10, | ||
darkcurr = 0.0, | ||
saturation = 65535., | ||
nonlinear = 0.86, | ||
numamplifiers = 4, | ||
gain = np.atleast_1d([2.2, 2.2, 2.2, 2.2]), | ||
ronoise = np.atleast_1d([3.0, 3.0, 3.0, 3.0]), | ||
datasec = np.atleast_1d(['[:524,33:2064]', '[524:,33:2064]', | ||
'[:524, 2065:4092', '[524:, 2065:4092']), | ||
oscansec = np.atleast_1d(['[:524, 1:32]', '[524:, 1:32]', | ||
'[:524, 4129:]', '[524:, 4129:]']), | ||
) | ||
# Return | ||
return detector_container.DetectorContainer(**detector_dict) | ||
|
||
def check_frame_type(self, ftype, fitstbl, exprng=None): | ||
""" | ||
Check for frames of the provided type. | ||
|
||
Args: | ||
ftype (:obj:`str`): | ||
Type of frame to check. Must be a valid frame type; see | ||
frame-type :ref:`frame_type_defs`. | ||
fitstbl (`astropy.table.Table`_): | ||
The table with the metadata for one or more frames to check. | ||
exprng (:obj:`list`, optional): | ||
Range in the allowed exposure time for a frame of type | ||
``ftype``. See | ||
:func:`pypeit.core.framematch.check_frame_exptime`. | ||
|
||
Returns: | ||
`numpy.ndarray`_: Boolean array with the flags selecting the | ||
exposures in ``fitstbl`` that are ``ftype`` type frames. | ||
""" | ||
good_exp = framematch.check_frame_exptime(fitstbl['exptime'], exprng) | ||
if ftype in ['science', 'standard']: | ||
return good_exp & (fitstbl['idname'] == 'OBJECT') | ||
if ftype == 'bias': | ||
return good_exp & (fitstbl['idname'] == 'zero') | ||
if ftype in ['pixelflat', 'trace']: | ||
return good_exp & (fitstbl['lampstat01'] == 'Flat') & (fitstbl['idname'] == 'FLAT') | ||
if ftype in ['pinhole', 'dark']: | ||
# Don't type pinhole or dark frames | ||
return np.zeros(len(fitstbl), dtype=bool) | ||
if ftype in ['arc','tilt']: | ||
return good_exp & (fitstbl['idname'] == 'COMP') | ||
msgs.warn('Cannot determine if frames are of type {0}.'.format(ftype)) | ||
return np.zeros(len(fitstbl), dtype=bool) | ||
|
||
@classmethod | ||
def default_pypeit_par(cls): | ||
""" | ||
Return the default parameters to use for this instrument. | ||
|
||
Returns: | ||
:class:`~pypeit.par.pypeitpar.PypeItPar`: Parameters required by | ||
all of PypeIt methods. | ||
""" | ||
par = super().default_pypeit_par() | ||
|
||
# Do not require bias frames | ||
turn_off = dict(use_biasimage=False, overscan_method='odd_even') | ||
par.reset_all_processimages_par(**turn_off) | ||
|
||
# Ignore PCA | ||
par['calibrations']['slitedges']['sync_predict'] = 'nearest' | ||
# Bound the detector with slit edges if no edges are found | ||
par['calibrations']['slitedges']['bound_detector'] = True | ||
|
||
# Set pixel flat combination method | ||
par['calibrations']['pixelflatframe']['process']['combine'] = 'median' | ||
# Wavelength calibration methods | ||
par['calibrations']['wavelengths']['method'] = 'full_template' | ||
#par['calibrations']['wavelengths']['method'] = 'reidentify' | ||
par['calibrations']['wavelengths']['lamps'] = ['HgI', 'NeI'] | ||
par['calibrations']['wavelengths']['reid_arxiv'] = 'mdm_osmos_r4k.fits' | ||
par['calibrations']['wavelengths']['sigdetect'] = 5.0 | ||
par['calibrations']['wavelengths']['nsnippet'] = 1 | ||
par['calibrations']['wavelengths']['fwhm_fromlines'] = True | ||
# Set the default exposure time ranges for the frame typing | ||
par['calibrations']['biasframe']['exprng'] = [None, 1] | ||
par['calibrations']['darkframe']['exprng'] = [999999, None] # No dark frames | ||
par['calibrations']['pinholeframe']['exprng'] = [999999, None] # No pinhole frames | ||
par['calibrations']['arcframe']['exprng'] = [None, None] # Long arc exposures on this telescope | ||
par['calibrations']['standardframe']['exprng'] = [None, 120] | ||
par['scienceframe']['exprng'] = [90, None] | ||
|
||
return par |
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.
Provide a link.