MakeTestRawVisitInfo¶
- class lsst.obs.test.MakeTestRawVisitInfo(log=None, doStripHeader=False)¶
Bases:
MakeRawVisitInfoMake a VisitInfo from the FITS header of a test image.
Notes
Since the test data is extracted from LSST Sim data, this is a copy of MakeLsstSimRawVisitInfo (using a copy avoids undesireable dependencies).
Attributes Summary
Methods Summary
__call__(md, exposureId)Construct a VisitInfo and strip associated data from the metadata.
Convert zenith distance to altitude (lsst.afw.geom.Angle)
centigradeFromKelvin(tempK)Convert temperature from Kelvin to Centigrade
defaultMetadata(value, defaultValue[, ...])Return the value if it is not NaN and within min/max, otherwise return defaultValue.
eraFromLstAndLongitude(lst, longitude)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).
getDarkTime(argDict)Get the darkTime from the DARKTIME keyword, else expTime, else NaN,
getDateAvg(md, exposureTime)Return date at the middle of the exposure.
offsetDate(date, offsetSec)Return a date offset by a specified number of seconds.
pascalFromMBar(mbar)Convert pressure from millibars to Pascals
pascalFromMmHg(mmHg)Convert pressure from mm Hg to Pascals
pascalFromTorr(torr)Convert pressure from torr to Pascals
popAngle(md, key[, units])Pop an lsst.afw.geom.Angle, whose metadata is in the specified units, with a default of Nan
popFloat(md, key)Pop a float with a default of NaN.
popIsoDate(md, key[, timesys])Pop a FITS ISO date as an lsst.daf.base.DateTime
popItem(md, key[, default])Return an item of metadata.
popMjdDate(md, key[, timesys])Get a FITS MJD date as an
lsst.daf.base.DateTime.setArgDict(md, argDict)Set an argument dict for VisitInfo and pop associated metadata.
Attributes Documentation
- observatory = -70.7494W, -30.2446N 2663¶
Methods Documentation
- __call__(md, exposureId)¶
Construct a VisitInfo and strip associated data from the metadata.
- Parameters:
- md
lsst.daf.base.PropertyListorlsst.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
- md
Notes
The basic implementation sets
dateandexposureTimeusing typical values found in FITS files and logs a warning if neither can be set.
- static altitudeFromZenithDistance(zd)¶
Convert zenith distance to altitude (lsst.afw.geom.Angle)
- static centigradeFromKelvin(tempK)¶
Convert temperature from Kelvin to Centigrade
- static defaultMetadata(value, defaultValue, minimum=None, maximum=None)¶
Return the value if it is not NaN and within min/max, otherwise return defaultValue.
- static eraFromLstAndLongitude(lst, longitude)¶
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.
- getDarkTime(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)
- getDateAvg(md, exposureTime)¶
Return date at the middle of the exposure.
- Parameters:
- md
lsst.daf.base.PropertySet Image metadata.
- exposureTime
float Exposure time, in sec
- md
- Returns:
- dateAvg
lsst.daf.base.DateTime Date at middle of the exposure, or
lsst.daf.base.DateTime()if the metadata itemTAIis not found.
- dateAvg
- offsetDate(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.DateTimeThe offset date.
- date
- static pascalFromMBar(mbar)¶
Convert pressure from millibars to Pascals
- static pascalFromMmHg(mmHg)¶
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)
- static pascalFromTorr(torr)¶
Convert pressure from torr to Pascals
- popAngle(md, key, units=Unit('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.PropertyListorPropertySet Metadata to pull
keyfrom.- key
str Key to read from md.
- md
- Returns:
lsst.afw.geom.AngleValue of the requested key as an angle; Angle(NaN) if the key is not found.
- popFloat(md, key)¶
Pop a float with a default of NaN.
- popIsoDate(md, key, timesys=None)¶
Pop a FITS ISO date as an lsst.daf.base.DateTime
- Parameters:
- Returns:
lsst.daf.base.DateTimeValue of the requested date;
DateTime()if the key is not found.
- popItem(md, key, default=None)¶
Return an item of metadata.
The item is removed if
doStripHeaderisTrue.Log a warning if the key is not found.
- popMjdDate(md, key, timesys=None)¶
Get a FITS MJD date as an
lsst.daf.base.DateTime.- Parameters:
- Returns:
lsst.daf.base.DateTimeValue of the requested date;
DateTime()if the key is not found.
- setArgDict(md, argDict)¶
Set an argument dict for VisitInfo and pop associated metadata.
- Parameters:
- md
lsst.daf.base.PropertySet Image metadata.
- argDict
dict A dict of arguments for the
lsst.afw.image.VisitInfoconstructor. Updated by this call.
- md
- Returns:
- visitInfo
lsst.afw.image.VisitInfo Visit information.
- visitInfo