pypeit.images.mosaic module

DataContainer object to hold mosaic properties.

class pypeit.images.mosaic.Mosaic(id, detectors, shape, shift, rot, tform, msc_order)[source]

Bases: DataContainer

Class to hold mosaic parameters and the details of the detectors used to construct the mosaic.

The datamodel attributes are:

Version: 1.0.0



Array Type




On-chip binning




List of objects with detector parameters.



Mosaic ID number



Order of the interpolation used to construct the mosaic.



Detector platescale in arcsec/pixel




Raw, hard-coded rotations (counter-clockwise in degrees) for each unbinned detector



Shape of each processed detector image




Raw, hard-coded pixel shifts for each unbinned detector




The full transformation matrix for each detector used to construct the mosaic.


Overload base class bundling so that the mosaic data is collected into an astropy Table with one row for each detector.


List of dictionaries to write to HDUs.

Return type:


classmethod _parse(hdu, hdu_prefix=None, **kwargs)[source]

Parse the data from the provided HDU.

See pypeit.datamodel.DataContainer._parse() for the argument descriptions.


Validate the mosaic.

datamodel = {'binning': {'descr': 'On-chip binning', 'otype': <class 'str'>}, 'detectors': {'atype': <class 'pypeit.images.detector_container.DetectorContainer'>, 'descr': 'List of objects with detector parameters.', 'otype': <class 'numpy.ndarray'>}, 'id': {'descr': 'Mosaic ID number', 'otype': <class 'int'>}, 'msc_order': {'descr': 'Order of the interpolation used to construct the mosaic.', 'otype': <class 'int'>}, 'platescale': {'descr': 'Detector platescale in arcsec/pixel', 'otype': <class 'float'>}, 'rot': {'atype': <class 'float'>, 'descr': 'Raw, hard-coded rotations (counter-clockwise in degrees) for each unbinned detector', 'otype': <class 'numpy.ndarray'>}, 'shape': {'descr': 'Shape of each processed detector image', 'otype': <class 'tuple'>}, 'shift': {'atype': <class 'float'>, 'descr': 'Raw, hard-coded pixel shifts for each unbinned detector', 'otype': <class 'numpy.ndarray'>}, 'tform': {'atype': <class 'float'>, 'descr': 'The full transformation matrix for each detector used to construct the mosaic.', 'otype': <class 'numpy.ndarray'>}}

Provides the class data model. This is undefined in the abstract class and should be overwritten in the derived classes.

The format of the datamodel needed for each implementation of a DataContainer derived class is as follows.

The datamodel itself is a class attribute (i.e., it is a member of the class, not just of an instance of the class). The datamodel is a dictionary of dictionaries: Each key of the datamodel dictionary provides the name of a given datamodel element, and the associated item (dictionary) for the datamodel element provides the type and description information for that datamodel element. For each datamodel element, the dictionary item must provide:

  • otype: This is the type of the object for this datamodel item. E.g., for a float or a numpy.ndarray, you would set otype=float and otype=np.ndarray, respectively.

  • descr: This provides a text description of the datamodel element. This is used to construct the datamodel tables in the pypeit documentation.

If the object type is a numpy.ndarray, you should also provide the atype keyword that sets the type of the data contained within the array. E.g., for a floating point array containing an image, your datamodel could be simply:

datamodel = {'image' : dict(otype=np.ndarray, atype=float, descr='My image')}

More advanced examples are given in the top-level module documentation.

Currently, datamodel components are restricted to have otype that are tuple, int, float, numpy.integer, numpy.floating, numpy.ndarray, or astropy.table.Table objects. E.g., datamodel values for otype cannot be dict.

property det

Return a tuple with the set of detector ids in the mosaic.

static get_id_str(mosaic_id)[source]

Return a string identifier for the detector.

static get_name(mosaic_id)[source]

Return a name for the mosaic.

property name

Return a name for the mosaic.

name_prefix = 'MSC'

Prefix for the name of the mosaic.

property ndet

Return the number of detectors in the mosaic.

static parse_name(name)[source]

Parse the numerical identifier of the mosaic from its name.

version = '1.0.0'

Provides the string representation of the class version.

This is currently put to minimal use so far, but will used for I/O verification in the future.

Each derived class should provide a version to guard against data model changes during development.