lsst.obs.base
19.0.0-21-gaaa92db
|
Public Member Functions | |
def | __init__ (self, args, kwargs) |
def | fromMetadata (cls, metadata, obsInfo=None, storageClass=None, location=None) |
def | translatorClass (self) |
def | filterDefinitions (self) |
def | readImage (self) |
def | readMask (self) |
def | readVariance (self) |
def | isOnSky (self) |
def | stripMetadata (self) |
def | makeVisitInfo (self) |
def | getDetector (self, id) |
def | makeWcs (self, visitInfo, detector) |
def | makeFilter (self) |
def | readImageComponent (self, component) |
def | readInfoComponent (self, component) |
def | readFull (self, parameters=None) |
def | readRawHeaderWcs (self, parameters=None) |
def | write (self, inMemoryDataset) |
def | observationInfo (self) |
Abstract base class for reading and writing raw data to and from FITS files.
Definition at line 39 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Definition at line 44 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.filterDefinitions | ( | self | ) |
`~lsst.obs.base.FilterDefinitions`, defining the filters for this instrument.
Definition at line 93 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.fromMetadata | ( | cls, | |
metadata, | |||
obsInfo = None , |
|||
storageClass = None , |
|||
location = None |
|||
) |
Construct a possibly-limited formatter from known metadata. Parameters ---------- metadata : `lsst.daf.base.PropertyList` Raw header metadata, with any fixes (see `astro_metadata_translator.fix_header`) applied but nothing stripped. obsInfo : `astro_metadata_translator.ObservationInfo`, optional Structured information already extracted from ``metadata``. If not provided, will be read from ``metadata`` on first use. storageClass : `lsst.daf.butler.StorageClass`, optional StorageClass for this file. If not provided, the formatter will only support `makeWcs`, `makeVisitInfo`, `makeFilter`, and other operations that operate purely on metadata and not the actual file. location : `lsst.daf.butler.Location`, optional. Location of the file. If not provided, the formatter will only support `makeWcs`, `makeVisitInfo`, `makeFilter`, and other operations that operate purely on metadata and not the actual file. Returns ------- formatter : `FitsRawFormatterBase` An instance of ``cls``.
Definition at line 50 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.getDetector | ( | self, | |
id | |||
) |
Return the detector that acquired this raw exposure. Parameters ---------- id : `int` The identifying number of the detector to get. Returns ------- detector : `~lsst.afw.cameraGeom.Detector` The detector associated with that ``id``.
Definition at line 179 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.isOnSky | ( | self | ) |
Boolean to determine if the exposure is thought to be on the sky. Returns ------- onSky : `bool` Returns `True` if the observation looks like it was taken on the sky. Returns `False` if this observation looks like a calibration observation. Notes ----- If there is tracking RA/Dec information associated with the observation it is assumed that the observation is on sky. Currently the observation type is not checked.
Definition at line 139 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.makeFilter | ( | self | ) |
Construct a Filter from metadata. Returns ------- filter : `~lsst.afw.image.Filter` Object that identifies the filter for this image. Raises ------ NotFoundError Raised if the physical filter was not registered via `~lsst.afw.image.utils.defineFilter`.
Definition at line 258 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.makeVisitInfo | ( | self | ) |
Construct a VisitInfo from metadata. Returns ------- visitInfo : `~lsst.afw.image.VisitInfo` Structured metadata about the observation.
Definition at line 168 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.makeWcs | ( | self, | |
visitInfo, | |||
detector | |||
) |
Create a SkyWcs from information about the exposure. If VisitInfo is not None, use it and the detector to create a SkyWcs, otherwise return the metadata-based SkyWcs (always created, so that the relevant metadata keywords are stripped). Parameters ---------- visitInfo : `~lsst.afw.image.VisitInfo` The information about the telescope boresight and camera orientation angle for this exposure. detector : `~lsst.afw.cameraGeom.Detector` The detector used to acquire this exposure. Returns ------- skyWcs : `~lsst.afw.geom.SkyWcs` Reversible mapping from pixel coordinates to sky coordinates. Raises ------ InitialSkyWcsError Raised if there is an error generating the SkyWcs, chained from the lower-level exception if available.
Definition at line 194 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.observationInfo | ( | self | ) |
The `~astro_metadata_translator.ObservationInfo` extracted from this file's metadata (`~astro_metadata_translator.ObservationInfo`, read-only).
Definition at line 376 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readFull | ( | self, | |
parameters = None |
|||
) |
Read the full Exposure object. Parameters ---------- parameters : `dict`, optional If specified, a dictionary of slicing parameters that overrides those in the `fileDescriptor` attribute. Returns ------- exposure : `~lsst.afw.image.Exposure` Complete in-memory exposure.
Definition at line 323 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readImage | ( | self | ) |
Read just the image component of the Exposure. Returns ------- image : `~lsst.afw.image.Image` In-memory image component.
Definition at line 99 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readImageComponent | ( | self, | |
component | |||
) |
Read the image, mask, or variance component of an Exposure. Parameters ---------- component : `str`, optional Component to read from the file. Always one of "image", "variance", or "mask". Returns ------- image : `~lsst.afw.image.Image` or `~lsst.afw.image.Mask` In-memory image, variance, or mask component.
Definition at line 274 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readInfoComponent | ( | self, | |
component | |||
) |
Read a component held by ExposureInfo. The implementation provided by FitsRawFormatter provides only "wcs" and "visitInfo". When adding support for other components, subclasses should delegate to `super()` for those and update `readFull` with similar logic. Parameters ---------- component : `str`, optional Component to read from the file. Returns ------- obj : component-dependent In-memory component object.
Definition at line 295 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readMask | ( | self | ) |
Read just the mask component of the Exposure. May return None (as the default implementation does) to indicate that there is no mask information to be extracted (at least not trivially) from the raw data. This will prohibit direct reading of just the mask, and set the mask of the full Exposure to zeros. Returns ------- mask : `~lsst.afw.image.Mask` In-memory mask component.
Definition at line 109 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readRawHeaderWcs | ( | self, | |
parameters = None |
|||
) |
Read the SkyWcs stored in the un-modified raw FITS WCS header keys.
Definition at line 355 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.readVariance | ( | self | ) |
Read just the variance component of the Exposure. May return None (as the default implementation does) to indicate that there is no variance information to be extracted (at least not trivially) from the raw data. This will prohibit direct reading of just the variance, and set the variance of the full Exposure to zeros. Returns ------- image : `~lsst.afw.image.Image` In-memory variance component.
Definition at line 124 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.stripMetadata | ( | self | ) |
Remove metadata entries that are parsed into components.
Definition at line 159 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.translatorClass | ( | self | ) |
`~astro_metadata_translator.MetadataTranslator` to translate metadata header to `~astro_metadata_translator.ObservationInfo`.
Definition at line 83 of file fitsRawFormatterBase.py.
def lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.write | ( | self, | |
inMemoryDataset | |||
) |
Write a Python object to a file. Parameters ---------- inMemoryDataset : `object` The Python object to store. Returns ------- path : `str` The `URI` where the primary file is stored.
Definition at line 360 of file fitsRawFormatterBase.py.