VisitInfoTranslator#

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

Bases: FitsTranslator

Metadata translator for afw VisitInfo serialization.

VisitInfo is only defined for on-sky observations.

VisitInfo does not encode the following properties:

  • observing_day

  • detector_serial

  • detector_unique_name

  • detector_group

  • detector_name

Some values can be found if there is butler provenance:

  • detector_num

  • visit_id

Parameters:

Attributes Summary

all_properties

All the valid properties for this translator including extensions.

default_resource_root

Corrections are not supported by this translator.

name

Name of this translation class

supported_instrument

Does not correspond to a single instrument.

Methods Summary

can_translate(header[, filename])

Indicate whether this translation class can translate the supplied header.

fix_header(header, instrument, obsid[, filename])

Fix DECam headers.

to_altaz_begin()

Return value of altaz_begin from headers.

to_boresight_airmass()

Airmass of the boresight of the telescope.

to_boresight_rotation_angle()

Angle of the instrument in boresight_rotation_coord frame.

to_boresight_rotation_coord()

Return value of boresight_rotation_coord from headers.

to_dark_time()

Duration of the exposure with shutter closed (seconds).

to_datetime_begin()

Calculate start time of observation.

to_datetime_end()

Calculate end time of observation.

to_detector_exposure_id()

Unique integer identifier for this detector in this exposure.

to_detector_group()

Collection name of which this detector is a part.

to_detector_name()

Name of the detector within the instrument (might not be unique if there are detector groups).

to_detector_num()

Unique (for instrument) integer identifier for the sensor.

to_detector_serial()

Serial number/string associated with this detector.

to_detector_unique_name()

Unique name of the detector within the focal plane, generally combining detector_group with detector_name.

to_exposure_id()

Unique (with instrument) integer identifier for this observation.

to_exposure_time()

Actual duration of the exposure (seconds).

to_focus_z()

Defocal distance.

to_has_simulated_content()

Boolean indicating whether any part of this observation was simulated.

to_instrument()

The instrument used to observe the exposure.

to_location()

Calculate the observatory location.

to_object()

Object of interest or field name.

to_observation_counter()

Return the exposure ID as proxy for counter.

to_observation_id()

Label uniquely identifying this observation (can be related to 'exposure_id').

to_observation_reason()

Reason this observation was taken, or its purpose ('science' and 'calibration' are common values)

to_observation_type()

Type of observation (currently: science, dark, flat, bias, focus).

to_physical_filter()

The bandpass filter used for this observation.

to_pressure()

Atmospheric pressure outside the dome.

to_relative_humidity()

Relative humidity outside the dome.

to_science_program()

Observing program (survey or proposal) identifier.

to_telescope()

Full name of the telescope.

to_temperature()

Temperature outside the dome.

to_tracking_radec()

Return value of tracking_radec from headers.

to_visit_id()

Return value of visit_id from headers.

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.

default_resource_root: str | None = None#

Corrections are not supported by this translator.

name: str | None = 'VisitInfo'#

Name of this translation class

supported_instrument: str | None = None#

Does not correspond to a single instrument.

Methods Documentation

classmethod can_translate(header, filename=None)#

Indicate whether this translation class can translate the supplied header.

Always returns False. This translator has to be selected explicitly from context.

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

classmethod fix_header(header, instrument, obsid, filename=None)#

Fix DECam headers.

Parameters:
  • header (dict) – The header to update. Updates are in place.

  • instrument (str) – The name of the instrument.

  • obsid (str) – Unique observation identifier associated with this header. Will always be provided.

  • filename (str, optional) – Filename associated with this header. May not be set since headers can be fixed independently of any filename being known.

Returns:

modified – Returns True if the header was updated.

Return type:

bool

Notes

No fixes are applied for VisitInfo at this time.

to_altaz_begin()#

Return value of altaz_begin from headers.

Telescope boresight azimuth and elevation at start of observation.

Returns:

The translated property.

Return type:

astropy.coordinates.builtin_frames.altaz.AltAz

to_boresight_airmass()#

Airmass of the boresight of the telescope.

Returns:

Translated value derived directly from a single header.

Return type:

float

Parameters:

self (MetadataTranslator)

to_boresight_rotation_angle()#

Angle of the instrument in boresight_rotation_coord frame.

Returns:

Translated value derived directly from a single header.

Return type:

astropy.coordinates.angles.core.Angle

Parameters:

self (MetadataTranslator)

to_boresight_rotation_coord()#

Return value of boresight_rotation_coord from headers.

Coordinate frame of the instrument rotation angle (options: sky, unknown).

Returns:

The translated property.

Return type:

str

to_dark_time()#

Duration of the exposure with shutter closed (seconds).

Returns:

Translated value derived directly from a single header.

Return type:

astropy.units.quantity.Quantity

Parameters:

self (MetadataTranslator)

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_detector_exposure_id()#

Unique integer identifier for this detector in this exposure.

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

int

Parameters:

self (MetadataTranslator)

to_detector_group()#

Collection name of which this detector is a part. Can be None if there are no detector groupings.

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

str

Parameters:

self (MetadataTranslator)

to_detector_name()#

Name of the detector within the instrument (might not be unique if there are detector groups).

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

str

Parameters:

self (MetadataTranslator)

to_detector_num()#

Unique (for instrument) integer identifier for the sensor.

Returns:

Translated value derived directly from a single header.

Return type:

int

Parameters:

self (MetadataTranslator)

to_detector_serial()#

Serial number/string associated with this detector.

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

str

Parameters:

self (MetadataTranslator)

to_detector_unique_name()#

Unique name of the detector within the focal plane, generally combining detector_group with detector_name.

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

str

Parameters:

self (MetadataTranslator)

to_exposure_id()#

Unique (with instrument) integer identifier for this observation.

Returns:

Translated value derived directly from a single header.

Return type:

int

Parameters:

self (MetadataTranslator)

to_exposure_time()#

Actual duration of the exposure (seconds).

Returns:

Translated value derived directly from a single header.

Return type:

astropy.units.quantity.Quantity

Parameters:

self (MetadataTranslator)

to_focus_z()#

Defocal distance.

Returns:

Translated value derived directly from a single header.

Return type:

astropy.units.quantity.Quantity

Parameters:

self (MetadataTranslator)

to_has_simulated_content()#

Boolean indicating whether any part of this observation was simulated.

Returns:

Translated value derived directly from a single header.

Return type:

bool

Parameters:

self (MetadataTranslator)

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.

Returns:

location – An object representing the location of the telescope.

Return type:

astropy.coordinates.EarthLocation

to_object()#

Object of interest or field name.

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_observation_counter()#

Return the exposure ID as proxy for counter.

Some exposure IDs encode a year and counter in the integer, others simply have an incrementing counter

Returns:

sequence – The observation counter.

Return type:

int

to_observation_id()#

Label uniquely identifying this observation (can be related to ‘exposure_id’).

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_observation_reason()#

Reason this observation was taken, or its purpose (‘science’ and ‘calibration’ are common values)

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_observation_type()#

Type of observation (currently: science, dark, flat, bias, focus).

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_physical_filter()#

The bandpass filter used for this observation.

Returns:

Translated property that is fixed to a single value by the translator.

Return type:

str

Parameters:

self (MetadataTranslator)

to_pressure()#

Atmospheric pressure outside the dome.

Returns:

Translated value derived directly from a single header.

Return type:

astropy.units.quantity.Quantity

Parameters:

self (MetadataTranslator)

to_relative_humidity()#

Relative humidity outside the dome.

Returns:

Translated value derived directly from a single header.

Return type:

float

Parameters:

self (MetadataTranslator)

to_science_program()#

Observing program (survey or proposal) identifier.

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_telescope()#

Full name of the telescope.

Returns:

Translated value derived directly from a single header.

Return type:

str

Parameters:

self (MetadataTranslator)

to_temperature()#

Temperature outside the dome.

Returns:

Translated value derived directly from a single header.

Return type:

astropy.units.quantity.Quantity

Parameters:

self (MetadataTranslator)

to_tracking_radec()#

Return value of tracking_radec from headers.

Requested RA/Dec to track.

Returns:

The translated property.

Return type:

astropy.coordinates.sky_coordinate.SkyCoord

to_visit_id()#

Return value of visit_id from headers.

ID of the Visit this Exposure is associated with.

Science observations should essentially always be associated with a visit, but calibration observations may not be.

Returns:

The translated property.

Return type:

int