File ExposureFitsReader.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace afw
namespace image
class ExposureFitsReader
#include <ExposureFitsReader.h>

A FITS reader class for Exposures and their components.

All ExposureFitsReader methods provide strong exception safety, but exceptions thrown by the internal fits::Fits object itself may change its status variable or HDU pointer; ExposureFitsReader guards against this by resetting those before any use of the Fits object.

Unnamed Group

std::string readImageDType() const

Read a string describing the pixel type of the on-disk image plane.

Return

A string of the form [u](int|float)<bits> (e.g. “uint16”, “float64”).

std::string readMaskDType() const
std::string readVarianceDType() const

Unnamed Group

template<typename ImagePixelT>
Image<ImagePixelT> readImage(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool allowUnsafe = false)

Read the image plane.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read. This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

template<typename ImagePixelT>
ndarray::Array<ImagePixelT, 2, 2> readImageArray(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool allowUnsafe = false)

Unnamed Group

template<typename VariancePixelT>
Image<VariancePixelT> readVariance(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool allowUnsafe = false)

Read the variance plane.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read. This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

template<typename VariancePixelT>
ndarray::Array<VariancePixelT, 2, 2> readVarianceArray(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool allowUnsafe = false)

Public Functions

ExposureFitsReader(std::string const &fileName)

Construct a FITS reader object.

Parameters
  • fileName: Name of a file to open.

ExposureFitsReader(fits::MemFileManager &manager)

Construct a FITS reader object.

Parameters
  • manager: Memory block containing a FITS file.

ExposureFitsReader(fits::Fits *fitsFile)

Construct a FITS reader object.

Parameters
  • fitsFile: Pointer to a CFITSIO file object. Lifetime will not be managed by the Reader object.

ExposureFitsReader(ExposureFitsReader const&)
ExposureFitsReader(ExposureFitsReader&&)
ExposureFitsReader &operator=(ExposureFitsReader const&)
ExposureFitsReader &operator=(ExposureFitsReader&&)
~ExposureFitsReader()
lsst::geom::Box2I readBBox(ImageOrigin origin = PARENT)

Read the bounding box of the on-disk image.

Parameters
  • origin: Coordinate system convention for the returned box. If LOCAL, the returned box will always have a minimum of (0, 0).

lsst::geom::Point2I readXY0(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT)

Read the image origin from the on-disk image or a subimage thereof.

Parameters
  • bbox: A bounding box used to defined a subimage, or an empty

  • origin: Coordinate system convention for the given box. Ignored if bbox is empty.

std::shared_ptr<daf::base::PropertyList> readMetadata()

Read the flexible metadata associated with the Exposure.

FITS header keys used to construct other Exposure components will be stripped.

std::shared_ptr<afw::geom::SkyWcs> readWcs()

Read the Exposure’s world coordinate system.

Filter readFilter()

Read the Exposure’s filter.

std::shared_ptr<PhotoCalib> readPhotoCalib()

Read the Exposure’s photometric calibration.

std::shared_ptr<detection::Psf> readPsf()

Read the Exposure’s point-spread function.

std::shared_ptr<afw::geom::polygon::Polygon> readValidPolygon()

Read the polygon describing the region of validity for the Exposure.

std::shared_ptr<ApCorrMap> readApCorrMap()

Read the Exposure’s aperture correction map.

std::shared_ptr<CoaddInputs> readCoaddInputs()

Read the Exposure’s coadd input catalogs.

std::shared_ptr<VisitInfo> readVisitInfo()

Read the Exposure’s visit metadata.

std::shared_ptr<TransmissionCurve> readTransmissionCurve()

Read the Exposure’s transmission curve.

std::shared_ptr<cameraGeom::Detector> readDetector()

Read the Exposure’s detector.

std::map<std::string, std::shared_ptr<table::io::Persistable>> readExtraComponents()

Read the Exposure’s non-standard components.

std::shared_ptr<ExposureInfo> readExposureInfo()

Read the ExposureInfo containing all non-image components.

template<typename MaskPixelT>
Mask<MaskPixelT> readMask(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool conformMasks = false, bool allowUnsafe = false)

Read the mask plane.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read. This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • conformMasks: If True, conform the global mask dict to match this file.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

template<typename MaskPixelT>
ndarray::Array<MaskPixelT, 2, 2> readMaskArray(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool allowUnsafe = false)

Read the mask plane.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read. This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

template<typename ImagePixelT, typename MaskPixelT = MaskPixel, typename VariancePixelT = VariancePixel>
MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT> readMaskedImage(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool conformMasks = false, bool allowUnsafe = false)

Read the MaskedImage.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read (for the image plane). This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • conformMasks: If True, conform the global mask dict to match this file.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

template<typename ImagePixelT, typename MaskPixelT = MaskPixel, typename VariancePixelT = VariancePixel>
Exposure<ImagePixelT, MaskPixelT, VariancePixelT> read(lsst::geom::Box2I const &bbox = lsst::geom::Box2I(), ImageOrigin origin = PARENT, bool conformMasks = false, bool allowUnsafe = false)

Read the full Exposure.

In Python, this templated method is wrapped with an additional

dtype argument to provide the type to read (for the image plane). This defaults to the type of the on-disk image.
Parameters
  • bbox: A bounding box used to defined a subimage, or an empty box (default) to read the whole image.

  • origin: Coordinate system convention for the given box.

  • conformMasks: If True, conform the global mask dict to match this file.

  • allowUnsafe: Permit reading into the requested pixel type even when on-disk values may overflow or truncate.

std::string getFileName() const

Return the name of the file this reader targets.

Private Functions

void _ensureReaders()
fits::Fits *_getFitsFile()

Private Members

MaskedImageFitsReader _maskedImageReader
std::unique_ptr<MetadataReader> _metadataReader
std::unique_ptr<ArchiveReader> _archiveReader