FitsTranslator#

class astro_metadata_translator.FitsTranslator(header, filename=None)#

Bases: MetadataTranslator

Metadata translator for FITS standard headers.

Understands:

  • DATE-OBS/MJD-OBS or DATE-BEG/MJD-BEG (-BEG is preferred).

  • INSTRUME

  • TELESCOP

  • OBSGEO-[X,Y,Z]

Parameters:

Attributes Summary

all_properties

All the valid properties for this translator including extensions.

Methods Summary

can_translate(header[, filename])

Indicate whether this translation class can translate the supplied header.

to_datetime_begin()

Calculate start time of observation.

to_datetime_end()

Calculate end time of observation.

to_instrument()

The instrument used to observe the exposure.

to_location()

Calculate the observatory location.

to_telescope()

Full name of the telescope.

Attributes Documentation

all_properties: dict[str, PropertyDefinition] = {'altaz_begin': <astro_metadata_translator.properties.PropertyDefinition object>, 'altaz_end': <astro_metadata_translator.properties.PropertyDefinition object>, 'boresight_airmass': <astro_metadata_translator.properties.PropertyDefinition object>, 'boresight_rotation_angle': <astro_metadata_translator.properties.PropertyDefinition object>, 'boresight_rotation_coord': <astro_metadata_translator.properties.PropertyDefinition object>, 'can_see_sky': <astro_metadata_translator.properties.PropertyDefinition object>, 'dark_time': <astro_metadata_translator.properties.PropertyDefinition object>, 'datetime_begin': <astro_metadata_translator.properties.PropertyDefinition object>, 'datetime_end': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_exposure_id': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_group': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_name': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_num': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_serial': <astro_metadata_translator.properties.PropertyDefinition object>, 'detector_unique_name': <astro_metadata_translator.properties.PropertyDefinition object>, 'exposure_group': <astro_metadata_translator.properties.PropertyDefinition object>, 'exposure_id': <astro_metadata_translator.properties.PropertyDefinition object>, 'exposure_time': <astro_metadata_translator.properties.PropertyDefinition object>, 'exposure_time_requested': <astro_metadata_translator.properties.PropertyDefinition object>, 'focus_z': <astro_metadata_translator.properties.PropertyDefinition object>, 'group_counter_end': <astro_metadata_translator.properties.PropertyDefinition object>, 'group_counter_start': <astro_metadata_translator.properties.PropertyDefinition object>, 'has_simulated_content': <astro_metadata_translator.properties.PropertyDefinition object>, 'instrument': <astro_metadata_translator.properties.PropertyDefinition object>, 'location': <astro_metadata_translator.properties.PropertyDefinition object>, 'object': <astro_metadata_translator.properties.PropertyDefinition object>, 'observation_counter': <astro_metadata_translator.properties.PropertyDefinition object>, 'observation_id': <astro_metadata_translator.properties.PropertyDefinition object>, 'observation_reason': <astro_metadata_translator.properties.PropertyDefinition object>, 'observation_type': <astro_metadata_translator.properties.PropertyDefinition object>, 'observing_day': <astro_metadata_translator.properties.PropertyDefinition object>, 'observing_day_offset': <astro_metadata_translator.properties.PropertyDefinition object>, 'physical_filter': <astro_metadata_translator.properties.PropertyDefinition object>, 'pressure': <astro_metadata_translator.properties.PropertyDefinition object>, 'relative_humidity': <astro_metadata_translator.properties.PropertyDefinition object>, 'science_program': <astro_metadata_translator.properties.PropertyDefinition object>, 'telescope': <astro_metadata_translator.properties.PropertyDefinition object>, 'temperature': <astro_metadata_translator.properties.PropertyDefinition object>, 'tracking_radec': <astro_metadata_translator.properties.PropertyDefinition object>, 'visit_id': <astro_metadata_translator.properties.PropertyDefinition object>}#

All the valid properties for this translator including extensions.

Methods Documentation

classmethod can_translate(header, filename=None)#

Indicate whether this translation class can translate the supplied header.

Checks the instrument value and compares with the supported instruments in the class

Parameters:
  • header (dict-like) – Header to convert to standardized form.

  • filename (str, optional) – Name of file being translated.

Returns:

canTrue if the header is recognized by this class. False otherwise.

Return type:

bool

to_datetime_begin()#

Calculate start time of observation.

Uses FITS standard MJD-BEG or DATE-BEG, in conjunction with the TIMESYS header. Will fallback to using MJD-OBS or DATE-OBS if the -BEG variants are not found.

Returns:

start_time – Time corresponding to the start of the observation. Returns None if no date can be found.

Return type:

astropy.time.Time or None

to_datetime_end()#

Calculate end time of observation.

Uses FITS standard MJD-END or DATE-END, in conjunction with the TIMESYS header.

Returns:

start_time – Time corresponding to the end of the observation.

Return type:

astropy.time.Time

to_instrument()#

The instrument used to observe the exposure.

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_location()#

Calculate the observatory location.

Uses FITS standard OBSGEO- headers.

Returns:

location – An object representing the location of the telescope.

Return type:

astropy.coordinates.EarthLocation

to_telescope()#

Full name of the telescope.

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)