lsst.obs.base  20.0.0
Public Member Functions | Static Public Attributes | List of all members
lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter Class Reference
Inheritance diagram for lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter:
lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase

Public Member Functions

def metadata (self)
 
def readMetadata (self)
 
def stripMetadata (self)
 
def readComponent (self, component, parameters=None)
 
def readFull (self, parameters=None)
 
def read (self, component=None, parameters=None)
 
def write (self, inMemoryDataset)
 

Static Public Attributes

string extension = ".fits"
 

Detailed Description

Interface for reading and writing Exposures to and from FITS files.

Definition at line 29 of file fitsExposureFormatter.py.

Member Function Documentation

◆ metadata()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.metadata (   self)
The metadata read from this file. It will be stripped as
components are extracted from it
(`lsst.daf.base.PropertyList`).

Definition at line 36 of file fitsExposureFormatter.py.

◆ read()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.read (   self,
  component = None,
  parameters = None 
)
Read data from a file.

Parameters
----------
component : `str`, optional
    Component to read from the file. Only used if the `StorageClass`
    for reading differed from the `StorageClass` used to write the
    file.
parameters : `dict`, optional
    If specified, a dictionary of slicing parameters that
    overrides those in ``fileDescriptor``.

Returns
-------
inMemoryDataset : `object`
    The requested data as a Python object. The type of object
    is controlled by the specific formatter.

Raises
------
ValueError
    Component requested but this file does not seem to be a concrete
    composite.
KeyError
    Raised when parameters passed with fileDescriptor are not
    supported.

Definition at line 166 of file fitsExposureFormatter.py.

◆ readComponent()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.readComponent (   self,
  component,
  parameters = None 
)
Read a component held by the Exposure.

Parameters
----------
component : `str`, optional
    Component to read from the file.
parameters : `dict`, optional
    If specified, a dictionary of slicing parameters that
    overrides those in ``fileDescriptor``.

Returns
-------
obj : component-dependent
    In-memory component object.

Raises
------
KeyError
    Raised if the requested component cannot be handled.

Reimplemented in lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.

Definition at line 79 of file fitsExposureFormatter.py.

◆ readFull()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.readFull (   self,
  parameters = None 
)
Read the full Exposure object.

Parameters
----------
parameters : `dict`, optional
    If specified a dictionary of slicing parameters that overrides
    those in ``fileDescriptor`.

Returns
-------
exposure : `~lsst.afw.image.Exposure`
    Complete in-memory exposure.

Reimplemented in lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.

Definition at line 139 of file fitsExposureFormatter.py.

◆ readMetadata()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.readMetadata (   self)
Read all header metadata directly into a PropertyList.

Returns
-------
metadata : `~lsst.daf.base.PropertyList`
    Header metadata.

Definition at line 45 of file fitsExposureFormatter.py.

◆ stripMetadata()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.stripMetadata (   self)
Remove metadata entries that are parsed into components.

This is only called when just the metadata is requested; stripping
entries there forces code that wants other components to ask for those
components directly rather than trying to extract them from the
metadata manually, which is fragile.  This behavior is an intentional
change from Gen2.

Parameters
----------
metadata : `~lsst.daf.base.PropertyList`
    Header metadata, to be modified in-place.

Reimplemented in lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.

Definition at line 58 of file fitsExposureFormatter.py.

◆ write()

def lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.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.

Reimplemented in lsst.obs.base.fitsRawFormatterBase.FitsRawFormatterBase.

Definition at line 207 of file fitsExposureFormatter.py.

Member Data Documentation

◆ extension

string lsst.obs.base.fitsExposureFormatter.FitsExposureFormatter.extension = ".fits"
static

Definition at line 32 of file fitsExposureFormatter.py.


The documentation for this class was generated from the following file: