pypeit.spectrographs.mmt_binospec module

Module for MMT/BINOSPEC specific methods.

class pypeit.spectrographs.mmt_binospec.MMTBINOSPECSpectrograph[source]

Bases: Spectrograph

Child to handle MMT/BINOSPEC specific code

bpm(filename, det, shape=None, msbias=None)[source]

Generate a default bad-pixel mask.

Even though they are both optional, either the precise shape for the image (shape) or an example file that can be read to get the shape (filename using get_image_shape()) must be provided.

  • filename (str or None) – An example file to use to get the image shape.

  • det (int) – 1-indexed detector number to use when getting the image shape from the example file.

  • shape (tuple, optional) – Processed image shape Required if filename is None Ignored if filename is not None

  • msbias (numpy.ndarray, optional) – Processed bias frame used to identify bad pixels


An integer array with a masked value set to 1 and an unmasked value set to 0. All values are set to 0.

Return type:


camera = 'BINOSPEC'

Name of the spectrograph camera or arm. This is used by specdb, so use that naming convention

check_frame_type(ftype, fitstbl, exprng=None)[source]

Check for frames of the provided type.


Boolean array with the flags selecting the exposures in fitstbl that are ftype type frames.

Return type:


compound_meta(headarr, meta_key)[source]

Methods to generate metadata requiring interpretation of the header data, instead of simply reading the value of a header card.


Metadata value read from the header(s).

Return type:


config_specific_par(scifile, inp_par=None)[source]

Modify the PypeIt parameters to hard-wired values used for specific instrument configurations.

  • scifile (str) – File to use when determining the configuration and how to adjust the input parameters.

  • inp_par (ParSet, optional) – Parameter set used for the full run of PypeIt. If None, use default_pypeit_par().


The PypeIt parameter set adjusted for configuration specific parameter values.

Return type:



Return the metadata keys that define a unique instrument configuration.

This list is used by PypeItMetaData to identify the unique configurations among the list of frames read for a given reduction.


List of keywords of data pulled from file headers and used to constuct the PypeItMetaData object.

Return type:


classmethod default_pypeit_par()[source]

Return the default parameters to use for this instrument.


Parameters required by all of PypeIt methods.

Return type:


get_detector_par(det, hdu=None)[source]

Return metadata for the selected detector.

  • det (int) – 1-indexed detector number.

  • hdu (, optional) – The open fits file with the raw image of interest. If not provided, frame-dependent parameters are set to a default.


Object with the detector metadata.

Return type:


get_rawimage(raw_file, det)[source]

Read raw images and generate a few other bits and pieces that are key for image processing.

  • raw_file (str) – File to read

  • det (int) – 1-indexed detector to read


  • detector_par (pypeit.images.detector_container.DetectorContainer) – Detector metadata parameters.

  • raw_img (numpy.ndarray) – Raw image for this detector.

  • hdu ( – Opened fits file

  • exptime (float) – Exposure time read from the file header

  • rawdatasec_img (numpy.ndarray) – Data (Science) section of the detector as provided by setting the (1-indexed) number of the amplifier used to read each detector pixel. Pixels unassociated with any amplifier are set to 0.

  • oscansec_img (numpy.ndarray) – Overscan section of the detector as provided by setting the (1-indexed) number of the amplifier used to read each detector pixel. Pixels unassociated with any amplifier are set to 0.

header_name = 'Binospec'

Name of the spectrograph camera or arm from the Header. Usually the INSTRUME card.


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 meta.

name = 'mmt_binospec'

The name of the spectrograph. See Spectrographs for the currently supported spectrographs.

ndet = 2

Number of detectors for this instrument.


Return additional raw header cards to be propagated in downstream output files for configuration identification.

The list of raw data FITS keywords should be those used to populate the configuration_keys() or are used in config_specific_par() for a particular spectrograph, if different from the name of the PypeIt metadata keyword.

This list is used by subheader_for_spec() to include additional FITS keywords in downstream output files.


List of keywords from the raw data files that should be propagated in output files.

Return type:


supported = True

Flag that PypeIt code base has been sufficiently tested with data from this spectrograph that it is officially supported by the development team.

telescope = Parameter     Value                Default  Type        Callable ---------------------------------------------------------------- name          MMT                  KECK     str         False    longitude     -110.87750000000003  None     int, float  False    latitude      31.68094444444444    None     int, float  False    elevation     2319.9999999995903   None     int, float  False    fratio        None                 None     int, float  False    diameter      6.5                  None     int, float  False    eff_aperture  None                 None     int, float  False   

Instance of TelescopePar providing telescope-specific metadata.

url = ''

Reference url

pypeit.spectrographs.mmt_binospec.binospec_read_amp(inp, ext)[source]

Read one amplifier of an MMT BINOSPEC multi-extension FITS image


inp (tuple) – (str,int) filename, extension (hdu,int) FITS hdu, extension


  • data

  • predata

  • postdata

  • x1

  • y1

  • ;————————————————————————

  • function lris_read_amp, filename, ext, $ – linebias=linebias, nobias=nobias, $ predata=predata, postdata=postdata, header=header, $ x1=x1, x2=x2, y1=y1, y2=y2, GAINDATA=gaindata

  • ;————————————————————————

  • ; Read one amp from LRIS mHDU image

  • ;————————————————————————