lsst.obs.base  20.0.0-27-g22bab1b+60c4b1e1c0
Public Member Functions | Static Public Attributes | List of all members
lsst.obs.base.formatters.fitsExposure.FitsMaskFormatter Class Reference
Inheritance diagram for lsst.obs.base.formatters.fitsExposure.FitsMaskFormatter:
lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter

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)
 
def write (self, inMemoryDataset)
 
def getImageCompressionSettings (self, recipeName)
 
def validateWriteRecipes (cls, recipes)
 

Static Public Attributes

 supportedExtensions = frozenset({".fits", ".fits.gz", ".fits.fz"})
 
string extension = ".fits"
 
 supportedWriteParameters = frozenset({"recipe"})
 
dictionary unsupportedParameters = {}
 

Detailed Description

Specialisation for `~lsst.afw.image.Mask` reading.

Definition at line 426 of file fitsExposure.py.

Member Function Documentation

◆ getImageCompressionSettings()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.getImageCompressionSettings (   self,
  recipeName 
)
inherited
Retrieve the relevant compression settings for this recipe.

Parameters
----------
recipeName : `str`
    Label associated with the collection of compression parameters
    to select.

Returns
-------
settings : `dict`
    The selected settings.

Definition at line 302 of file fitsExposure.py.

◆ metadata()

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

Definition at line 91 of file fitsExposure.py.

◆ read()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.read (   self,
  component = None 
)
inherited
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.

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 234 of file fitsExposure.py.

◆ readComponent()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.readComponent (   self,
  component,
  parameters = None 
)
inherited
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 144 of file fitsExposure.py.

◆ readFull()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.readFull (   self,
  parameters = None 
)
inherited
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 211 of file fitsExposure.py.

◆ readMetadata()

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

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

Definition at line 100 of file fitsExposure.py.

◆ stripMetadata()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.stripMetadata (   self)
inherited
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 115 of file fitsExposure.py.

◆ validateWriteRecipes()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.validateWriteRecipes (   cls,
  recipes 
)
inherited
Validate supplied recipes for this formatter.

The recipes are supplemented with default values where appropriate.

TODO: replace this custom validation code with Cerberus (DM-11846)

Parameters
----------
recipes : `dict`
    Recipes to validate. Can be empty dict or `None`.

Returns
-------
validated : `dict`
    Validated recipes. Returns what was given if there are no
    recipes listed.

Raises
------
RuntimeError
    Raised if validation fails.

Definition at line 339 of file fitsExposure.py.

◆ write()

def lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.write (   self,
  inMemoryDataset 
)
inherited
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 272 of file fitsExposure.py.

Member Data Documentation

◆ extension

string lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.extension = ".fits"
staticinherited

Definition at line 82 of file fitsExposure.py.

◆ supportedExtensions

lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.supportedExtensions = frozenset({".fits", ".fits.gz", ".fits.fz"})
staticinherited

Definition at line 81 of file fitsExposure.py.

◆ supportedWriteParameters

lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.supportedWriteParameters = frozenset({"recipe"})
staticinherited

Definition at line 84 of file fitsExposure.py.

◆ unsupportedParameters

dictionary lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter.unsupportedParameters = {}
staticinherited

Definition at line 87 of file fitsExposure.py.


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