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
- Parameters:
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
- Returns:
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:
- pypeit.core.meta.define_additional_meta(nlamps=20)[source]
Defines meta that tends to be instrument-specific and not used as widely in the code.
See
define_core_meta()
for additional detailsFor meta used to define configurations, the rtol key specifies the relative tolerance for a match
- pypeit.core.meta.define_core_meta()[source]
Define the core set of meta data that must be defined to run PypeIt.
See the metadata.rst file for further discussion
Warning
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.
- Returns:
core_meta
- Return type:
- pypeit.core.meta.get_meta_data_model(nlamps=20)[source]
Construct full metadata model general to all spectrographs.
This is a wrapper for
define_core_meta()
anddefine_additional_meta()
that checks that the keys defined by both are unique (a coding issue) and returns a single combined dictionary.- Parameters:
nlamps (
int
, optional) – Number of calibrations lamps for this instrument, passed directly todefine_additional_meta()
.- Returns:
Dictionary with the full metadata model common to all spectrographs.
- Return type:
- Raises:
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.