LsstTS8Translator#

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

Bases: LsstBaseTranslator

Metadata translator for LSST Test Stand 8 data.

Attributes Summary

all_properties

All the valid properties for this translator including extensions.

cameraPolicyFile

Path to policy file relative to obs_lsst root.

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

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 TS8 headers.

max_exposure_id()

The maximum exposure ID expected from this instrument.

to_altaz_begin()

Telescope boresight azimuth and elevation at start of observation.

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

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

to_can_see_sky()

True if the observation is looking at sky, False if it is definitely not looking at the sky.

to_detector_group()

Returns the name of the raft.

to_detector_name()

Return value of detector_name from headers.

to_detector_serial()

Returns the serial number of the detector.

to_exposure_id()

Generate a unique exposure ID number

to_exposure_time()

Actual duration of the exposure (seconds).

to_instrument()

The instrument used to observe the exposure.

to_location()

Location of the observatory.

to_object()

Object of interest or field name.

to_observation_id()

Return value of observation_id from headers.

to_physical_filter()

Return the filter name.

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

Requested RA/Dec to track.

to_visit_id()

Generate a unique exposure ID number

Attributes Documentation

all_properties: dict[str, PropertyDefinition] = {'altaz_begin': PropertyDefinition(doc='Telescope boresight azimuth and elevation at start of observation.', str_type='astropy.coordinates.AltAz', py_type=<class 'astropy.coordinates.builtin_frames.altaz.AltAz'>, to_simple=<function altaz_to_simple>, from_simple=<function simple_to_altaz>), 'altaz_end': PropertyDefinition(doc='Telescope boresight azimuth and elevation at end of observation.', str_type='astropy.coordinates.AltAz', py_type=<class 'astropy.coordinates.builtin_frames.altaz.AltAz'>, to_simple=<function altaz_to_simple>, from_simple=<function simple_to_altaz>), 'boresight_airmass': PropertyDefinition(doc='Airmass of the boresight of the telescope.', str_type='float', py_type=<class 'float'>, to_simple=None, from_simple=None), 'boresight_rotation_angle': PropertyDefinition(doc='Angle of the instrument in boresight_rotation_coord frame.', str_type='astropy.coordinates.Angle', py_type=<class 'astropy.coordinates.angles.core.Angle'>, to_simple=<function angle_to_simple>, from_simple=<function simple_to_angle>), 'boresight_rotation_coord': PropertyDefinition(doc='Coordinate frame of the instrument rotation angle (options: sky, unknown).', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'can_see_sky': PropertyDefinition(doc='True if the observation is looking at sky, False if it is definitely not looking at the sky. None indicates that it is not known whether sky could be seen.', str_type='bool', py_type=<class 'bool'>, to_simple=None, from_simple=None), 'dark_time': PropertyDefinition(doc='Duration of the exposure with shutter closed (seconds).', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function exptime_to_simple>, from_simple=<function simple_to_exptime>), 'datetime_begin': PropertyDefinition(doc='Time of the start of the observation.', str_type='astropy.time.Time', py_type=<class 'astropy.time.core.Time'>, to_simple=<function datetime_to_simple>, from_simple=<function simple_to_datetime>), 'datetime_end': PropertyDefinition(doc='Time of the end of the observation.', str_type='astropy.time.Time', py_type=<class 'astropy.time.core.Time'>, to_simple=<function datetime_to_simple>, from_simple=<function simple_to_datetime>), 'detector_exposure_id': PropertyDefinition(doc='Unique integer identifier for this detector in this exposure.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'detector_group': PropertyDefinition(doc='Collection name of which this detector is a part. Can be None if there are no detector groupings.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'detector_name': PropertyDefinition(doc='Name of the detector within the instrument (might not be unique if there are detector groups).', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'detector_num': PropertyDefinition(doc='Unique (for instrument) integer identifier for the sensor.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'detector_serial': PropertyDefinition(doc='Serial number/string associated with this detector.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'detector_unique_name': PropertyDefinition(doc='Unique name of the detector within the focal plane, generally combining detector_group with detector_name.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'exposure_group': PropertyDefinition(doc="Label to use to associate this exposure with others (can be related to 'exposure_id').", str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'exposure_id': PropertyDefinition(doc='Unique (with instrument) integer identifier for this observation.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'exposure_time': PropertyDefinition(doc='Actual duration of the exposure (seconds).', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function exptime_to_simple>, from_simple=<function simple_to_exptime>), 'exposure_time_requested': PropertyDefinition(doc='Requested duration of the exposure (seconds).', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function exptime_to_simple>, from_simple=<function simple_to_exptime>), 'focus_z': PropertyDefinition(doc='Defocal distance.', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function focusz_to_simple>, from_simple=<function simple_to_focusz>), 'group_counter_end': PropertyDefinition(doc='Observation counter for the end of the exposure group. Depending on the instrument the relevant group may be visit_id or exposure_group.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'group_counter_start': PropertyDefinition(doc='Observation counter for the start of the exposure group.Depending on the instrument the relevant group may be visit_id or exposure_group.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'has_simulated_content': PropertyDefinition(doc='Boolean indicating whether any part of this observation was simulated.', str_type='bool', py_type=<class 'bool'>, to_simple=None, from_simple=None), 'instrument': PropertyDefinition(doc='The instrument used to observe the exposure.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'location': PropertyDefinition(doc='Location of the observatory.', str_type='astropy.coordinates.EarthLocation', py_type=<class 'astropy.coordinates.earth.EarthLocation'>, to_simple=<function earthlocation_to_simple>, from_simple=<function simple_to_earthlocation>), 'object': PropertyDefinition(doc='Object of interest or field name.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'observation_counter': PropertyDefinition(doc='Counter of this observation. Can be counter within observing_day or a global counter. Likely to be observatory specific.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'observation_id': PropertyDefinition(doc="Label uniquely identifying this observation (can be related to 'exposure_id').", str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'observation_reason': PropertyDefinition(doc="Reason this observation was taken, or its purpose ('science' and 'calibration' are common values)", str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'observation_type': PropertyDefinition(doc='Type of observation (currently: science, dark, flat, bias, focus).', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'observing_day': PropertyDefinition(doc='Integer in YYYYMMDD format corresponding to the day of observation.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None), 'observing_day_offset': PropertyDefinition(doc='Offset to subtract from an observation date when calculating the observing day. Conversely, the offset to add to an observing day when calculating the time span of a day.', str_type='astropy.time.TimeDelta', py_type=<class 'astropy.time.core.TimeDelta'>, to_simple=<function timedelta_to_simple>, from_simple=<function simple_to_timedelta>), 'physical_filter': PropertyDefinition(doc='The bandpass filter used for this observation.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'pressure': PropertyDefinition(doc='Atmospheric pressure outside the dome.', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function pressure_to_simple>, from_simple=<function simple_to_pressure>), 'relative_humidity': PropertyDefinition(doc='Relative humidity outside the dome.', str_type='float', py_type=<class 'float'>, to_simple=None, from_simple=None), 'science_program': PropertyDefinition(doc='Observing program (survey or proposal) identifier.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'telescope': PropertyDefinition(doc='Full name of the telescope.', str_type='str', py_type=<class 'str'>, to_simple=None, from_simple=None), 'temperature': PropertyDefinition(doc='Temperature outside the dome.', str_type='astropy.units.Quantity', py_type=<class 'astropy.units.quantity.Quantity'>, to_simple=<function temperature_to_simple>, from_simple=<function simple_to_temperature>), 'tracking_radec': PropertyDefinition(doc='Requested RA/Dec to track.', str_type='astropy.coordinates.SkyCoord', py_type=<class 'astropy.coordinates.sky_coordinate.SkyCoord'>, to_simple=<function skycoord_to_simple>, from_simple=<function simple_to_skycoord>), 'visit_id': PropertyDefinition(doc='ID of the Visit this Exposure is associated with.\n\nScience observations should essentially always be\nassociated with a visit, but calibration observations\nmay not be.', str_type='int', py_type=<class 'int'>, to_simple=None, from_simple=None)}#

All the valid properties for this translator including extensions.

cameraPolicyFile = 'policy/ts8.yaml'#

Path to policy file relative to obs_lsst root.

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-TS8'#

Name of this translation class

Methods Documentation

classmethod can_translate(header, filename=None)#

Indicate whether this translation class can translate the supplied header.

There is no INSTRUME header in TS8 data. Instead we use the TSTAND header. We also look at the file name to see if it starts with “ts8-“.

Older data has no TSTAND header so we must use a combination of headers.

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.

classmethod 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 TS8 headers.

Notes#

See fix_header for details of the general process.

classmethod max_exposure_id()#

The maximum exposure ID expected from this instrument.

The TS8 implementation is non-standard because TS8 data can create two different forms of exposure_id based on the date but we need the largest form to be the one returned.

Returns#

max_exposure_idint

The maximum value.

to_altaz_begin() Any#

Telescope boresight azimuth and elevation at start of observation.

Returns#

translationastropy.coordinates.builtin_frames.altaz.AltAz

Translated property.

to_boresight_airmass() Any#

Airmass of the boresight of the telescope.

Returns#

translationfloat

Translated property.

to_boresight_rotation_angle() Any#

Angle of the instrument in boresight_rotation_coord frame.

Returns#

translationastropy.coordinates.angles.core.Angle

Translated property.

to_boresight_rotation_coord() Any#

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

Returns#

translationstr

Translated property.

to_can_see_sky() Any#

True if the observation is looking at sky, False if it is definitely not looking at the sky. None indicates that it is not known whether sky could be seen.

Returns#

translationbool

Translated property.

to_detector_group()#

Returns the name of the raft.

Extracted from RAFTNAME header.

Raftname should be of the form: ‘LCA-11021_RTM-011-Dev’ and the resulting name will have the form “RTM-NNN”.

Returns#

namestr

Name of raft.

to_detector_name() Any#

Return value of detector_name from headers.

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

Returns#

detector_namestr

The translated property.

to_detector_serial() Any#

Returns the serial number of the detector.

Returns#

serialstr

LSST assigned serial number.

Notes#

This is the LSST assigned serial number (LSST_NUM), and not the manufacturer’s serial number (CCD_SERN).

to_exposure_id() Any#

Generate a unique exposure ID number

Modern TS8 data conforms to standard LSSTCam OBSID, using the “C” controller variant (all TS8 uses “C” controller). Due to existing ingests, data taken before 2023-05-25 must use the old style timestamp ID.

For older data SEQNUM is not unique for a given day in TS8 data so instead we convert the ISO date of observation directly to an integer.

Returns#

exposure_idint

Unique exposure number.

to_exposure_time() Any#

Actual duration of the exposure (seconds).

Returns#

translationastropy.units.Quantity

Translated value derived from the header.

to_instrument() Any#

The instrument used to observe the exposure.

Returns#

translationstr

Translated property.

to_location() Any#

Location of the observatory.

Returns#

translationastropy.coordinates.earth.EarthLocation

Translated property.

to_object() Any#

Object of interest or field name.

Returns#

translationstr

Translated property.

to_observation_id() Any#

Return value of observation_id from headers.

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

Returns#

observation_idstr

The translated property.

to_physical_filter() Any#

Return the filter name.

Uses the FILTPOS header for older TS8 data. Newer data can use the base class implementation.

Returns#

filterstr

The filter name. Returns “NONE” if no filter can be determined.

Notes#

The FILTPOS handling is retained for backwards compatibility.

to_pressure() Any#

Atmospheric pressure outside the dome.

Returns#

translationastropy.units.quantity.Quantity

Translated property.

to_relative_humidity() Any#

Relative humidity outside the dome.

Returns#

translationfloat

Translated property.

to_science_program() Any#

Observing program (survey or proposal) identifier.

Returns#

translationstr

Translated value derived from the header.

to_telescope() Any#

Full name of the telescope.

Returns#

translationstr

Translated property.

to_temperature() Any#

Temperature outside the dome.

Returns#

translationastropy.units.quantity.Quantity

Translated property.

to_tracking_radec() Any#

Requested RA/Dec to track.

Returns#

translationastropy.coordinates.sky_coordinate.SkyCoord

Translated property.

to_visit_id() Any#

Generate a unique exposure ID number

Modern TS8 data conforms to standard LSSTCam OBSID, using the “C” controller variant (all TS8 uses “C” controller). Due to existing ingests, data taken before 2023-05-25 must use the old style timestamp ID.

For older data SEQNUM is not unique for a given day in TS8 data so instead we convert the ISO date of observation directly to an integer.

Returns#

exposure_idint

Unique exposure number.