LatissTranslator#
- class lsst.obs.lsst.translators.LatissTranslator(header: Mapping[str, Any], filename: str | None = None)#
Bases:
LsstBaseTranslatorMetadata translator for LSST LATISS data from AuxTel.
For lab measurements many values are masked out.
Attributes Summary
Fixed name of detector group.
Maximum number of detectors to use when calculating the detector_exposure_id.
Fixed name of single sensor.
All the valid properties for this translator including extensions.
Mapping of detector name to detector number and serial.
Mapping of detector serial number to raft, number, and name.
Name of this translation class
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.
Return the AltAz for the end of the observation.
Angle of the instrument in boresight_rotation_coord frame.
Calculate the dark time.
Collection name of which this detector is a part.
Name of the detector within the instrument (might not be unique if there are detector groups).
Unique (for instrument) integer identifier for the sensor.
Serial number/string associated with this detector.
Return value of exposure_time from headers.
The instrument used to observe the exposure.
Object of interest or field name.
Label uniquely identifying this observation (can be related to 'exposure_id').
Determine the observation type.
Calculate the physical filter name.
Observing program (survey or proposal) identifier.
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': 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.
- 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#
- header
dict-like Header to convert to standardized form.
- filename
str, optional Name of file being translated.
Returns#
- can
bool Trueif the header is recognized by this class.Falseotherwise.
- header
- 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_id
int Unique exposure ID.
- detector_num
int Detector number.
Returns#
- detector_exposure_id
int The calculated ID.
- exposure_id
- classmethod fix_header(header, instrument, obsid, filename=None)#
Fix an incorrect LATISS header.
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 =
bool Returns
Trueif 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_headerfor details of the general process.- header
- to_altaz_end() Any#
Return the AltAz for the end of the observation.
Base class implementation returns
None. Subclasses should override if the value is known.Returns#
- altaz
astropy.coordinates.AltAzorNone The AltAz for the end of the observation.
- altaz
- to_boresight_rotation_angle() Any#
Angle of the instrument in boresight_rotation_coord frame.
Returns#
- translation
astropy.coordinates.Angle Translated value derived from the header.
- translation
- to_dark_time() Any#
Calculate the dark time.
If a DARKTIME header is not found, the value is assumed to be identical to the exposure time.
Returns#
- dark
astropy.units.Quantity The dark time in seconds.
- dark
- to_detector_group() Any#
Collection name of which this detector is a part. Can be None if there are no detector groupings.
Returns#
- translation
str Translated property.
- translation
- to_detector_name() Any#
Name of the detector within the instrument (might not be unique if there are detector groups).
Returns#
- translation
str Translated property.
- translation
- to_detector_num() Any#
Unique (for instrument) integer identifier for the sensor.
Returns#
- translation
int Translated property.
- translation
- to_detector_serial() Any#
Serial number/string associated with this detector.
Returns#
- translation
str Translated value derived from the header.
- translation
- to_exposure_time() Any#
Return value of exposure_time from headers.
Actual duration of the exposure (seconds).
Returns#
- exposure_time
astropy.units.Quantity The translated property.
- exposure_time
- to_instrument() Any#
The instrument used to observe the exposure.
Returns#
- translation
str Translated property.
- translation
- to_object() Any#
Object of interest or field name.
Returns#
- translation
str Translated value derived from the header.
- translation
- to_observation_id() Any#
Label uniquely identifying this observation (can be related to ‘exposure_id’).
Returns#
- translation
str Translated value derived from the header.
- translation
- to_observation_type() Any#
Determine the observation type.
In the absence of an
IMGTYPEheader, assumes lab data is always a dark if exposure time is non-zero, else bias.Returns#
- obstype
str Observation type.
- obstype
- to_physical_filter() Any#
Calculate the physical filter name.
Returns#
- filter
str 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.
- filter