LatissTranslator#

class lsst.obs.lsst.translators.LatissTranslator(header: Mapping[str, Any], filename: ResourcePathExpression | None = None)#

Bases: LsstBaseTranslator

Metadata translator for LSST LATISS data from AuxTel.

For lab measurements many values are masked out.

Attributes Summary

DETECTOR_GROUP_NAME

Fixed name of detector group.

DETECTOR_MAX

Maximum number of detectors to use when calculating the detector_exposure_id.

DETECTOR_NAME

Fixed name of single sensor.

all_properties

All the valid properties for this translator including extensions.

detectorMapping

Mapping of detector name to detector number and serial.

detectorSerials

Mapping of detector serial number to raft, number, and name.

name

Name of this translation class

supported_instrument

Supports the LATISS instrument.

Methods Summary

can_translate(header[, filename])

Indicate whether this translation class can translate the supplied header.

compute_detector_exposure_id(exposure_id, ...)

Compute the detector exposure ID from detector number and exposure ID.

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

Fix an incorrect LATISS header.

to_altaz_end()

Return the AltAz for the end of the observation.

to_boresight_rotation_angle()

Angle of the instrument in boresight_rotation_coord frame.

to_dark_time()

Calculate the dark time.

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_exposure_time()

Return value of exposure_time from headers.

to_instrument()

The instrument used to observe the exposure.

to_object()

Object of interest or field name.

to_observation_id()

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

to_observation_type()

Determine the observation type.

to_physical_filter()

Calculate the physical filter name.

to_science_program()

Observing program (survey or proposal) identifier.

to_telescope()

Full name of the telescope.

Attributes Documentation

DETECTOR_GROUP_NAME = 'RXX'#

Fixed name of detector group.

DETECTOR_MAX = 0#

Maximum number of detectors to use when calculating the detector_exposure_id.

DETECTOR_NAME = 'S00'#

Fixed name of single sensor.

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.

detectorMapping = None#

Mapping of detector name to detector number and serial.

detectorSerials = None#

Mapping of detector serial number to raft, number, and name.

name: str | None = 'LSST_LATISS'#

Name of this translation class

supported_instrument: str | None = 'LATISS'#

Supports the LATISS instrument.

Methods Documentation

classmethod can_translate(header, filename=None)#

Indicate whether this translation class can translate the supplied header.

Parameters#

headerdict-like

Header to convert to standardized form.

filenamestr, optional

Name of file being translated.

Returns#

canbool

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

static compute_detector_exposure_id(exposure_id, detector_num)#

Compute the detector exposure ID from detector number and exposure ID.

This is a helper method to allow code working outside the translator infrastructure to use the same algorithm.

Parameters#

exposure_idint

Unique exposure ID.

detector_numint

Detector number.

Returns#

detector_exposure_idint

The calculated ID.

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

Fix an incorrect LATISS header.

Parameters#

headerdict

The header to update. Updates are in place.

instrumentstr

The name of the instrument.

obsidstr

Unique observation identifier associated with this header. Will always be provided.

filenamestr, optional

Filename associated with this header. May not be set since headers can be fixed independently of any filename being known.

Returns#

modified = bool

Returns True if the header was updated.

Notes#

This method does not apply per-obsid corrections. The following corrections are applied:

  • On June 24th 2019 the detector was changed from ITL-3800C-098 to ITL-3800C-068. The header is intended to be correct in the future.

  • In late 2019 the DATE-OBS and MJD-OBS headers were reporting 1970 dates. To correct, the DATE/MJD headers are copied in to replace them and the -END headers are cleared.

  • Until November 2019 the IMGTYPE was set in the GROUPID header. The value is moved to IMGTYPE.

  • SHUTTIME is always forced to be None.

Corrections are reported as debug level log messages.

See fix_header for details of the general process.

to_altaz_end()#

Return the AltAz for the end of the observation.

Base class implementation returns None. Subclasses should override if the value is known.

Returns#

altazastropy.coordinates.AltAz or None

The AltAz for the end of the observation.

to_boresight_rotation_angle() 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

to_dark_time()#

Calculate the dark time.

If a DARKTIME header is not found, the value is assumed to be identical to the exposure time.

Returns#

darkastropy.units.Quantity

The dark time in seconds.

to_detector_group() str#

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

to_detector_name() str#

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

to_detector_num() int#

Unique (for instrument) integer identifier for the sensor.

Returns:

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

Return type:

int

to_detector_serial() str#

Serial number/string associated with this detector.

Returns:

Translated value derived directly from a single header.

Return type:

str

to_exposure_time()#

Return value of exposure_time from headers.

Actual duration of the exposure (seconds).

Returns:

The translated property.

Return type:

astropy.units.quantity.Quantity

to_instrument() str#

The instrument used to observe the exposure.

Returns:

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

Return type:

str

to_object() str#

Object of interest or field name.

Returns:

Translated value derived directly from a single header.

Return type:

str

to_observation_id() str#

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

Returns:

Translated value derived directly from a single header.

Return type:

str

to_observation_type()#

Determine the observation type.

In the absence of an IMGTYPE header, assumes lab data is always a dark if exposure time is non-zero, else bias.

Returns#

obstypestr

Observation type.

to_physical_filter()#

Calculate the physical filter name.

Returns#

filterstr

Name of filter. A combination of FILTER and GRATING headers joined by a “~”. The filter and grating are always combined. The filter or grating part will be “none” if no value is specified. Uses “empty” if any of the filters or gratings indicate an “empty_N” name. “unknown” indicates that the filter is not defined anywhere but we think it should be. “none” indicates that the filter was not defined but the observation is a dark or bias.

to_science_program() str#

Observing program (survey or proposal) identifier.

Returns:

Translated value derived directly from a single header.

Return type:

str

to_telescope() str#

Full name of the telescope.

Returns:

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

Return type:

str