Coverage for python/astro_metadata_translator/translators/megaprime.py : 35%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file is part of astro_metadata_translator. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>.
'u.MP9302': 'u2', 'g.MP9401': 'g', 'g.MP9402': 'g2', 'r.MP9601': 'r', 'r.MP9602': 'r2', 'i.MP9701': 'i', 'i.MP9702': 'i2', 'i.MP9703': 'i3', 'z.MP9801': 'z', 'z.MP9901': 'z2', }
"""Metadata translator for CFHT MegaPrime standard headers. """
"""Name of this translation class"""
"""Supports the MegaPrime instrument."""
"boresight_rotation_coord": "unknown"}
"dark_time": ("DARKTIME", dict(unit=u.s)), "exposure_time": ("EXPTIME", dict(unit=u.s)), "observation_id": "OBSID", "object": "OBJECT", "science_program": "RUNID", "exposure_id": "EXPNUM", "visit_id": "EXPNUM", "detector_name": "CCDNAME", "relative_humidity": "RELHUMID", "temperature": ("TEMPERAT", dict(unit=u.deg_C)), "pressure": ("PRESSURE", dict(unit=u.hPa)), "boresight_airmass": "AIRMASS"}
# We know it is UTC value = self._from_fits_date_string(self._header["DATE-OBS"], time_str=self._header["UTC-OBS"], scale="utc") self._used_these_cards("DATE-OBS", "UTC-OBS") return value
# We know it is UTC value = self._from_fits_date_string(self._header["DATE-OBS"], time_str=self._header["UTCEND"], scale="utc") self._used_these_cards("DATE-OBS", "UTCEND") return value
"""Calculate the observatory location.
Returns ------- location : `astropy.coordinates.EarthLocation` An object representing the location of the telescope. """ # Height is not in MegaPrime files. Use the value from EarthLocation.of_site("CFHT") value = EarthLocation.from_geodetic(self._header["LONGITUD"], self._header["LATITUDE"], 4215.0) self._used_these_cards("LONGITUD", "LATITUDE") return value
try: extname = self._header["EXTNAME"] num = int(extname[3:]) # chop off "ccd" self._used_these_cards("EXTNAME") return num except KeyError: # Dummy value, intended for PHU (need something to get filename) return 99
"""Calculate the observation type.
Returns ------- typ : `str` Observation type. Normalized to standard set. """ obstype = self._header["OBSTYPE"].strip().lower() self._used_these_cards("OBSTYPE") if obstype == "object": return "science" return obstype
frame = self._header["OBJRADEC"].strip().lower() if frame == "gappt": self._used_these_cards("OBJRADEC") # Moving target return None radec = SkyCoord(self._header["RA_DEG"], self._header["DEC_DEG"], frame=frame, unit=u.deg, obstime=self.to_datetime_begin(), location=self.to_location()) self._used_these_cards("OBJRADEC", "RA_DEG", "DEC_DEG") return radec
altaz = AltAz(self._header["TELAZ"] * u.deg, self._header["TELALT"] * u.deg, obstime=self.to_datetime_begin(), location=self.to_location()) self._used_these_cards("TELALT", "TELAZ") return altaz
return self.to_exposure_id() * 36 + self.to_detector_num() |