def __init__(self): # Get it started super(WHTISISBlueSpectrograph, self).__init__() self.spectrograph = 'wht_isis_blue' self.telescope = telescopes.WHTTelescopePar() self.camera = 'ISISb' self.detector = [ # Detector 1 pypeitpar.DetectorPar( dataext = 1, specaxis = 0, specflip = False, xgap = 0., ygap = 0., ysize = 1., platescale = 0.225, darkcurr = 0.0, saturation = 65535., nonlinear = 0.76, numamplifiers = 1, gain = 1.2, ronoise = 5.0, datasec = '[:,2:4030]', oscansec = None, suffix = '_blue' )] self.numhead = 2
class WHTISISSpectrograph(spectrograph.Spectrograph): """ Child to handle WHT/ISIS specific code """ ndet = 1 telescope = telescopes.WHTTelescopePar() def configuration_keys(self): """ Return the metadata keys that define a unique instrument configuration. This list is used by :class:`~pypeit.metadata.PypeItMetaData` to identify the unique configurations among the list of frames read for a given reduction. Returns: :obj:`list`: List of keywords of data pulled from file headers and used to constuct the :class:`~pypeit.metadata.PypeItMetaData` object. """ return ['dispname', 'decker', 'binning', 'dispangle', 'dichroic'] def init_meta(self): """ Define how metadata are derived from the spectrograph files. That is, this associates the ``PypeIt``-specific metadata keywords with the instrument-specific header cards using :attr:`meta`. """ self.meta = {} # Required (core) self.meta['ra'] = dict(ext=0, card='RA') self.meta['dec'] = dict(ext=0, card='DEC') self.meta['target'] = dict(ext=0, card='OBJECT') self.meta['decker'] = dict(card=None, compound=True) self.meta['binning'] = dict(card=None, compound=True) self.meta['mjd'] = dict(ext=0, card='MJD-OBS') self.meta['exptime'] = dict(ext=0, card='EXPTIME') self.meta['airmass'] = dict(ext=0, card='AIRMASS') self.meta['decker'] = dict(ext=0, card='ISISLITU') # Extras for config and frametyping self.meta['dispname'] = dict(ext=0, card='ISIGRAT') self.meta['dichroic'] = dict(ext=0, card='ISIDICHR') self.meta['dispangle'] = dict(ext=0, card='CENWAVE', rtol=1e-3) self.meta['slitwid'] = dict(ext=0, card='ISISLITW') self.meta['idname'] = dict(ext=0, card='IMAGETYP') # Lamps self.meta['lampstat01'] = dict(ext=0, card='CAGLAMPS') def compound_meta(self, headarr, meta_key): """ Methods to generate metadata requiring interpretation of the header data, instead of simply reading the value of a header card. Args: headarr (:obj:`list`): List of `astropy.io.fits.Header`_ objects. meta_key (:obj:`str`): Metadata keyword to construct. Returns: object: Metadata value read from the header(s). """ if meta_key == 'binning': binspatial = headarr[0]['CCDXBIN'] binspec = headarr[0]['CCDYBIN'] return parse.binning2string(binspec, binspatial) msgs.error("Not ready for this compound meta") def pypeit_file_keys(self): """ Define the list of keys to be output into a standard ``PypeIt`` file. Returns: :obj:`list`: The list of keywords in the relevant :class:`~pypeit.metadata.PypeItMetaData` instance to print to the :ref:`pypeit_file`. """ return super().pypeit_file_keys() + ['slitwid']
def __init__(self): # Get it started super(WHTISISSpectrograph, self).__init__() self.spectrograph = 'wht_isis' self.telescope = telescopes.WHTTelescopePar()