SdssTranslator#
- class astro_metadata_translator.SdssTranslator(header, filename=None)#
Bases:
FitsTranslatorMetadata translator for SDSS standard headers. NB: calibration data is not handled as calibration frames were not available to me at time of writing.
- 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 SDSS imager instrument.
Methods Summary
can_translate(header[, filename])Indicate whether this translation class can translate the supplied header.
Return value of altaz_begin from headers.
Return value of boresight_airmass from headers.
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 start time of observation.
Calculate end time of observation.
Return value of detector_exposure_id from headers.
Return value of detector_group from headers.
Name of the detector within the instrument (might not be unique if there are detector groups).
Return value of detector_num from headers.
Serial number/string associated with this detector.
Return a unique name for the detector.
Unique (with instrument) integer identifier for this observation.
Actual duration of the exposure (seconds).
The instrument used to observe the exposure.
Calculate the observatory location.
Object of interest or field name.
Calculate the observation ID.
Calculate the observation type.
The bandpass filter used for this observation.
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.
ID of the Visit this Exposure is associated with.
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/SDSS'#
Default resource path root to use to locate header correction files.
- detector_name_id_map = {'g1': 0, 'g2': 5, 'g3': 10, 'g4': 15, 'g5': 20, 'g6': 25, 'i1': 3, 'i2': 8, 'i3': 13, 'i4': 18, 'i5': 23, 'i6': 28, 'r1': 4, 'r2': 9, 'r3': 14, 'r4': 19, 'r5': 24, 'r6': 29, 'u1': 2, 'u2': 7, 'u3': 12, 'u4': 17, 'u5': 22, 'u6': 27, 'z1': 1, 'z2': 6, 'z3': 11, 'z4': 16, 'z5': 21, 'z6': 26}#
- name: str | None = 'SDSS'#
Name of this translation class
- supported_instrument: str | None = 'Imager'#
Supports the SDSS imager instrument.
Methods Documentation
- classmethod can_translate(header, filename=None)#
Indicate whether this translation class can translate the supplied header.
- 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()#
Return value of boresight_airmass from headers.
Airmass of the boresight of the telescope.
- Returns:
The translated property.
- Return type:
- 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 property that is fixed to a single value by the translator.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_datetime_begin()#
Calculate start time of observation.
Uses FITS standard
MJD-BEGorDATE-BEG, in conjunction with theTIMESYSheader. Will fallback to usingMJD-OBSorDATE-OBSif the-BEGvariants are not found.- Returns:
start_time – Time corresponding to the start of the observation. Returns
Noneif no date can be found.- Return type:
- 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()#
Name of the detector within the instrument (might not be unique if there are detector groups).
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_detector_num()#
Return value of detector_num from headers.
Unique (for instrument) integer identifier for the sensor.
- Returns:
The translated property.
- Return type:
- 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:
- Parameters:
self (
MetadataTranslator)
- to_detector_unique_name()#
Return a unique name for the detector.
Base class implementation attempts to combine
detector_namewithdetector_group. Group is only used if notNone.Can be over-ridden by specialist translator class.
- Returns:
name –
detector_group``_``detector_nameifdetector_groupis defined, else thedetector_nameis assumed to be unique. If neither return a valid value an exception is raised.- Return type:
- Raises:
NotImplementedError – Raised if neither detector_name nor detector_group is defined.
- to_exposure_id()#
Unique (with instrument) integer identifier for this observation.
- 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_instrument()#
The instrument used to observe the exposure.
- Returns:
Translated property that is fixed to a single value by the translator.
- 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_id()#
Calculate the observation ID.
- Returns:
observation_id – A string uniquely describing the observation. This incorporates the run, camcol, filter and frame.
- Return type:
- to_observation_type()#
Calculate the observation type.
- Returns:
typ – Observation type. Normalized to standard set.
- Return type:
- to_physical_filter()#
The bandpass filter used for this observation.
- Returns:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_pressure()#
Atmospheric pressure outside the dome.
- Returns:
Translated property that is fixed to a single value by the translator.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_relative_humidity()#
Relative humidity outside the dome.
- Returns:
Translated property that is fixed to a single value by the translator.
- 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 property that is fixed to a single value by the translator.
- Return type:
- Parameters:
self (
MetadataTranslator)
- to_temperature()#
Temperature outside the dome.
- Returns:
Translated property that is fixed to a single value by the translator.
- 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:
- to_visit_id()#
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:
Translated value derived directly from a single header.
- Return type:
- Parameters:
self (
MetadataTranslator)