DecamTranslator#
- class astro_metadata_translator.DecamTranslator(header, filename=None)#
Bases:
FitsTranslatorMetadata translator for DECam standard headers.
- Parameters:
filename (
str|ParseResult|ResourcePath|Path|None, default:None)
Attributes Summary
All the valid properties for this translator including extensions.
Default resource path root to use to locate header correction files.
Name of this translation class
Supports the DECam instrument.
Methods Summary
can_translate(header[, filename])Indicate whether this translation class can translate the supplied header.
determine_translatable_headers(filename[, ...])Given a file return all the headers usable for metadata translation.
fix_header(header, instrument, obsid[, filename])Fix DECam headers.
observing_date_to_offset(observing_date)Return the offset to use when calculating the observing day.
Return value of altaz_begin from headers.
Airmass of the boresight of the telescope.
Angle of the instrument in boresight_rotation_coord frame.
Coordinate frame of the instrument rotation angle (options: sky, unknown).
Duration of the exposure with shutter closed (seconds).
Calculate end time of observation.
Return value of detector_exposure_id from headers.
Return value of detector_group from headers.
Return value of detector_name from headers.
Unique (for instrument) integer identifier for the sensor.
Serial number/string associated with this detector.
Unique name of the detector within the focal plane, generally combining detector_group with detector_name.
Calculate exposure ID.
Actual duration of the exposure (seconds).
Requested duration of the exposure (seconds).
Return a default defocal distance of 0.0 mm if there is no keyword for defocal distance in the header.
The instrument used to observe the exposure.
Calculate the observatory location.
Object of interest or field name.
Return the lifetime exposure number.
Label uniquely identifying this observation (can be related to 'exposure_id').
Calculate the observation type.
Calculate physical filter.
Atmospheric pressure outside the dome.
Relative humidity outside the dome.
Observing program (survey or proposal) identifier.
Full name of the telescope.
Temperature outside the dome.
Return value of tracking_radec from headers.
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 = 'corrections/DECam'#
Default resource path root to use to locate header correction files.
- detector_names = {1: 'S29', 2: 'S30', 3: 'S31', 4: 'S25', 5: 'S26', 6: 'S27', 7: 'S28', 8: 'S20', 9: 'S21', 10: 'S22', 11: 'S23', 12: 'S24', 13: 'S14', 14: 'S15', 15: 'S16', 16: 'S17', 17: 'S18', 18: 'S19', 19: 'S8', 20: 'S9', 21: 'S10', 22: 'S11', 23: 'S12', 24: 'S13', 25: 'S1', 26: 'S2', 27: 'S3', 28: 'S4', 29: 'S5', 30: 'S6', 31: 'S7', 32: 'N1', 33: 'N2', 34: 'N3', 35: 'N4', 36: 'N5', 37: 'N6', 38: 'N7', 39: 'N8', 40: 'N9', 41: 'N10', 42: 'N11', 43: 'N12', 44: 'N13', 45: 'N14', 46: 'N15', 47: 'N16', 48: 'N17', 49: 'N18', 50: 'N19', 51: 'N20', 52: 'N21', 53: 'N22', 54: 'N23', 55: 'N24', 56: 'N25', 57: 'N26', 58: 'N27', 59: 'N28', 60: 'N29', 62: 'N31'}#
- name: str | None = 'DECam'#
Name of this translation class
- supported_instrument: str | None = 'DECam'#
Supports the DECam instrument.
Methods Documentation
- classmethod can_translate(header, filename=None)#
Indicate whether this translation class can translate the supplied header.
Checks the INSTRUME and FILTER headers.
- classmethod determine_translatable_headers(filename, primary=None)#
Given a file return all the headers usable for metadata translation.
DECam files are multi-extension FITS with a primary header and each detector stored in a subsequent extension. DECam uses
INHERIT=Tand each detector header will be merged with the primary header.Guide headers are not returned.
- Parameters:
filename (
strorlsst.resources.ResourcePathExpression) – Path to a file in a format understood by this translator.primary (
dict-like, optional) – The primary header obtained by the caller. This is sometimes already known, for example if a system is trying to bootstrap without already knowing what data is in the file. Will be merged with detector headers if supplied, else will be read from the file.
- Yields:
headers (iterator of
dict-like) – Each detector header in turn. The supplied header will be merged with the contents of each detector header.- Return type:
Notes
This translator class is specifically tailored to raw DECam data and is not designed to work with general FITS files. The normal paradigm is for the caller to have read the first header and then called
determine_translatoron the result to work out which translator class to then call to obtain the real headers to be used for translation.
- 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
Trueif the header was updated.- Return type:
Notes
Fixes the following issues:
If OBSTYPE contains “zero” or “bias”, update the FILTER keyword to “solid plate 0.0 0.0”.
Corrections are reported as debug level log messages.
- classmethod observing_date_to_offset(observing_date)#
Return the offset to use when calculating the observing day.
- Parameters:
observing_date (
astropy.time.Time) – The date of the observation. Unused.- Returns:
offset – The offset to apply. The offset is always 12 hours. DECam has no defined observing day concept in its headers. To ensure that observations from a single night all have the same observing_day, adopt the same offset used by the Vera Rubin Observatory of 12 hours.
- Return type:
- 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:
- to_boresight_airmass()#
Airmass of the boresight of the telescope.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_boresight_rotation_angle()#
Angle of the instrument in boresight_rotation_coord frame.
- Returns:
Translated property that is fixed to a single value by the translator.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_boresight_rotation_coord()#
Coordinate frame of the instrument rotation angle (options: sky, unknown).
- Returns:
Translated property that is fixed to a single value by the translator.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_dark_time()#
Duration of the exposure with shutter closed (seconds).
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_datetime_end()#
Calculate end time of observation.
Uses FITS standard
MJD-ENDorDATE-END, in conjunction with theTIMESYSheader.- Returns:
start_time – Time corresponding to the end of the observation.
- Return type:
- to_detector_exposure_id()#
Return value of detector_exposure_id from headers.
Unique integer identifier for this detector in this exposure.
- Returns:
The translated property.
- Return type:
- to_detector_group()#
Return value of detector_group from headers.
Collection name of which this detector is a part. Can be None if there are no detector groupings.
- Returns:
The translated property.
- Return type:
- to_detector_name()#
Return value of detector_name from headers.
Name of the detector within the instrument (might not be unique if there are detector groups).
- Returns:
The translated property.
- Return type:
- to_detector_num()#
Unique (for instrument) integer identifier for the sensor.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_detector_serial()#
Serial number/string associated with this detector.
- Returns:
Translated value derived directly from a single header.
- Return type:
- 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 value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_exposure_time()#
Actual duration of the exposure (seconds).
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_exposure_time_requested()#
Requested duration of the exposure (seconds).
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_focus_z()#
Return a default defocal distance of 0.0 mm if there is no keyword for defocal distance in the header. The default keyword for defocal distance is
FOCUSZ.- Returns:
focus_z – The defocal distance from header or the 0.0mm default.
- Return type:
- to_instrument()#
The instrument used to observe the exposure.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_location()#
Calculate the observatory location.
- Returns:
location – An object representing the location of the telescope.
- Return type:
- to_object()#
Object of interest or field name.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_observation_counter()#
Return the lifetime exposure number.
- Returns:
sequence – The observation counter.
- Return type:
- 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:
- Parameters:
self (
MetadataTranslator)
- to_observation_type()#
Calculate the observation type.
- Returns:
typ – Observation type. Normalized to standard set.
- Return type:
- to_physical_filter()#
Calculate physical filter.
- Returns:
filter – The full filter name.
- Return type:
- to_pressure()#
Atmospheric pressure outside the dome.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_relative_humidity()#
Relative humidity outside the dome.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_science_program()#
Observing program (survey or proposal) identifier.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_telescope()#
Full name of the telescope.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_temperature()#
Temperature outside the dome.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_tracking_radec()#
Return value of tracking_radec from headers.
Requested RA/Dec to track.
- Returns:
The translated property.
- Return type: