LSST Applications
21.0.0+75b29a8a7f,21.0.0+e70536a077,21.0.0-1-ga51b5d4+62c747d40b,21.0.0-10-gbfb87ad6+3307648ee3,21.0.0-15-gedb9d5423+47cba9fc36,21.0.0-2-g103fe59+fdf0863a2a,21.0.0-2-g1367e85+d38a93257c,21.0.0-2-g45278ab+e70536a077,21.0.0-2-g5242d73+d38a93257c,21.0.0-2-g7f82c8f+e682ffb718,21.0.0-2-g8dde007+d179fbfa6a,21.0.0-2-g8f08a60+9402881886,21.0.0-2-ga326454+e682ffb718,21.0.0-2-ga63a54e+08647d4b1b,21.0.0-2-gde069b7+26c92b3210,21.0.0-2-gecfae73+0445ed2f95,21.0.0-2-gfc62afb+d38a93257c,21.0.0-27-gbbd0d29+ae871e0f33,21.0.0-28-g5fc5e037+feb0e9397b,21.0.0-3-g21c7a62+f4b9c0ff5c,21.0.0-3-g357aad2+57b0bddf0b,21.0.0-3-g4be5c26+d38a93257c,21.0.0-3-g65f322c+3f454acf5d,21.0.0-3-g7d9da8d+75b29a8a7f,21.0.0-3-gaa929c8+9e4ef6332c,21.0.0-3-ge02ed75+4b120a55c4,21.0.0-4-g3300ddd+e70536a077,21.0.0-4-g591bb35+4b120a55c4,21.0.0-4-gc004bbf+4911b9cd27,21.0.0-4-gccdca77+f94adcd104,21.0.0-4-ge8fba5a+2b3a696ff9,21.0.0-5-gb155db7+2c5429117a,21.0.0-5-gdf36809+637e4641ee,21.0.0-6-g00874e7+c9fd7f7160,21.0.0-6-g4e60332+4b120a55c4,21.0.0-7-gc8ca178+40eb9cf840,21.0.0-8-gfbe0b4b+9e4ef6332c,21.0.0-9-g2fd488a+d83b7cd606,w.2021.05
LSST Data Management Base Package
|
Public Member Functions | |
def | __init__ (self, log=None, doStripHeader=False) |
def | __call__ (self, md, exposureId) |
def | setArgDict (self, md, argDict) |
def | getDateAvg (self, md, exposureTime) |
def | getDarkTime (self, argDict) |
def | offsetDate (self, date, offsetSec) |
def | popItem (self, md, key, default=None) |
def | popFloat (self, md, key) |
def | popAngle (self, md, key, units=astropy.units.deg) |
def | popIsoDate (self, md, key, timesys=None) |
def | popMjdDate (self, md, key, timesys=None) |
Static Public Member Functions | |
def | eraFromLstAndLongitude (lst, longitude) |
def | altitudeFromZenithDistance (zd) |
def | centigradeFromKelvin (tempK) |
def | pascalFromMBar (mbar) |
def | pascalFromMmHg (mmHg) |
def | pascalFromTorr (torr) |
def | defaultMetadata (value, defaultValue, minimum=None, maximum=None) |
Public Attributes | |
log | |
doStripHeader | |
Base class functor to make a VisitInfo from the FITS header of a raw image. A subclass will be wanted for each camera. Subclasses should override: - `setArgDict`, The override can call the base implementation, which simply sets exposure time and date of observation - `getDateAvg` The design philosophy is to make a best effort and log warnings of problems, rather than raising exceptions, in order to extract as much VisitInfo information as possible from a messy FITS header without the user needing to add a lot of error handling. However, the methods that transform units are less forgiving; they assume the user provides proper data types, since type errors in arguments to those are almost certainly due to coding mistakes. Parameters ---------- log : `lsst.log.Log` or None Logger to use for messages. (None to use ``Log.getLogger("MakeRawVisitInfo")``). doStripHeader : `bool`, optional Strip header keywords from the metadata as they are used?
Definition at line 47 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.__init__ | ( | self, | |
log = None , |
|||
doStripHeader = False |
|||
) |
Definition at line 75 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.__call__ | ( | self, | |
md, | |||
exposureId | |||
) |
Construct a VisitInfo and strip associated data from the metadata. Parameters ---------- md : `lsst.daf.base.PropertyList` or `lsst.daf.base.PropertySet` Metadata to pull from. Items that are used are stripped from the metadata (except TIMESYS, because it may apply to other keywords) if ``doStripHeader``. exposureId : `int` exposure ID Notes ----- The basic implementation sets `date` and `exposureTime` using typical values found in FITS files and logs a warning if neither can be set.
Definition at line 81 of file makeRawVisitInfo.py.
|
static |
Convert zenith distance to altitude (lsst.afw.geom.Angle)
Definition at line 375 of file makeRawVisitInfo.py.
|
static |
Convert temperature from Kelvin to Centigrade
Definition at line 380 of file makeRawVisitInfo.py.
|
static |
Return the value if it is not NaN and within min/max, otherwise return defaultValue. Parameters ---------- value : `float` metadata value returned by popItem, popFloat, or popAngle defaultValue : `float`` default value to use if the metadata value is invalid minimum : `float` Minimum possible valid value, optional maximum : `float` Maximum possible valid value, optional Returns ------- `float` The "validated" value.
Definition at line 410 of file makeRawVisitInfo.py.
|
static |
Return an approximate Earth Rotation Angle (afw:Angle) computed from local sidereal time and longitude (both as afw:Angle; Longitude shares the afw:Observatory covention: positive values are E of Greenwich). NOTE: if we properly compute ERA via UT1 a la DM-8053, we should remove this method.
Definition at line 363 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.getDarkTime | ( | self, | |
argDict | |||
) |
Get the darkTime from the DARKTIME keyword, else expTime, else NaN, If dark time is available then subclasses should call this method by putting the following in their `__init__` method:: argDict['darkTime'] = self.getDarkTime(argDict) Parameters ---------- argdict : `dict` Dict of arguments. Returns ------- `float` Dark time, as inferred from the metadata.
Definition at line 153 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.getDateAvg | ( | self, | |
md, | |||
exposureTime | |||
) |
Return date at the middle of the exposure. Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull from. Items that are used are stripped from the metadata (except TIMESYS, because it may apply to other keywords). exposureTime : `float` Exposure time (sec) Notes ----- Subclasses must override. Here is a typical implementation:: dateObs = self.popIsoDate(md, "DATE-OBS") return self.offsetDate(dateObs, 0.5*exposureTime)
Reimplemented in lsst.obs.test.makeTestRawVisitInfo.MakeTestRawVisitInfo.
Definition at line 132 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.offsetDate | ( | self, | |
date, | |||
offsetSec | |||
) |
Return a date offset by a specified number of seconds. date : `lsst.daf.base.DateTime` Date baseline to offset from. offsetSec : `float` Offset, in seconds. Returns ------- `lsst.daf.base.DateTime` The offset date.
Definition at line 182 of file makeRawVisitInfo.py.
|
static |
Convert pressure from millibars to Pascals
Definition at line 385 of file makeRawVisitInfo.py.
|
static |
Convert pressure from mm Hg to Pascals Notes ----- Could use the following, but astropy.units.cds is not fully compatible with Python 2 as of astropy 1.2.1 (see https://github.com/astropy/astropy/issues/5350#issuecomment-248612824): astropy.units.cds.mmHg.to(astropy.units.pascal, mmHg)
Definition at line 391 of file makeRawVisitInfo.py.
|
static |
Convert pressure from torr to Pascals
Definition at line 404 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.popAngle | ( | self, | |
md, | |||
key, | |||
units = astropy.units.deg |
|||
) |
Pop an lsst.afw.geom.Angle, whose metadata is in the specified units, with a default of Nan The angle may be specified as a float or sexagesimal string with 1-3 fields. Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull `key` from. key : `str` Key to read from md. Returns ------- `lsst.afw.geom.Angle` Value of the requested key as an angle; Angle(NaN) if the key is not found.
Definition at line 263 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.popFloat | ( | self, | |
md, | |||
key | |||
) |
Pop a float with a default of NaN. Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull `key` from. key : `str` Key to read. Returns ------- `float` Value of the requested key as a float; float("nan") if the key is not found.
Definition at line 240 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.popIsoDate | ( | self, | |
md, | |||
key, | |||
timesys = None |
|||
) |
Pop a FITS ISO date as an lsst.daf.base.DateTime Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull `key` from. key : `str` Date key to read from md. timesys : `str` Time system as a string (not case sensitive), e.g. "UTC" or None; if None then look for TIMESYS (but do NOT pop it, since it may be used for more than one date) and if not found, use UTC. Returns ------- `lsst.daf.base.DateTime` Value of the requested date; `DateTime()` if the key is not found.
Definition at line 291 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.popItem | ( | self, | |
md, | |||
key, | |||
default = None |
|||
) |
Return an item of metadata. The item is removed if ``doStripHeader`` is ``True``. Log a warning if the key is not found. Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull `key` from and (optionally) remove. key : `str` Metadata key to extract. default : `object` Value to return if key not found. Returns ------- `object` The value of the specified key, using whatever type md.getScalar(key) returns.
Definition at line 204 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.popMjdDate | ( | self, | |
md, | |||
key, | |||
timesys = None |
|||
) |
Get a FITS MJD date as an ``lsst.daf.base.DateTime``. Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull `key` from. key : `str` Date key to read from md. timesys : `str` Time system as a string (not case sensitive), e.g. "UTC" or None; if None then look for TIMESYS (but do NOT pop it, since it may be used for more than one date) and if not found, use UTC. Returns ------- `lsst.daf.base.DateTime` Value of the requested date; `DateTime()` if the key is not found.
Definition at line 328 of file makeRawVisitInfo.py.
def lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.setArgDict | ( | self, | |
md, | |||
argDict | |||
) |
Fill an argument dict with arguments for VisitInfo and pop associated metadata Subclasses are expected to override this method, though the override may wish to call this default implementation, which: - sets exposureTime from "EXPTIME" - sets date by calling getDateAvg Parameters ---------- md : `lsst.daf.base.PropertyList` or `PropertySet` Metadata to pull from. Items that are used are stripped from the metadata (except TIMESYS, because it may apply to other keywords). argdict : `dict` dict of arguments Notes ----- Subclasses should expand this or replace it.
Reimplemented in lsst.obs.test.makeTestRawVisitInfo.MakeTestRawVisitInfo.
Definition at line 106 of file makeRawVisitInfo.py.
lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.doStripHeader |
Definition at line 79 of file makeRawVisitInfo.py.
lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo.log |
Definition at line 78 of file makeRawVisitInfo.py.