pypeit.core.meta module

Provides methods common to PypeItMetaData and Spectrograph that define the common metadata used for all spectrographs.

pypeit.core.meta.convert_radec(ra, dec)[source]

Handle multiple ra,dec inputs and return decimal degrees

If ra, dec are str but do not have J or ‘:’ in the RA term, then they will be converted to floats

  • ra (str or float or numpy.ndarray) – RA as decimal deg (float) or hh:mm:ss.s (str)

  • dec (str or float or numpy.ndarray) – DEC as decimal deg (float) or +dd:mm:ss.s (str) Must be the same format as ra


float,float of ra,dec in decimal deg if input is str or float np.ndarray, np.ndarray of ra,dec in decimal deg if input is np.ndarray

Return type:



Defines meta that tends to be instrument-specific and not used as widely in the code.

See define_core_meta() for additional details

For meta used to define configurations, the rtol key specifies the relative tolerance for a match


nlamps (int, optional) – Number of calibrations lamps for this instrument.


Describes the additional meta data used in pypeit.

Return type:



Define the core set of meta data that must be defined to run PypeIt.

See the metadata.rst file for further discussion


The keys should all be <= 8 length as they are all written to the Header.

Each meta entry is a dict with the following keys:
  • dtype: str, float, int

  • comment: str

  • rtol: float, optional – Sets the relative tolerance for float meta when used to set a configuration

Each meta dtype must be scalar or str. No tuple, list, ndarray, etc.



Return type:



Construct full metadata model general to all spectrographs.

This is a wrapper for define_core_meta() and define_additional_meta() that checks that the keys defined by both are unique (a coding issue) and returns a single combined dictionary.


nlamps (int, optional) – Number of calibrations lamps for this instrument, passed directly to define_additional_meta().


Dictionary with the full metadata model common to all spectrographs.

Return type:



ValueError – Raised if the coding of func:define_core_meta and define_additional_meta() do not produce unique keys. This should never be raised in the released version.