LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::afw::image Namespace Reference

Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects. More...

Namespaces

 _exposureFitsReaderContinued
 
 _exposureInfoContinued
 
 _exposureSummaryStats
 
 _filter
 
 apCorrMap
 
 basicUtils
 
 detail
 
 details
 
 exposure
 
 image
 
 impl
 
 maskedImage
 
 pixel
 
 python
 
 SdssFilters
 
 testUtils
 
 utils
 

Classes

class  imageIterator
 An ImageBase iterator. More...
 
class  imageLocator
 An ImageBase locator. More...
 
class  ApCorrMap
 A thin wrapper around std::map to allow aperture corrections to be attached to Exposures. More...
 
class  CoaddInputs
 A simple Persistable struct containing ExposureCatalogs that record the inputs to a coadd. More...
 
class  Color
 Describe the colour of a source. More...
 
class  DefectBase
 Encapsulate information about a bad portion of a detector. More...
 
class  Exposure
 A class to contain the data, WCS, and other information needed to describe an image of the sky. More...
 
class  ExposureFitsReader
 A FITS reader class for Exposures and their components. More...
 
class  ExposureInfo
 A collection of all the things that make an Exposure different from a MaskedImage. More...
 
class  FilterLabel
 A group of labels for a filter in an exposure or coadd. More...
 
class  Image
 A class to represent a 2-dimensional array of pixels. More...
 
class  DecoratedImage
 A container for an Image and its associated metadata. More...
 
struct  pixelOp0
 A functor class equivalent to std::function<ValT ()>, but with a virtual operator() More...
 
struct  pixelOp1
 A functor class equivalent to std::function<ValT (ValT)>, but with a virtual operator() More...
 
struct  pixelOp1XY
 A functor class equivalent to std::function<ValT (int, int, ValT)>, but with a virtual operator() More...
 
struct  pixelOp2
 A functor class equivalent to std::function<LhsT (LhsT, RhsT)>, but with a virtual operator() More...
 
struct  pixelOp2XY
 A functor class equivalent to std::function<LhsT (int, int, LhsT, RhsT)>, but with a virtual operator() More...
 
class  CheckIndices
 A class used to request that array accesses be checked. More...
 
struct  Reference
 metafunction to extract reference type from PixelT More...
 
struct  ConstReference
 metafunction to extract const reference type from PixelT More...
 
class  ImageBase
 The base class for all image classed (Image, Mask, MaskedImage, ...) More...
 
class  ImageBaseFitsReader
 Base class for image FITS readers. More...
 
class  ImageFitsReader
 A FITS reader class for regular Images. More...
 
class  ImagePca
 
class  ImageSlice
 A class to specify a slice of an image. More...
 
class  Mask
 Represent a 2-dimensional array of bitmask pixels. More...
 
class  MaskedImage
 A class to manipulate images, masks, and variance as a single object. More...
 
struct  GetImage
 
class  MaskedImageFitsReader
 A FITS reader class for MaskedImages and their components. More...
 
class  MaskFitsReader
 A FITS reader class for Masks. More...
 
struct  Measurement
 A value and its error. More...
 
class  PhotoCalib
 The photometric calibration of an exposure. More...
 
class  TransmissionCurve
 A spatially-varying transmission curve as a function of wavelength. More...
 
class  VisitInfo
 Information about a single exposure of an imaging camera. More...
 

Typedefs

using MaskPixel = std::int32_t
 default type for Masks and MaskedImage Masks More...
 
using VariancePixel = float
 default type for MaskedImage variance images More...
 
using PyCoaddInputs = py::class_< CoaddInputs, std::shared_ptr< CoaddInputs >, typehandling::Storable >
 
using PyColor = py::class_< Color, std::shared_ptr< Color > >
 
using PyTransmissionCurve = py::class_< TransmissionCurve, std::shared_ptr< TransmissionCurve >, typehandling::Storable >
 

Enumerations

enum  ImageOrigin { PARENT , LOCAL }
 
enum  xOrY { X , Y }
 
enum class  RotType { UNKNOWN , SKY , HORIZON , MOUNT }
 Type of rotation. More...
 

Functions

double abMagFromFlux (double flux)
 Compute AB magnitude from flux in Janskys. More...
 
double abMagErrFromFluxErr (double fluxErr, double flux)
 Compute AB magnitude error from flux and flux error in Janskys. More...
 
double fluxFromABMag (double mag) noexcept
 Compute flux in Janskys from AB magnitude. More...
 
double fluxErrFromABMagErr (double magErr, double mag) noexcept
 Compute flux error in Janskys from AB magnitude error and AB magnitude. More...
 
template<typename T >
ndarray::Array< T, 1 > abMagFromFlux (ndarray::Array< T const, 1 > const &flux)
 Compute AB magnitude from flux in Janskys. More...
 
template<typename T >
ndarray::Array< T, 1 > abMagErrFromFluxErr (ndarray::Array< T const, 1 > const &fluxErr, ndarray::Array< T const, 1 > const &flux)
 Compute AB magnitude error from flux and flux error in Janskys. More...
 
template<typename T >
ndarray::Array< T, 1 > fluxFromABMag (ndarray::Array< T const, 1 > const &mag)
 Compute flux in Janskys from AB magnitude. More...
 
template<typename T >
ndarray::Array< T, 1 > fluxErrFromABMagErr (ndarray::Array< T const, 1 > const &magErr, ndarray::Array< T const, 1 > const &mag)
 Compute flux error in Janskys from AB magnitude error and AB magnitude. More...
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::shared_ptr< Exposure< ImagePixelT, MaskPixelT, VariancePixelT > > makeExposure (MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, std::shared_ptr< geom::SkyWcs const > wcs=std::shared_ptr< geom::SkyWcs const >())
 A function to return an Exposure of the correct type (cf. More...
 
 FilterProperty (FilterProperty const &)=default
 
 FilterProperty (FilterProperty &&) noexcept=default
 
FilterPropertyoperator= (FilterProperty const &)=default
 
FilterPropertyoperator= (FilterProperty &&) noexcept=default
 
 ~FilterProperty () noexcept=default
 
std::string const & getName () const noexcept
 Return a filter's name. More...
 
double getLambdaEff () const noexcept
 Return the filter's effective wavelength (nm) More...
 
double getLambdaMin () const noexcept
 Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum. More...
 
double getLambdaMax () const noexcept
 Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum. More...
 
bool operator== (FilterProperty const &rhs) const noexcept
 Return true iff two FilterProperties are identical. More...
 
bool operator!= (FilterProperty const &rhs) const noexcept
 Return true iff rhs != this. More...
 
std::size_t hash_value () const noexcept
 Return a hash of this object. More...
 
std::string getPersistenceName () const override
 
std::string getPythonModule () const override
 
void write (OutputArchiveHandle &handle) const override
 
std::string getDatabaseFilterLabel (std::string const &filterLabel)
 Remap special characters, etc. More...
 
template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & operator+= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Add lhs to Image rhs (i.e. pixel-by-pixel addition) where types are different. More...
 
template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & operator-= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Subtract lhs from Image rhs (i.e. pixel-by-pixel subtraction) where types are different. More...
 
template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & operator*= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) where types are different. More...
 
template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & operator/= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Divide lhs by Image rhs (i.e. pixel-by-pixel division) where types are different. More...
 
template<typename PixelT >
void swap (Image< PixelT > &a, Image< PixelT > &b)
 
template<typename PixelT >
void swap (DecoratedImage< PixelT > &a, DecoratedImage< PixelT > &b)
 
lsst::geom::Box2I bboxFromMetadata (daf::base::PropertySet &metadata)
 Determine the image bounding box from its metadata (FITS header) More...
 
template<typename T1 , typename T2 >
bool imagesOverlap (ImageBase< T1 > const &image1, ImageBase< T2 > const &image2)
 Return true if the pixels for two images or masks overlap in memory. More...
 
template<typename LhsT >
void for_each_pixel (Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
 Set each pixel in an Image<LhsT> to func() More...
 
template<typename LhsT >
void for_each_pixel (Image< LhsT > &lhs, pixelOp1< LhsT > const &func)
 Set each pixel in an Image<LhsT> to func(lhs) More...
 
template<typename LhsT >
void for_each_pixel (Image< LhsT > &lhs, pixelOp1XY< LhsT > const &func)
 Set each pixel in an Image<LhsT> to func(x, y, lhs) More...
 
template<typename LhsT , typename RhsT >
void for_each_pixel (Image< LhsT > &lhs, Image< RhsT > const &rhs, pixelOp1< RhsT > const &func)
 Set each pixel in an Image<LhsT> to func(rhs), getting the rhs from an Image<RhsT> More...
 
template<typename LhsT , typename RhsT >
void for_each_pixel (Image< LhsT > &lhs, Image< RhsT > const &rhs, pixelOp2< LhsT, RhsT > const &func)
 Set each pixel in an Image<LhsT> to func(lhs, rhs), getting the rhs from an Image<RhsT> More...
 
template<typename LhsT , typename RhsT >
void for_each_pixel (Image< LhsT > &lhs, Image< RhsT > const &rhs, pixelOp2XY< LhsT, RhsT > const &func)
 Set each pixel in an Image<LhsT> to func(x, y, lhs, rhs), getting the rhs from an Image<RhsT> More...
 
template<typename PixelT >
void swap (ImageBase< PixelT > &a, ImageBase< PixelT > &b)
 
template<typename Image1T , typename Image2T >
double innerProduct (Image1T const &lhs, Image2T const &rhs, int const border=0)
 Calculate the inner product of two images. More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator+ (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 Overload operator+() More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator+ (ImageSlice< PixelT > const &slc, Image< PixelT > const &img)
 Overload operator+() More...
 
template<typename PixelT >
void operator+= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator+=() More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator- (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 Overload operator-() More...
 
template<typename PixelT >
void operator-= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator-=() More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator* (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 Overload operator*() More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator* (ImageSlice< PixelT > const &slc, Image< PixelT > const &img)
 Overload operator*() More...
 
template<typename PixelT >
void operator*= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator*=() More...
 
template<typename PixelT >
std::shared_ptr< Image< PixelT > > operator/ (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 Overload operator/() More...
 
template<typename PixelT >
void operator/= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator/=() More...
 
double indexToPosition (double ind)
 Convert image index to image position. More...
 
int positionToIndex (double pos)
 Convert image position to nearest integer index. More...
 
int positionToIndex (double &residual, double pos)
 Convert image position to index (nearest integer and fractional parts) More...
 
std::pair< int, double > positionToIndex (double const pos, bool)
 Convert image position to index (nearest integer and fractional parts) More...
 
template<typename PixelT >
void swap (Mask< PixelT > &a, Mask< PixelT > &b)
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage (typename std::shared_ptr< Image< ImagePixelT >> image, typename std::shared_ptr< Mask< MaskPixelT >> mask=Mask< MaskPixelT >(), typename std::shared_ptr< Image< VariancePixelT >> variance=Image< VariancePixelT >())
 A function to return a MaskedImage of the correct type (cf. More...
 
template<typename ImagePixelT1 , typename ImagePixelT2 >
bool imagesOverlap (MaskedImage< ImagePixelT1, MaskPixel, VariancePixel > const &image1, MaskedImage< ImagePixelT2, MaskPixel, VariancePixel > const &image2)
 Return true if the pixels for two masked images (image, variance or mask plane) overlap in memory. More...
 
std::ostreamoperator<< (std::ostream &os, Measurement const &measurement)
 
void assertNonNegative (double value, std::string const &name)
 Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0. More...
 
std::shared_ptr< PhotoCalibmakePhotoCalibFromMetadata (daf::base::PropertySet &metadata, bool strip=false)
 Construct a PhotoCalib from FITS FLUXMAG0/FLUXMAG0ERR keywords. More...
 
std::shared_ptr< PhotoCalibmakePhotoCalibFromCalibZeroPoint (double instFluxMag0, double instFluxMag0Err)
 Construct a PhotoCalib from the deprecated Calib-style instFluxMag0/instFluxMag0Err values. More...
 
std::ostreamoperator<< (std::ostream &os, VisitInfo const &visitInfo)
 
void wrapCalib (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapCoaddInputs (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapColor (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapDefect (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapExposureInfo (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFilter (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFilterLabel (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapExposure (lsst::utils::python::WrapperCollection &)
 
void wrapImagePca (lsst::utils::python::WrapperCollection &)
 
void wrapImageUtils (lsst::utils::python::WrapperCollection &)
 
void wrapPhotoCalib (lsst::utils::python::WrapperCollection &)
 
void wrapReaders (lsst::utils::python::WrapperCollection &)
 
void wrapTransmissionCurve (lsst::utils::python::WrapperCollection &)
 
void wrapVisitInfo (lsst::utils::python::WrapperCollection &)
 
 PYBIND11_MODULE (_imageLib, mod)
 
void declareVisitInfo (lsst::utils::python::WrapperCollection &wrappers)
 
void declareRotType (lsst::utils::python::WrapperCollection &wrappers)
 
 PYBIND11_MODULE (_exposure, mod)
 
void wrapImage (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapImageSlice (lsst::utils::python::WrapperCollection &)
 
 PYBIND11_MODULE (_maskedImage, mod)
 
template ndarray::Array< float, 1 > abMagFromFlux (ndarray::Array< float const, 1 > const &flux)
 
template ndarray::Array< float, 1 > abMagErrFromFluxErr (ndarray::Array< float const, 1 > const &fluxErr, ndarray::Array< float const, 1 > const &flux)
 
template ndarray::Array< float, 1 > fluxFromABMag (ndarray::Array< float const, 1 > const &mag)
 
template ndarray::Array< float, 1 > fluxErrFromABMagErr (ndarray::Array< float const, 1 > const &magErr, ndarray::Array< float const, 1 > const &mag)
 
template ndarray::Array< double, 1 > abMagFromFlux (ndarray::Array< double const, 1 > const &flux)
 
template ndarray::Array< double, 1 > abMagErrFromFluxErr (ndarray::Array< double const, 1 > const &fluxErr, ndarray::Array< double const, 1 > const &flux)
 
template ndarray::Array< double, 1 > fluxFromABMag (ndarray::Array< double const, 1 > const &mag)
 
template ndarray::Array< double, 1 > fluxErrFromABMagErr (ndarray::Array< double const, 1 > const &magErr, ndarray::Array< double const, 1 > const &mag)
 
std::shared_ptr< FilterLabelmakeFilterLabelDirect (std::string const &name)
 Convert an old-style filter name to a FilterLabel without external information. More...
 
std::shared_ptr< FilterLabelmakeFilterLabel (Filter const &filter)
 Convert an old-style Filter to a FilterLabel. More...
 
std::shared_ptr< FilterLabelmakeFilterLabel (std::string const &name)
 Convert an old-style single Filter name to a FilterLabel, using available information. More...
 
Filter makeFilter (FilterLabel const &label)
 Convert a FilterLabel back to an old-style Filter. More...
 
template bool imagesOverlap< std::uint16_t, std::uint16_t > (MaskedImage< std::uint16_t > const &, MaskedImage< std::uint16_t > const &)
 
template bool imagesOverlap< std::uint16_t, int > (MaskedImage< std::uint16_t > const &, MaskedImage< int > const &)
 
template bool imagesOverlap< std::uint16_t, float > (MaskedImage< std::uint16_t > const &, MaskedImage< float > const &)
 
template bool imagesOverlap< std::uint16_t, double > (MaskedImage< std::uint16_t > const &, MaskedImage< double > const &)
 
template bool imagesOverlap< std::uint16_t, std::uint64_t > (MaskedImage< std::uint16_t > const &, MaskedImage< std::uint64_t > const &)
 
template bool imagesOverlap< int, std::uint16_t > (MaskedImage< int > const &, MaskedImage< std::uint16_t > const &)
 
template bool imagesOverlap< int, int > (MaskedImage< int > const &, MaskedImage< int > const &)
 
template bool imagesOverlap< int, float > (MaskedImage< int > const &, MaskedImage< float > const &)
 
template bool imagesOverlap< int, double > (MaskedImage< int > const &, MaskedImage< double > const &)
 
template bool imagesOverlap< int, std::uint64_t > (MaskedImage< int > const &, MaskedImage< std::uint64_t > const &)
 
template bool imagesOverlap< float, std::uint16_t > (MaskedImage< float > const &, MaskedImage< std::uint16_t > const &)
 
template bool imagesOverlap< float, int > (MaskedImage< float > const &, MaskedImage< int > const &)
 
template bool imagesOverlap< float, float > (MaskedImage< float > const &, MaskedImage< float > const &)
 
template bool imagesOverlap< float, double > (MaskedImage< float > const &, MaskedImage< double > const &)
 
template bool imagesOverlap< float, std::uint64_t > (MaskedImage< float > const &, MaskedImage< std::uint64_t > const &)
 
template bool imagesOverlap< double, std::uint16_t > (MaskedImage< double > const &, MaskedImage< std::uint16_t > const &)
 
template bool imagesOverlap< double, int > (MaskedImage< double > const &, MaskedImage< int > const &)
 
template bool imagesOverlap< double, float > (MaskedImage< double > const &, MaskedImage< float > const &)
 
template bool imagesOverlap< double, double > (MaskedImage< double > const &, MaskedImage< double > const &)
 
template bool imagesOverlap< double, std::uint64_t > (MaskedImage< double > const &, MaskedImage< std::uint64_t > const &)
 
template bool imagesOverlap< std::uint64_t, std::uint16_t > (MaskedImage< std::uint64_t > const &, MaskedImage< std::uint16_t > const &)
 
template bool imagesOverlap< std::uint64_t, int > (MaskedImage< std::uint64_t > const &, MaskedImage< int > const &)
 
template bool imagesOverlap< std::uint64_t, float > (MaskedImage< std::uint64_t > const &, MaskedImage< float > const &)
 
template bool imagesOverlap< std::uint64_t, double > (MaskedImage< std::uint64_t > const &, MaskedImage< double > const &)
 
template bool imagesOverlap< std::uint64_t, std::uint64_t > (MaskedImage< std::uint64_t > const &, MaskedImage< std::uint64_t > const &)
 
std::ostreamoperator<< (std::ostream &os, PhotoCalib const &photoCalib)
 

Variables

class[[deprecated("Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be " "removed after v22.")]] FilterProperty final
 Describe the properties of a Filter (e.g. More...
 
const double PixelZeroPos = 0.0
 position of center of pixel 0 More...
 

Detailed Description

Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.

Typedef Documentation

◆ MaskPixel

default type for Masks and MaskedImage Masks

Definition at line 34 of file LsstImageTypes.h.

◆ PyCoaddInputs

Definition at line 40 of file _coaddInputs.cc.

◆ PyColor

using lsst::afw::image::PyColor = typedef py::class_<Color, std::shared_ptr<Color> >

Definition at line 38 of file _color.cc.

◆ PyTransmissionCurve

Definition at line 43 of file _transmissionCurve.cc.

◆ VariancePixel

using lsst::afw::image::VariancePixel = typedef float

default type for MaskedImage variance images

Definition at line 35 of file LsstImageTypes.h.

Enumeration Type Documentation

◆ ImageOrigin

Enumerator
PARENT 
LOCAL 

Definition at line 94 of file ImageBase.h.

◆ RotType

Type of rotation.

Enumerator
UNKNOWN 

Rotation angle is unknown.

Note: if there is no instrument rotator then it is better to compute SKY or HORIZON and use that rotation type rather than specify UNKNOWN.

SKY 

Position angle of focal plane +Y, measured from N through E.

At 0 degrees, +Y is along N and +X is along E/W depending on handedness. At 90 degrees, +Y is along E and +X is along S/N depending on handedness.

HORIZON 

Position angle of focal plane +Y, measured from +Alt through +Az.

At 0 degrees, +Y is along +Alt and +X is along +/-Az, depending on handedness. At 90 degrees, +Y is along +Az and +X is along -/+Alt, depending on handedness.

MOUNT 

The position sent to the instrument rotator; the details depend on the rotator.

Definition at line 45 of file VisitInfo.h.

45  {
46  UNKNOWN,
48  SKY,
51  HORIZON,
54  MOUNT
55 };
@ HORIZON
Position angle of focal plane +Y, measured from +Alt through +Az.
@ MOUNT
The position sent to the instrument rotator; the details depend on the rotator.
@ UNKNOWN
Rotation angle is unknown.
@ SKY
Position angle of focal plane +Y, measured from N through E.

◆ xOrY

Enumerator

Definition at line 36 of file ImageUtils.h.

Function Documentation

◆ ~FilterProperty()

lsst::afw::image::~FilterProperty ( )
defaultnoexcept

◆ abMagErrFromFluxErr() [1/4]

double lsst::afw::image::abMagErrFromFluxErr ( double  fluxErr,
double  flux 
)
inline

Compute AB magnitude error from flux and flux error in Janskys.

Definition at line 52 of file Calib.h.

52  {
53  return std::abs(fluxErr / (-0.4 * flux * std::log(10)));
54 }
T log(T... args)
Angle abs(Angle const &a)
Definition: Angle.h:106

◆ abMagErrFromFluxErr() [2/4]

template ndarray::Array< double , 1> lsst::afw::image::abMagErrFromFluxErr ( ndarray::Array< double const, 1 > const &  fluxErr,
ndarray::Array< double const, 1 > const &  flux 
)

◆ abMagErrFromFluxErr() [3/4]

template ndarray::Array< float , 1> lsst::afw::image::abMagErrFromFluxErr ( ndarray::Array< float const, 1 > const &  fluxErr,
ndarray::Array< float const, 1 > const &  flux 
)

◆ abMagErrFromFluxErr() [4/4]

template<typename T >
ndarray::Array< T, 1 > lsst::afw::image::abMagErrFromFluxErr ( ndarray::Array< T const, 1 > const &  fluxErr,
ndarray::Array< T const, 1 > const &  flux 
)

Compute AB magnitude error from flux and flux error in Janskys.

Definition at line 51 of file Calib.cc.

52  {
53  if (flux.getNumElements() != fluxErr.getNumElements()) {
54  throw LSST_EXCEPT(pex::exceptions::LengthError, (boost::format("Length mismatch: %d vs %d") %
55  flux.getNumElements() % fluxErr.getNumElements())
56  .str());
57  }
58  ndarray::Array<T, 1> out = ndarray::allocate(flux.getShape());
59  for (std::size_t ii = 0; ii < flux.getNumElements(); ++ii) {
60  out[ii] = abMagErrFromFluxErr(fluxErr[ii], flux[ii]);
61  }
62  return out;
63 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
template ndarray::Array< double, 1 > abMagErrFromFluxErr(ndarray::Array< double const, 1 > const &fluxErr, ndarray::Array< double const, 1 > const &flux)
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ abMagFromFlux() [1/4]

double lsst::afw::image::abMagFromFlux ( double  flux)
inline

Compute AB magnitude from flux in Janskys.

Definition at line 49 of file Calib.h.

49 { return -2.5 * std::log10(flux / JanskysPerABFlux); }
T log10(T... args)

◆ abMagFromFlux() [2/4]

template ndarray::Array< double , 1> lsst::afw::image::abMagFromFlux ( ndarray::Array< double const, 1 > const &  flux)

◆ abMagFromFlux() [3/4]

template ndarray::Array< float , 1> lsst::afw::image::abMagFromFlux ( ndarray::Array< float const, 1 > const &  flux)

◆ abMagFromFlux() [4/4]

template<typename T >
ndarray::Array< T, 1 > lsst::afw::image::abMagFromFlux ( ndarray::Array< T const, 1 > const &  flux)

Compute AB magnitude from flux in Janskys.

Definition at line 41 of file Calib.cc.

41  {
42  ndarray::Array<T, 1> out = ndarray::allocate(flux.getShape());
43  for (std::size_t ii = 0; ii < flux.getNumElements(); ++ii) {
44  out[ii] = abMagFromFlux(flux[ii]);
45  }
46  return out;
47 }
template ndarray::Array< double, 1 > abMagFromFlux(ndarray::Array< double const, 1 > const &flux)

◆ assertNonNegative()

void lsst::afw::image::assertNonNegative ( double  value,
std::string const &  name 
)
inline

Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0.

Used for checking the calibration mean/error in the constructor.

Parameters
valueValue that should be positive.
nameText to prepend to error message.
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif value < 0

Definition at line 69 of file PhotoCalib.h.

69  {
70  if (value < 0) {
72  (boost::format("%s must be positive: %.3g") % name % value).str());
73  }
74 }
table::Key< std::string > name
Definition: Amplifier.cc:116
Reports invalid arguments.
Definition: Runtime.h:66

◆ bboxFromMetadata()

lsst::geom::Box2I lsst::afw::image::bboxFromMetadata ( daf::base::PropertySet metadata)

Determine the image bounding box from its metadata (FITS header)

Note that this modifies the metadata, stripping the WCS headers that provide the xy0.

Definition at line 682 of file Image.cc.

682  {
684  if (metadata.exists("ZNAXIS1") && metadata.exists("ZNAXIS2")) {
685  dims = lsst::geom::Extent2I(metadata.getAsInt("ZNAXIS1"), metadata.getAsInt("ZNAXIS2"));
686  } else {
687  dims = lsst::geom::Extent2I(metadata.getAsInt("NAXIS1"), metadata.getAsInt("NAXIS2"));
688  }
690  return lsst::geom::Box2I(xy0, dims);
691 }
An integer coordinate rectangle.
Definition: Box.h:55
lsst::geom::Point2I getImageXY0FromMetadata(daf::base::PropertySet &metadata, std::string const &wcsName, bool strip=false)
Definition: wcsUtils.cc:95
std::string const wcsNameForXY0
Definition: ImageBase.h:70
Extent< int, 2 > Extent2I
Definition: Extent.h:397

◆ declareRotType()

void lsst::afw::image::declareRotType ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 133 of file _visitInfo.cc.

133  {
134  wrappers.wrapType(py::enum_<RotType>(wrappers.module, "RotType"), [](auto &mod, auto &enm) {
135  enm.value("UNKNOWN", RotType::UNKNOWN);
136  enm.value("SKY", RotType::SKY);
137  enm.value("HORIZON", RotType::HORIZON);
138  enm.value("MOUNT", RotType::MOUNT);
139  enm.export_values();
140  });
141 }

◆ declareVisitInfo()

void lsst::afw::image::declareVisitInfo ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 57 of file _visitInfo.cc.

57  {
58  wrappers.wrapType(
59  py::class_<VisitInfo, std::shared_ptr<VisitInfo>, typehandling::Storable>(wrappers.module,
60  "VisitInfo"),
61  [](auto &mod, auto &cls) {
62  /* Constructors */
63  cls.def(py::init<table::RecordId, double, double, daf::base::DateTime const &, double,
64  lsst::geom::Angle const &, lsst::geom::SpherePoint const &,
65  lsst::geom::SpherePoint const &, double, lsst::geom::Angle const &,
66  RotType const &, coord::Observatory const &, coord::Weather const &,
67  std::string const &, table::RecordId const &>(),
68  "exposureId"_a = 0, "exposureTime"_a = nan, "darkTime"_a = nan,
69  "date"_a = daf::base::DateTime(), "ut1"_a = nan, "era"_a = nanAngle,
70  "boresightRaDec"_a = lsst::geom::SpherePoint(nanAngle, nanAngle),
71  "boresightAzAlt"_a = lsst::geom::SpherePoint(nanAngle, nanAngle),
72  "boresightAirmass"_a = nan, "boresightRotAngle"_a = nanAngle,
73  "rotType"_a = RotType::UNKNOWN,
74  "observatory"_a = coord::Observatory(nanAngle, nanAngle, nan),
75  "weather"_a = coord::Weather(nan, nan, nan), "instrumentLabel"_a = "", "id"_a = 0);
76  cls.def(py::init<daf::base::PropertySet const &>(), "metadata"_a);
77  cls.def(py::init<VisitInfo const &>(), "visitInfo"_a);
78 
79  table::io::python::addPersistableMethods<VisitInfo>(cls);
80 
81  /* Operators */
82  cls.def(
83  "__eq__", [](VisitInfo const &self, VisitInfo const &other) { return self == other; },
84  py::is_operator());
85  cls.def(
86  "__ne__", [](VisitInfo const &self, VisitInfo const &other) { return self != other; },
87  py::is_operator());
88 
89  /* Members */
90  cls.def("getExposureId", &VisitInfo::getExposureId);
91  cls.def("getExposureTime", &VisitInfo::getExposureTime);
92  cls.def("getDarkTime", &VisitInfo::getDarkTime);
93  cls.def("getDate", &VisitInfo::getDate);
94  cls.def("getUt1", &VisitInfo::getUt1);
95  cls.def("getEra", &VisitInfo::getEra);
96  cls.def("getBoresightRaDec", &VisitInfo::getBoresightRaDec);
97  cls.def("getBoresightAzAlt", &VisitInfo::getBoresightAzAlt);
98  cls.def("getBoresightAirmass", &VisitInfo::getBoresightAirmass);
99  cls.def("getBoresightParAngle", &VisitInfo::getBoresightParAngle);
100  cls.def("getBoresightRotAngle", &VisitInfo::getBoresightRotAngle);
101  cls.def("getRotType", &VisitInfo::getRotType);
102  cls.def("getObservatory", &VisitInfo::getObservatory);
103  cls.def("getWeather", &VisitInfo::getWeather);
104  cls.def("isPersistable", &VisitInfo::isPersistable);
105  cls.def("getLocalEra", &VisitInfo::getLocalEra);
106  cls.def("getBoresightHourAngle", &VisitInfo::getBoresightHourAngle);
107  cls.def("getInstrumentLabel", &VisitInfo::getInstrumentLabel);
108  cls.def("getId", &VisitInfo::getId);
109 
110  /* readonly property accessors */
111  cls.def_property_readonly("exposureTime", &VisitInfo::getExposureTime);
112  cls.def_property_readonly("darkTime", &VisitInfo::getDarkTime);
113  cls.def_property_readonly("date", &VisitInfo::getDate);
114  cls.def_property_readonly("ut1", &VisitInfo::getUt1);
115  cls.def_property_readonly("era", &VisitInfo::getEra);
116  cls.def_property_readonly("boresightRaDec", &VisitInfo::getBoresightRaDec);
117  cls.def_property_readonly("boresightAzAlt", &VisitInfo::getBoresightAzAlt);
118  cls.def_property_readonly("boresightAirmass", &VisitInfo::getBoresightAirmass);
119  cls.def_property_readonly("boresightParAngle", &VisitInfo::getBoresightParAngle);
120  cls.def_property_readonly("boresightRotAngle", &VisitInfo::getBoresightRotAngle);
121  cls.def_property_readonly("rotType", &VisitInfo::getRotType);
122  cls.def_property_readonly("observatory", &VisitInfo::getObservatory);
123  cls.def_property_readonly("weather", &VisitInfo::getWeather);
124  cls.def_property_readonly("isPersistable", &VisitInfo::isPersistable);
125  cls.def_property_readonly("localEra", &VisitInfo::getLocalEra);
126  cls.def_property_readonly("boresightHourAngle", &VisitInfo::getBoresightHourAngle);
127  cls.def_property_readonly("instrumentLabel", &VisitInfo::getInstrumentLabel);
128  cls.def_property_readonly("id", &VisitInfo::getId);
129 
130  utils::python::addOutputOp(cls, "__str__");
131  });
132 }
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
Definition: python.h:87

◆ FilterProperty() [1/2]

◆ FilterProperty() [2/2]

◆ fluxErrFromABMagErr() [1/4]

double lsst::afw::image::fluxErrFromABMagErr ( double  magErr,
double  mag 
)
inlinenoexcept

Compute flux error in Janskys from AB magnitude error and AB magnitude.

Definition at line 60 of file Calib.h.

60  {
61  return std::abs(-0.4 * magErr * fluxFromABMag(mag) * std::log(10.0));
62 }
ndarray::Array< T, 1 > fluxFromABMag(ndarray::Array< T const, 1 > const &mag)
Compute flux in Janskys from AB magnitude.
Definition: Calib.cc:67

◆ fluxErrFromABMagErr() [2/4]

template ndarray::Array< double , 1> lsst::afw::image::fluxErrFromABMagErr ( ndarray::Array< double const, 1 > const &  magErr,
ndarray::Array< double const, 1 > const &  mag 
)

◆ fluxErrFromABMagErr() [3/4]

template ndarray::Array< float , 1> lsst::afw::image::fluxErrFromABMagErr ( ndarray::Array< float const, 1 > const &  magErr,
ndarray::Array< float const, 1 > const &  mag 
)

◆ fluxErrFromABMagErr() [4/4]

template<typename T >
ndarray::Array< T, 1 > lsst::afw::image::fluxErrFromABMagErr ( ndarray::Array< T const, 1 > const &  magErr,
ndarray::Array< T const, 1 > const &  mag 
)

Compute flux error in Janskys from AB magnitude error and AB magnitude.

Definition at line 77 of file Calib.cc.

78  {
79  if (mag.getNumElements() != magErr.getNumElements()) {
80  throw LSST_EXCEPT(pex::exceptions::LengthError, (boost::format("Length mismatch: %d vs %d") %
81  mag.getNumElements() % magErr.getNumElements())
82  .str());
83  }
84  ndarray::Array<T, 1> out = ndarray::allocate(mag.getShape());
85  for (std::size_t ii = 0; ii < mag.getNumElements(); ++ii) {
86  out[ii] = fluxErrFromABMagErr(magErr[ii], mag[ii]);
87  }
88  return out;
89 }
template ndarray::Array< double, 1 > fluxErrFromABMagErr(ndarray::Array< double const, 1 > const &magErr, ndarray::Array< double const, 1 > const &mag)

◆ fluxFromABMag() [1/4]

double lsst::afw::image::fluxFromABMag ( double  mag)
inlinenoexcept

Compute flux in Janskys from AB magnitude.

Definition at line 57 of file Calib.h.

57 { return std::pow(10.0, -0.4 * mag) * JanskysPerABFlux; }
T pow(T... args)

◆ fluxFromABMag() [2/4]

template ndarray::Array< double , 1> lsst::afw::image::fluxFromABMag ( ndarray::Array< double const, 1 > const &  mag)

◆ fluxFromABMag() [3/4]

template ndarray::Array< float , 1> lsst::afw::image::fluxFromABMag ( ndarray::Array< float const, 1 > const &  mag)

◆ fluxFromABMag() [4/4]

template<typename T >
ndarray::Array< T, 1 > lsst::afw::image::fluxFromABMag ( ndarray::Array< T const, 1 > const &  mag)

Compute flux in Janskys from AB magnitude.

Definition at line 67 of file Calib.cc.

67  {
68  ndarray::Array<T, 1> out = ndarray::allocate(mag.getShape());
69  for (std::size_t ii = 0; ii < mag.getNumElements(); ++ii) {
70  out[ii] = fluxFromABMag(mag[ii]);
71  }
72  return out;
73 }
template ndarray::Array< double, 1 > fluxFromABMag(ndarray::Array< double const, 1 > const &mag)

◆ for_each_pixel() [1/6]

template<typename LhsT , typename RhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
Image< RhsT > const &  rhs,
pixelOp1< RhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func(rhs), getting the rhs from an Image<RhsT>

Parameters
lhsImage to set
rhsother Image to pass to `func`
funcfunctor to call

Definition at line 142 of file ImageAlgorithm.h.

145  {
146  if (lhs.getDimensions() != rhs.getDimensions()) {
148  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
149  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
150  .str());
151  }
152 
153  for (int y = 0; y != lhs.getHeight(); ++y) {
154  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
155 
156  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
157  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
158  *lhsPtr = func(*rhsPtr);
159  }
160  }
161 }
int y
Definition: SpanSet.cc:48
Reports attempts to exceed implementation-defined length limits for some classes.
Definition: Runtime.h:76

◆ for_each_pixel() [2/6]

template<typename LhsT , typename RhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
Image< RhsT > const &  rhs,
pixelOp2< LhsT, RhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func(lhs, rhs), getting the rhs from an Image<RhsT>

Parameters
lhsImage to set
rhsother Image to pass to `func`
funcfunctor to call

Definition at line 167 of file ImageAlgorithm.h.

170  {
171  if (lhs.getDimensions() != rhs.getDimensions()) {
173  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
174  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
175  .str());
176  }
177 
178  for (int y = 0; y != lhs.getHeight(); ++y) {
179  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
180 
181  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
182  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
183  *lhsPtr = func(*lhsPtr, *rhsPtr);
184  }
185  }
186 }

◆ for_each_pixel() [3/6]

template<typename LhsT , typename RhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
Image< RhsT > const &  rhs,
pixelOp2XY< LhsT, RhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func(x, y, lhs, rhs), getting the rhs from an Image<RhsT>

(x, y) allow for lhs.getXY0()

Parameters
lhsImage to set
rhsother Image to pass to `func`
funcfunctor to call

Definition at line 193 of file ImageAlgorithm.h.

196  {
197  if (lhs.getDimensions() != rhs.getDimensions()) {
199  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
200  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
201  .str());
202  }
203 
204  for (int y = 0; y != lhs.getHeight(); ++y) {
205  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
206  int x = lhs.getX0();
207  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
208  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr, ++x) {
209  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr, *rhsPtr);
210  }
211  }
212 }
double x

◆ for_each_pixel() [4/6]

template<typename LhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
pixelOp0< LhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func()

Parameters
lhsImage to set
funcfunctor to call
Examples
forEachPixel.cc.

Definition at line 94 of file ImageAlgorithm.h.

96  {
97  for (int y = 0; y != lhs.getHeight(); ++y) {
98  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
99  lhsPtr != lhsEnd; ++lhsPtr) {
100  *lhsPtr = func();
101  }
102  }
103 }

◆ for_each_pixel() [5/6]

template<typename LhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
pixelOp1< LhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func(lhs)

Parameters
lhsImage to set
funcfunctor to call

Definition at line 109 of file ImageAlgorithm.h.

111  {
112  for (int y = 0; y != lhs.getHeight(); ++y) {
113  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
114  lhsPtr != lhsEnd; ++lhsPtr) {
115  *lhsPtr = func(*lhsPtr);
116  }
117  }
118 }

◆ for_each_pixel() [6/6]

template<typename LhsT >
void lsst::afw::image::for_each_pixel ( Image< LhsT > &  lhs,
pixelOp1XY< LhsT > const &  func 
)

Set each pixel in an Image<LhsT> to func(x, y, lhs)

(x, y) allow for lhs.getXY0()

Parameters
lhsImage to set
funcfunctor to call

Definition at line 126 of file ImageAlgorithm.h.

128  {
129  for (int y = 0; y != lhs.getHeight(); ++y) {
130  int x = lhs.getX0();
131  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
132  lhsPtr != lhsEnd; ++lhsPtr, ++x) {
133  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr);
134  }
135  }
136 }

◆ getDatabaseFilterLabel()

std::string lsst::afw::image::getDatabaseFilterLabel ( std::string const &  filterLabel)

Remap special characters, etc.

to "_" for database fields.

Returns
The filter label in database-sanitized format.

Definition at line 45 of file FilterLabel.cc.

45  {
46  static std::regex const unsafeCharacters("\\W"s);
47  return std::regex_replace(filterLabel, unsafeCharacters, "_"s);
48 }
T regex_replace(T... args)

◆ getLambdaEff()

double lsst::afw::image::getLambdaEff ( ) const
noexcept

Return the filter's effective wavelength (nm)

Definition at line 82 of file Filter.h.

82 { return _lambdaEff; }

◆ getLambdaMax()

double lsst::afw::image::getLambdaMax ( ) const
noexcept

Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum.

Definition at line 90 of file Filter.h.

90 { return _lambdaMax; }

◆ getLambdaMin()

double lsst::afw::image::getLambdaMin ( ) const
noexcept

Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum.

Definition at line 86 of file Filter.h.

86 { return _lambdaMin; }

◆ getName()

std::string const & lsst::afw::image::getName ( ) const
noexcept

Return a filter's name.

Return a Filter's name.

Definition at line 78 of file Filter.h.

78 { return _name; }

◆ getPersistenceName()

std::string lsst::afw::image::getPersistenceName ( ) const
overrideprotected

◆ getPythonModule()

std::string lsst::afw::image::getPythonModule ( ) const
overrideprotected

◆ hash_value()

std::size_t lsst::afw::image::hash_value ( ) const
overridenoexcept

Return a hash of this object.

◆ imagesOverlap() [1/2]

template<typename T1 , typename T2 >
bool lsst::afw::image::imagesOverlap ( ImageBase< T1 > const &  image1,
ImageBase< T2 > const &  image2 
)

Return true if the pixels for two images or masks overlap in memory.

Definition at line 694 of file Image.cc.

694  {
695 
696  if (image1.getArea() == 0 || image2.getArea() == 0) {
697  // zero-area images cannot overlap.
698  return false;
699  }
700 
701  auto arr1 = image1.getArray();
702  // get the address of the first and one-past-the-last element of arr1 using ndarray iterators;
703  // this works because the iterators for contiguous 1-d ndarray Arrays are just pointers
704  auto beg1Addr = arr1.front().begin();
705  auto end1Addr = arr1.back().end();
706 
707  auto arr2 = image2.getArray();
708  auto beg2Addr = arr2.front().begin();
709  auto end2Addr = arr2.back().end();
710 
711  auto ptrLess = std::less<void const* const>();
712  return ptrLess(beg1Addr, end2Addr) && ptrLess(beg2Addr, end1Addr);
713 }

◆ imagesOverlap() [2/2]

template<typename ImagePixelT1 , typename ImagePixelT2 >
bool lsst::afw::image::imagesOverlap ( MaskedImage< ImagePixelT1, MaskPixel, VariancePixel > const &  image1,
MaskedImage< ImagePixelT2, MaskPixel, VariancePixel > const &  image2 
)

Return true if the pixels for two masked images (image, variance or mask plane) overlap in memory.

Definition at line 680 of file MaskedImage.cc.

681  {
682  return imagesOverlap(*image1.getImage(), *image2.getImage()) ||
683  imagesOverlap(*image1.getVariance(), *image2.getVariance()) ||
684  imagesOverlap(*image1.getMask(), *image2.getMask());
685 }
bool imagesOverlap(ImageBase< T1 > const &image1, ImageBase< T2 > const &image2)
Return true if the pixels for two images or masks overlap in memory.
Definition: Image.cc:694

◆ imagesOverlap< double, double >()

template bool lsst::afw::image::imagesOverlap< double, double > ( MaskedImage< double > const &  ,
MaskedImage< double > const &   
)

◆ imagesOverlap< double, float >()

template bool lsst::afw::image::imagesOverlap< double, float > ( MaskedImage< double > const &  ,
MaskedImage< float > const &   
)

◆ imagesOverlap< double, int >()

template bool lsst::afw::image::imagesOverlap< double, int > ( MaskedImage< double > const &  ,
MaskedImage< int > const &   
)

◆ imagesOverlap< double, std::uint16_t >()

template bool lsst::afw::image::imagesOverlap< double, std::uint16_t > ( MaskedImage< double > const &  ,
MaskedImage< std::uint16_t > const &   
)

◆ imagesOverlap< double, std::uint64_t >()

template bool lsst::afw::image::imagesOverlap< double, std::uint64_t > ( MaskedImage< double > const &  ,
MaskedImage< std::uint64_t > const &   
)

◆ imagesOverlap< float, double >()

template bool lsst::afw::image::imagesOverlap< float, double > ( MaskedImage< float > const &  ,
MaskedImage< double > const &   
)

◆ imagesOverlap< float, float >()

template bool lsst::afw::image::imagesOverlap< float, float > ( MaskedImage< float > const &  ,
MaskedImage< float > const &   
)

◆ imagesOverlap< float, int >()

template bool lsst::afw::image::imagesOverlap< float, int > ( MaskedImage< float > const &  ,
MaskedImage< int > const &   
)

◆ imagesOverlap< float, std::uint16_t >()

template bool lsst::afw::image::imagesOverlap< float, std::uint16_t > ( MaskedImage< float > const &  ,
MaskedImage< std::uint16_t > const &   
)

◆ imagesOverlap< float, std::uint64_t >()

template bool lsst::afw::image::imagesOverlap< float, std::uint64_t > ( MaskedImage< float > const &  ,
MaskedImage< std::uint64_t > const &   
)

◆ imagesOverlap< int, double >()

template bool lsst::afw::image::imagesOverlap< int, double > ( MaskedImage< int > const &  ,
MaskedImage< double > const &   
)

◆ imagesOverlap< int, float >()

template bool lsst::afw::image::imagesOverlap< int, float > ( MaskedImage< int > const &  ,
MaskedImage< float > const &   
)

◆ imagesOverlap< int, int >()

template bool lsst::afw::image::imagesOverlap< int, int > ( MaskedImage< int > const &  ,
MaskedImage< int > const &   
)

◆ imagesOverlap< int, std::uint16_t >()

template bool lsst::afw::image::imagesOverlap< int, std::uint16_t > ( MaskedImage< int > const &  ,
MaskedImage< std::uint16_t > const &   
)

◆ imagesOverlap< int, std::uint64_t >()

template bool lsst::afw::image::imagesOverlap< int, std::uint64_t > ( MaskedImage< int > const &  ,
MaskedImage< std::uint64_t > const &   
)

◆ imagesOverlap< std::uint16_t, double >()

template bool lsst::afw::image::imagesOverlap< std::uint16_t, double > ( MaskedImage< std::uint16_t > const &  ,
MaskedImage< double > const &   
)

◆ imagesOverlap< std::uint16_t, float >()

template bool lsst::afw::image::imagesOverlap< std::uint16_t, float > ( MaskedImage< std::uint16_t > const &  ,
MaskedImage< float > const &   
)

◆ imagesOverlap< std::uint16_t, int >()

template bool lsst::afw::image::imagesOverlap< std::uint16_t, int > ( MaskedImage< std::uint16_t > const &  ,
MaskedImage< int > const &   
)

◆ imagesOverlap< std::uint16_t, std::uint16_t >()

◆ imagesOverlap< std::uint16_t, std::uint64_t >()

◆ imagesOverlap< std::uint64_t, double >()

template bool lsst::afw::image::imagesOverlap< std::uint64_t, double > ( MaskedImage< std::uint64_t > const &  ,
MaskedImage< double > const &   
)

◆ imagesOverlap< std::uint64_t, float >()

template bool lsst::afw::image::imagesOverlap< std::uint64_t, float > ( MaskedImage< std::uint64_t > const &  ,
MaskedImage< float > const &   
)

◆ imagesOverlap< std::uint64_t, int >()

template bool lsst::afw::image::imagesOverlap< std::uint64_t, int > ( MaskedImage< std::uint64_t > const &  ,
MaskedImage< int > const &   
)

◆ imagesOverlap< std::uint64_t, std::uint16_t >()

◆ imagesOverlap< std::uint64_t, std::uint64_t >()

◆ indexToPosition()

double lsst::afw::image::indexToPosition ( double  ind)
inline

Convert image index to image position.

The LSST indexing convention is:

  • the index of the bottom left pixel is 0,0
  • the position of the center of the bottom left pixel is PixelZeroPos, PixelZeroPos
Returns
image position
Parameters
indimage index

Definition at line 55 of file ImageUtils.h.

56  {
57  return ind + PixelZeroPos;
58 }
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:44

◆ innerProduct()

template<typename Image1T , typename Image2T >
double lsst::afw::image::innerProduct ( Image1T const &  lhs,
Image2T const &  rhs,
int const  border = 0 
)

Calculate the inner product of two images.

Parameters
lhsfirst image
rhsOther image to dot with first
bordernumber of pixels to ignore around the edge
Returns
The inner product
Exceptions
lsst::pex::exceptions::LengthErrorif all the images aren't the same size

Definition at line 414 of file ImagePca.cc.

414  {
415  if (lhs.getWidth() <= 2 * border || lhs.getHeight() <= 2 * border) {
417  (boost::format("All image pixels are in the border of width %d: %dx%d") % border %
418  lhs.getWidth() % lhs.getHeight())
419  .str());
420  }
421 
422  double sum = 0.0;
423  //
424  // Handle I.I specially for efficiency, and to avoid advancing the iterator twice
425  //
426  if (imagesAreIdentical(lhs, rhs)) {
427  for (int y = border; y != lhs.getHeight() - border; ++y) {
428  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
429  lend = lhs.row_end(y) - border;
430  lptr != lend; ++lptr) {
431  typename Image1T::Pixel val = *lptr;
432  if (std::isfinite(val)) {
433  sum += val * val;
434  }
435  }
436  }
437  } else {
438  if (lhs.getDimensions() != rhs.getDimensions()) {
440  (boost::format("Dimension mismatch: %dx%d v. %dx%d") % lhs.getWidth() %
441  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
442  .str());
443  }
444 
445  for (int y = border; y != lhs.getHeight() - border; ++y) {
446  typename Image2T::const_x_iterator rptr = rhs.row_begin(y) + border;
447  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
448  lend = lhs.row_end(y) - border;
449  lptr != lend; ++lptr, ++rptr) {
450  double const tmp = (*lptr) * (*rptr);
451  if (std::isfinite(tmp)) {
452  sum += tmp;
453  }
454  }
455  }
456  }
457 
458  return sum;
459 }
T isfinite(T... args)
float Pixel
Typedefs to be used for pixel values.
Definition: common.h:37
ImageT val
Definition: CR.cc:146

◆ makeExposure()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::shared_ptr<Exposure<ImagePixelT, MaskPixelT, VariancePixelT> > lsst::afw::image::makeExposure ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &  mimage,
std::shared_ptr< geom::SkyWcs const >  wcs = std::shared_ptr<geom::SkyWcs const>() 
)

A function to return an Exposure of the correct type (cf.

std::make_pair)

Parameters
mimagethe Exposure's image
wcsthe Exposure's WCS

Definition at line 462 of file Exposure.h.

466  {
468  new Exposure<ImagePixelT, MaskPixelT, VariancePixelT>(mimage, wcs));
469 }
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:66

◆ makeFilter()

Filter lsst::afw::image::makeFilter ( FilterLabel const &  label)

Convert a FilterLabel back to an old-style Filter.

Parameters
labelThe FilterLabel to convert.
Returns
The closest equivalent Filter, following the conventions established by obs.base.FilterDefinition.

Definition at line 210 of file ExposureFitsReader.cc.

210  {
211  // Filters still have standard aliases, so can use almost any name to define them.
212  // Prefer afw_name or band because that's what most code assumes is Filter.getName().
213  for (auto const& keyValue : _AFW_NAMES) {
214  std::string const& afwName = keyValue.first;
215  FilterLabel const& afwFilter = keyValue.second;
216  if (label == afwFilter) {
217  return Filter(afwName);
218  }
219  }
220 
221  if (label.hasBandLabel()) {
222  return Filter(label.getBandLabel(), true);
223  } else {
224  // FilterLabel guarantees at least one of band or physical is defined.
225  return Filter(label.getPhysicalLabel(), true);
226  }
227 }

◆ makeFilterLabel() [1/2]

std::shared_ptr< FilterLabel > lsst::afw::image::makeFilterLabel ( Filter const &  filter)

Convert an old-style Filter to a FilterLabel.

If a filter has been declared using lsst.obs.base.FilterDefinition, that information (as encoded in the ~lsst.afw.image.Filter registry) is used to infer the filter's band and physical filter.

Parameters
filterAny Filter object.
Returns
The closest equivalent FilterLabel, given available information.

Definition at line 121 of file ExposureFitsReader.cc.

121  {
122  static Filter const DEFAULT;
123  // Avoid turning dummy filters into real FilterLabels.
124  // Default filter has id=UNKNOWN, but others do too.
125  if (filter.getId() == DEFAULT.getId() && filter.getName() == DEFAULT.getName()) {
126  return nullptr;
127  }
128 
129  // Filter has no self-consistency guarantees whatsoever, and most methods
130  // are unsafe. Program extremely defensively.
131  if (filter.getId() == Filter::UNKNOWN) {
132  // Not a registered filter; guarantees on canonical name do not apply
133  return makeFilterLabelDirect(filter.getName());
134  }
135 
136  // obs.base.FilterDefinition ensures the canonical name is the first defined
137  // of afwname, band name, physical filter name.
138  std::string canonical;
139  try {
140  canonical = filter.getCanonicalName();
141  } catch (pex::exceptions::NotFoundError const&) {
142  // Not a registered filter; guarantees on canonical name do not apply
143  return makeFilterLabelDirect(filter.getName());
144  }
145 
146  if (_AFW_NAMES.count(canonical) > 0) {
147  return std::make_shared<FilterLabel>(_AFW_NAMES.at(canonical));
148  } else if (_isBand(canonical)) {
149  // physical filter is one of the aliases, but can't tell which one
150  // (FilterDefinition helpfully sorts them). Safer to leave it blank.
151  std::vector<std::string> aliases;
152  try {
153  aliases = filter.getAliases();
154  } catch (pex::exceptions::NotFoundError const&) {
155  // No aliases; leave the vector empty
156  }
157  if (aliases.size() == 1) {
158  return std::make_shared<FilterLabel>(FilterLabel::fromBandPhysical(canonical, aliases.front()));
159  } else {
160  return std::make_shared<FilterLabel>(FilterLabel::fromBand(canonical));
161  }
162  } else {
163  return std::make_shared<FilterLabel>(FilterLabel::fromPhysical(canonical));
164  }
165 }
T front(T... args)
std::shared_ptr< FilterLabel > makeFilterLabelDirect(std::string const &name)
Convert an old-style filter name to a FilterLabel without external information.
T size(T... args)

◆ makeFilterLabel() [2/2]

std::shared_ptr<FilterLabel> lsst::afw::image::makeFilterLabel ( std::string const &  name)

Convert an old-style single Filter name to a FilterLabel, using available information.

If a filter has been declared using lsst.obs.base.FilterDefinition, that information (as encoded in the ~lsst.afw.image.Filter registry) is used to infer the filter's band and physical filter.

Parameters
nameThe name persisted in a FITS file. May be any of a Filter's many names.
Returns
The closest equivalent FilterLabel, given available information.

Definition at line 177 of file ExposureFitsReader.cc.

177  {
178  if (_AFW_NAMES.count(name) > 0) {
179  return std::make_shared<FilterLabel>(_AFW_NAMES.at(name));
180  }
181  // else name is either a band, a physical filter, or a deprecated alias
182 
183  try {
184  // To ease the transition to FilterLabel, use Filter to get all the names
185  // TODO: after DM-27177, leave only the catch block
186  Filter filter(name, false);
188  // Make use of the extra information that `name` is a preferred name
189  // If name is not a band, it is likely the physical filter
190  if (converted && !converted->hasPhysicalLabel() && converted->hasBandLabel() &&
191  name != converted->getBandLabel()) {
192  return std::make_shared<FilterLabel>(
193  FilterLabel::fromBandPhysical(converted->getBandLabel(), name));
194  } else {
195  return converted;
196  }
197  } catch (pex::exceptions::NotFoundError const&) {
198  // Unknown filter, no extra info to be gained
199  return makeFilterLabelDirect(name);
200  }
201 }
std::shared_ptr< FilterLabel > makeFilterLabel(std::string const &name)
Convert an old-style single Filter name to a FilterLabel, using available information.

◆ makeFilterLabelDirect()

std::shared_ptr<FilterLabel> lsst::afw::image::makeFilterLabelDirect ( std::string const &  name)

Convert an old-style filter name to a FilterLabel without external information.

Guaranteed to not call any code related to Filter or FilterDefinition.

Parameters
nameA name for the filter.
Returns
A FilterLabel containing that name.

Definition at line 94 of file ExposureFitsReader.cc.

94  {
95  static Filter const DEFAULT;
96  // Avoid turning dummy filters into real FilterLabels.
97  if (name == DEFAULT.getName()) {
98  return nullptr;
99  }
100 
101  // FilterLabel::from* returns a statically allocated object, so only way
102  // to get it into shared_ptr is to copy it.
103  if (_isBand(name)) {
104  return std::make_shared<FilterLabel>(FilterLabel::fromBand(name));
105  } else {
106  return std::make_shared<FilterLabel>(FilterLabel::fromPhysical(name));
107  }
108 }

◆ makeMaskedImage()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>* lsst::afw::image::makeMaskedImage ( typename std::shared_ptr< Image< ImagePixelT >>  image,
typename std::shared_ptr< Mask< MaskPixelT >>  mask = Mask<MaskPixelT>(),
typename std::shared_ptr< Image< VariancePixelT >>  variance = Image<VariancePixelT>() 
)

A function to return a MaskedImage of the correct type (cf.

std::make_pair)

Parameters
imageimage
maskmask
variancevariance

Definition at line 1240 of file MaskedImage.h.

1244  {
1245  return new MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(image, mask, variance);
1246 }
afw::table::Key< afw::table::Array< MaskPixelT > > mask
afw::table::Key< afw::table::Array< VariancePixelT > > variance
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.

◆ makePhotoCalibFromCalibZeroPoint()

std::shared_ptr< PhotoCalib > lsst::afw::image::makePhotoCalibFromCalibZeroPoint ( double  instFluxMag0,
double  instFluxMag0Err 
)

Construct a PhotoCalib from the deprecated Calib-style instFluxMag0/instFluxMag0Err values.

This provides backwards compatibility with the obsoleted Calib object that PhotoCalib replaced. It should not be used outside of tests that compare with old persisted Calib objects.

Parameters
instFluxMag0The instrumental flux at zero magnitude. If 0, the resulting PhotoCalib will have infinite calibrationMean and non-finite (inf or NaN) calibrationErr.
instFluxMag0ErrThe instrumental flux at zero magnitude error. If 0, the resulting PhotoCalib will have 0 calibrationErr.
Returns
Pointer to the constructed PhotoCalib.

Definition at line 613 of file PhotoCalib.cc.

613  {
614  double calibration = utils::referenceFlux / instFluxMag0;
615  double calibrationErr = utils::referenceFlux * instFluxMag0Err / std::pow(instFluxMag0, 2);
616  return std::make_shared<PhotoCalib>(calibration, calibrationErr);
617 }
table::Key< double > calibrationErr
Definition: PhotoCalib.cc:370
const double referenceFlux
The Oke & Gunn (1983) AB magnitude reference flux, in nJy (often approximated as 3631....
Definition: Magnitude.h:46

◆ makePhotoCalibFromMetadata()

std::shared_ptr< PhotoCalib > lsst::afw::image::makePhotoCalibFromMetadata ( daf::base::PropertySet metadata,
bool  strip = false 
)

Construct a PhotoCalib from FITS FLUXMAG0/FLUXMAG0ERR keywords.

This provides backwards compatibility with the obsoleted Calib object that PhotoCalib replaced. It should not be used outside of reading old Exposures written before PhotoCalib existed.

Parameters
metadataFITS header metadata containing FLUXMAG0 and FLUXMAG0ERR keys.
stripStrip FLUXMAG0 and FLUXMAG0ERR from metadata?
Returns
Pointer to the constructed PhotoCalib, or nullptr if FLUXMAG0 is not in the metadata.

Definition at line 595 of file PhotoCalib.cc.

595  {
596  auto key = "FLUXMAG0";
597  if (metadata.exists(key)) {
598  double instFluxMag0 = metadata.getAsDouble(key);
599  if (strip) metadata.remove(key);
600 
601  double instFluxMag0Err = 0.0;
602  key = "FLUXMAG0ERR";
603  if (metadata.exists(key)) {
604  instFluxMag0Err = metadata.getAsDouble(key);
605  if (strip) metadata.remove(key);
606  }
607  return makePhotoCalibFromCalibZeroPoint(instFluxMag0, instFluxMag0Err);
608  } else {
609  return nullptr;
610  }
611 }
bool strip
Definition: fits.cc:911
std::shared_ptr< PhotoCalib > makePhotoCalibFromCalibZeroPoint(double instFluxMag0, double instFluxMag0Err)
Construct a PhotoCalib from the deprecated Calib-style instFluxMag0/instFluxMag0Err values.
Definition: PhotoCalib.cc:613

◆ operator!=()

bool lsst::afw::image::operator!= ( FilterProperty const &  rhs) const
noexcept

Return true iff rhs != this.

Parameters
rhsObject to compare with this

Definition at line 100 of file Filter.h.

101  {
102  return !(*this == rhs);
103  }

◆ operator*() [1/2]

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator* ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator*()

We'll define both 'image*slice' (this one) and 'slice*image' (next one down).

Parameters
imgThe Image
slcThe ImageSlice

Definition at line 104 of file ImageSlice.cc.

104  {
105  std::shared_ptr<Image<PixelT>> retImg(new Image<PixelT>(img, true));
106  *retImg *= slc;
107  return retImg;
108 }

◆ operator*() [2/2]

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator* ( ImageSlice< PixelT > const &  slc,
Image< PixelT > const &  img 
)

Overload operator*()

We'll define both 'image*slice' (this one) and 'slice*image' (next one down).

Parameters
slcThe Image
imgThe ImageSlice

Definition at line 111 of file ImageSlice.cc.

111  {
112  return operator*(img, slc);
113 }
constexpr Angle operator*(Angle a, Angle d) noexcept
Product of two angles.
Definition: Angle.h:322

◆ operator*=() [1/2]

template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & lsst::afw::image::operator*= ( Image< LhsPixelT > &  lhs,
Image< RhsPixelT > const &  rhs 
)

Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) where types are different.

Definition at line 671 of file Image.cc.

671  {
672  for_each_pixel(lhs, rhs, timesEq<LhsPixelT, RhsPixelT>());
673  return lhs;
674 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()

◆ operator*=() [2/2]

template<typename PixelT >
void lsst::afw::image::operator*= ( Image< PixelT > &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator*=()

Only 'image *= slice' is defined, as 'slice *= image' doesn't make sense.

Parameters
[in,out]imgThe Image
[in]slcThe ImageSlice

Definition at line 116 of file ImageSlice.cc.

116  {
117  details::operate<details::Mult<PixelT>>(img, slc, slc.getImageSliceType());
118 }

◆ operator+() [1/2]

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator+ ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator+()

We require two of these, one for image+slice (this one) and one for slice+image (next one down)

Parameters
imgThe Image
slcThe ImageSlice

Definition at line 69 of file ImageSlice.cc.

69  {
70  std::shared_ptr<Image<PixelT>> retImg(new Image<PixelT>(img, true));
71  *retImg += slc;
72  return retImg;
73 }

◆ operator+() [2/2]

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator+ ( ImageSlice< PixelT > const &  slc,
Image< PixelT > const &  img 
)

Overload operator+()

Parameters
slcThe ImageSlice
imgThe Image

We require two of these, one for image+slice (previous one) and one for slice+image (this)

Definition at line 76 of file ImageSlice.cc.

76  {
77  return operator+(img, slc);
78 }
constexpr Angle operator+(Angle a, Angle d) noexcept
Sum of two angles.
Definition: Angle.h:308

◆ operator+=() [1/2]

template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & lsst::afw::image::operator+= ( Image< LhsPixelT > &  lhs,
Image< RhsPixelT > const &  rhs 
)

Add lhs to Image rhs (i.e. pixel-by-pixel addition) where types are different.

Definition at line 659 of file Image.cc.

659  {
660  for_each_pixel(lhs, rhs, plusEq<LhsPixelT, RhsPixelT>());
661  return lhs;
662 }

◆ operator+=() [2/2]

template<typename PixelT >
void lsst::afw::image::operator+= ( Image< PixelT > &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator+=()

We'll only allow 'image += slice'. It doesn't make sense to add an image to a slice.

Parameters
[in,out]imgThe Image
[in]slcThe ImageSlice

Definition at line 81 of file ImageSlice.cc.

81  {
82  details::operate<details::Plus<PixelT>>(img, slc, slc.getImageSliceType());
83 }

◆ operator-()

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator- ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator-()

We'll only allow 'image - slice', as 'slice - image' doesn't make sense.

Parameters
imgThe Image
slcThe ImageSlice

Definition at line 89 of file ImageSlice.cc.

89  {
90  std::shared_ptr<Image<PixelT>> retImg(new Image<PixelT>(img, true));
91  *retImg -= slc;
92  return retImg;
93 }

◆ operator-=() [1/2]

template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & lsst::afw::image::operator-= ( Image< LhsPixelT > &  lhs,
Image< RhsPixelT > const &  rhs 
)

Subtract lhs from Image rhs (i.e. pixel-by-pixel subtraction) where types are different.

Definition at line 665 of file Image.cc.

665  {
666  for_each_pixel(lhs, rhs, minusEq<LhsPixelT, RhsPixelT>());
667  return lhs;
668 }

◆ operator-=() [2/2]

template<typename PixelT >
void lsst::afw::image::operator-= ( Image< PixelT > &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator-=()

Only 'image -= slice' is defined. 'slice -= image' wouldn't make sense.

Parameters
[in,out]imgThe Image
[in]slcThe ImageSlice

Definition at line 96 of file ImageSlice.cc.

96  {
97  details::operate<details::Minus<PixelT>>(img, slc, slc.getImageSliceType());
98 }

◆ operator/()

template<typename PixelT >
std::shared_ptr< Image< PixelT > > lsst::afw::image::operator/ ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator/()

Only 'image / slice' is defined, as 'slice / image' doesn't make sense.

Parameters
imgThe Image
slcThe ImageSlice

Definition at line 123 of file ImageSlice.cc.

123  {
124  std::shared_ptr<Image<PixelT>> retImg(new Image<PixelT>(img, true));
125  *retImg /= slc;
126  return retImg;
127 }

◆ operator/=() [1/2]

template<typename LhsPixelT , typename RhsPixelT >
Image< LhsPixelT > & lsst::afw::image::operator/= ( Image< LhsPixelT > &  lhs,
Image< RhsPixelT > const &  rhs 
)

Divide lhs by Image rhs (i.e. pixel-by-pixel division) where types are different.

Definition at line 677 of file Image.cc.

677  {
678  for_each_pixel(lhs, rhs, divideEq<LhsPixelT, RhsPixelT>());
679  return lhs;
680 }

◆ operator/=() [2/2]

template<typename PixelT >
void lsst::afw::image::operator/= ( Image< PixelT > &  img,
ImageSlice< PixelT > const &  slc 
)

Overload operator/=()

Only 'image /= slice' is defined, as 'slice /= image' doesn't make sense.

Parameters
[in,out]imgThe Image
[in]slcThe ImageSlice

Definition at line 130 of file ImageSlice.cc.

130  {
131  details::operate<details::Div<PixelT>>(img, slc, slc.getImageSliceType());
132 }

◆ operator<<() [1/3]

std::ostream & lsst::afw::image::operator<< ( std::ostream os,
Measurement const &  measurement 
)

Definition at line 47 of file PhotoCalib.cc.

47  {
50  s << "value=" << measurement.value << ", error=" << measurement.error;
51  return os << s.str();
52 }
std::ostream * os
Definition: Schema.cc:557
T setprecision(T... args)
T str(T... args)

◆ operator<<() [2/3]

std::ostream& lsst::afw::image::operator<< ( std::ostream os,
PhotoCalib const &  photoCalib 
)

Definition at line 256 of file PhotoCalib.cc.

256  {
257  return os << photoCalib.toString();
258 }
Key< int > photoCalib
Definition: Exposure.cc:67

◆ operator<<() [3/3]

std::ostream & lsst::afw::image::operator<< ( std::ostream os,
VisitInfo const &  visitInfo 
)

Definition at line 566 of file VisitInfo.cc.

566  {
567  os << visitInfo.toString();
568  return os;
569 }
Key< int > visitInfo
Definition: Exposure.cc:70

◆ operator=() [1/2]

FilterProperty& lsst::afw::image::operator= ( FilterProperty &&  )
defaultnoexcept

◆ operator=() [2/2]

FilterProperty& lsst::afw::image::operator= ( FilterProperty const &  )
default

◆ operator==()

bool lsst::afw::image::operator== ( FilterProperty const &  rhs) const
noexcept

Return true iff two FilterProperties are identical.

Parameters
rhsObject to compare with this

◆ positionToIndex() [1/3]

int lsst::afw::image::positionToIndex ( double &  residual,
double  pos 
)
inline

Convert image position to index (nearest integer and fractional parts)

The LSST indexing convention is:

  • the index of the bottom left pixel is 0,0
  • the position of the center of the bottom left pixel is PixelZeroPos, PixelZeroPos

Note: in python this is called positionToIndexAndResidual

Returns
nearest integer index
Parameters
residualfractional part of index
posimage position

Definition at line 85 of file ImageUtils.h.

87  {
88  double fullIndex = pos - PixelZeroPos;
89  double roundedIndex = std::floor(fullIndex + 0.5);
90  residual = fullIndex - roundedIndex;
91  return static_cast<int>(roundedIndex);
92 }
T floor(T... args)

◆ positionToIndex() [2/3]

std::pair<int, double> lsst::afw::image::positionToIndex ( double const  pos,
bool   
)
inline

Convert image position to index (nearest integer and fractional parts)

Returns
std::pair(nearest integer index, fractional part)
Parameters
posimage position

Definition at line 98 of file ImageUtils.h.

100  {
101  double residual; // fractional part of index
102  int const ind = positionToIndex(residual, pos); // integral part
103 
104  return std::pair<int, double>(ind, residual);
105 }
std::pair< int, double > positionToIndex(double const pos, bool)
Convert image position to index (nearest integer and fractional parts)
Definition: ImageUtils.h:98

◆ positionToIndex() [3/3]

int lsst::afw::image::positionToIndex ( double  pos)
inline

Convert image position to nearest integer index.

The LSST indexing convention is:

  • the index of the bottom left pixel is 0,0
  • the position of the center of the bottom left pixel is PixelZeroPos, PixelZeroPos
Returns
nearest integer index
Parameters
posimage position

Definition at line 69 of file ImageUtils.h.

70  {
71  return static_cast<int>(std::floor(pos + 0.5 - PixelZeroPos));
72 }

◆ PYBIND11_MODULE() [1/3]

lsst::afw::image::PYBIND11_MODULE ( _exposure  ,
mod   
)

Definition at line 182 of file _exposure.cc.

182  {
183  lsst::utils::python::WrapperCollection wrappers(mod, "lsst.afw.image.exposure");
184  wrappers.addSignatureDependency("lsst.afw.image.apCorrMap");
185  wrappers.addSignatureDependency("lsst.afw.geom");
186  wrappers.addSignatureDependency("lsst.afw.detection");
187  wrappers.addSignatureDependency("lsst.afw.image.maskedImage");
188 
189  auto clsExposureF = declareExposure<float>(wrappers, "F");
190  auto clsExposureD = declareExposure<double>(wrappers, "D");
191  declareExposure<int>(wrappers, "I");
192  declareExposure<std::uint16_t>(wrappers, "U");
193  declareExposure<std::uint64_t>(wrappers, "L");
194 
195  // Declare constructors for casting all exposure types to to float and double
196  // (the only two types of casts that Python supports)
197  declareCastConstructor<int, float>(clsExposureF);
198  declareCastConstructor<int, double>(clsExposureD);
199 
200  declareCastConstructor<float, double>(clsExposureD);
201  declareCastConstructor<double, float>(clsExposureF);
202 
203  declareCastConstructor<std::uint16_t, float>(clsExposureF);
204  declareCastConstructor<std::uint16_t, double>(clsExposureD);
205 
206  declareCastConstructor<std::uint64_t, float>(clsExposureF);
207  declareCastConstructor<std::uint64_t, double>(clsExposureD);
208 
209  wrappers.finish();
210 }

◆ PYBIND11_MODULE() [2/3]

lsst::afw::image::PYBIND11_MODULE ( _imageLib  ,
mod   
)

Definition at line 45 of file _imageLib.cc.

45  {
46  lsst::utils::python::WrapperCollection wrappers(mod, "lsst.afw.image");
47  wrapCalib(wrappers);
48  wrapColor(wrappers);
49  wrapCoaddInputs(wrappers);
50  wrapDefect(wrappers);
51  wrapExposureInfo(wrappers);
52  wrapFilter(wrappers);
53  wrapFilterLabel(wrappers);
54  wrapImagePca(wrappers);
55  wrapImageUtils(wrappers);
56  wrapPhotoCalib(wrappers);
57  wrapReaders(wrappers);
58  wrapTransmissionCurve(wrappers);
59  wrapVisitInfo(wrappers);
60  wrappers.finish();
61 }
void wrapCoaddInputs(lsst::utils::python::WrapperCollection &wrappers)
Definition: _coaddInputs.cc:42
void wrapExposureInfo(lsst::utils::python::WrapperCollection &wrappers)
void wrapFilterLabel(lsst::utils::python::WrapperCollection &wrappers)
void wrapFilter(lsst::utils::python::WrapperCollection &wrappers)
Definition: _filter.cc:98
void wrapVisitInfo(lsst::utils::python::WrapperCollection &)
Definition: _visitInfo.cc:143
void wrapDefect(lsst::utils::python::WrapperCollection &wrappers)
Definition: _defect.cc:56
void wrapImageUtils(lsst::utils::python::WrapperCollection &)
Definition: _imageUtils.cc:35
void wrapImagePca(lsst::utils::python::WrapperCollection &)
Definition: _imagePca.cc:73
void wrapColor(lsst::utils::python::WrapperCollection &wrappers)
Definition: _color.cc:40
void wrapTransmissionCurve(lsst::utils::python::WrapperCollection &)
void wrapCalib(lsst::utils::python::WrapperCollection &wrappers)
Definition: _calib.cc:69
void wrapPhotoCalib(lsst::utils::python::WrapperCollection &)
Definition: _photoCalib.cc:208
void wrapReaders(lsst::utils::python::WrapperCollection &)
Definition: _readers.cc:338

◆ PYBIND11_MODULE() [3/3]

lsst::afw::image::PYBIND11_MODULE ( _maskedImage  ,
mod   
)

Definition at line 244 of file _maskedImage.cc.

244  {
245  lsst::utils::python::WrapperCollection wrappers(mod, "lsst.afw.image.maskedImage");
246  wrappers.addSignatureDependency("lsst.afw.image.image");
247  wrappers.addInheritanceDependency("lsst.daf.base");
248 
249  auto clsMaskedImageF = declareMaskedImage<float>(wrappers, "F");
250  auto clsMaskedImageD = declareMaskedImage<double>(wrappers, "D");
251  auto clsMaskedImageI = declareMaskedImage<int>(wrappers, "I");
252  auto clsMaskedImageU = declareMaskedImage<std::uint16_t>(wrappers, "U");
253  auto clsMaskedImageL = declareMaskedImage<std::uint64_t>(wrappers, "L");
254 
255  // Declare constructors for casting all exposure types to to float and double
256  // (the only two types of casts that Python supports)
257  declareCastConstructor<int, float>(clsMaskedImageF);
258  declareCastConstructor<int, double>(clsMaskedImageD);
259  declareCastConstructor<float, double>(clsMaskedImageD);
260  declareCastConstructor<double, float>(clsMaskedImageF);
261  declareCastConstructor<std::uint16_t, float>(clsMaskedImageF);
262  declareCastConstructor<std::uint16_t, double>(clsMaskedImageD);
263  declareCastConstructor<std::uint64_t, float>(clsMaskedImageF);
264  declareCastConstructor<std::uint64_t, double>(clsMaskedImageD);
265 
266  /* Module level */
267  declareMakeMaskedImage<int>(wrappers);
268  declareMakeMaskedImage<float>(wrappers);
269  declareMakeMaskedImage<double>(wrappers);
270  declareMakeMaskedImage<std::uint16_t>(wrappers);
271  declareMakeMaskedImage<std::uint64_t>(wrappers);
272 
273  declareImagesOverlap<int, int>(wrappers);
274  declareImagesOverlap<int, float>(wrappers);
275  declareImagesOverlap<int, double>(wrappers);
276  declareImagesOverlap<int, std::uint16_t>(wrappers);
277  declareImagesOverlap<int, std::uint64_t>(wrappers);
278 
279  declareImagesOverlap<float, int>(wrappers);
280  declareImagesOverlap<float, float>(wrappers);
281  declareImagesOverlap<float, double>(wrappers);
282  declareImagesOverlap<float, std::uint16_t>(wrappers);
283  declareImagesOverlap<float, std::uint64_t>(wrappers);
284 
285  declareImagesOverlap<double, int>(wrappers);
286  declareImagesOverlap<double, float>(wrappers);
287  declareImagesOverlap<double, double>(wrappers);
288  declareImagesOverlap<double, std::uint16_t>(wrappers);
289  declareImagesOverlap<double, std::uint64_t>(wrappers);
290 
291  declareImagesOverlap<std::uint16_t, int>(wrappers);
292  declareImagesOverlap<std::uint16_t, float>(wrappers);
293  declareImagesOverlap<std::uint16_t, double>(wrappers);
294  declareImagesOverlap<std::uint16_t, std::uint16_t>(wrappers);
295  declareImagesOverlap<std::uint16_t, std::uint64_t>(wrappers);
296 
297  declareImagesOverlap<std::uint64_t, int>(wrappers);
298  declareImagesOverlap<std::uint64_t, float>(wrappers);
299  declareImagesOverlap<std::uint64_t, double>(wrappers);
300  declareImagesOverlap<std::uint64_t, std::uint16_t>(wrappers);
301  declareImagesOverlap<std::uint64_t, std::uint64_t>(wrappers);
302  wrappers.finish();
303 }

◆ swap() [1/4]

template<typename PixelT >
void lsst::afw::image::swap ( DecoratedImage< PixelT > &  a,
DecoratedImage< PixelT > &  b 
)

Definition at line 78 of file DecoratedImage.cc.

78  {
79  a.swap(b);
80 }
table::Key< int > b
table::Key< int > a

◆ swap() [2/4]

template<typename PixelT >
void lsst::afw::image::swap ( Image< PixelT > &  a,
Image< PixelT > &  b 
)

Definition at line 444 of file Image.cc.

444  {
445  a.swap(b);
446 }

◆ swap() [3/4]

template<typename PixelT >
void lsst::afw::image::swap ( ImageBase< PixelT > &  a,
ImageBase< PixelT > &  b 
)

Definition at line 243 of file Image.cc.

243  {
244  a.swap(b);
245 }

◆ swap() [4/4]

template<typename PixelT >
void lsst::afw::image::swap ( Mask< PixelT > &  a,
Mask< PixelT > &  b 
)

Definition at line 134 of file Mask.cc.

134  {
135  a.swap(b);
136 }

◆ wrapCalib()

void lsst::afw::image::wrapCalib ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 69 of file _calib.cc.

69  {
70  /* Module level */
71  declareCalib(wrappers);
72  declareVectorOperations<float>(wrappers);
73  declareVectorOperations<double>(wrappers);
74 }

◆ wrapCoaddInputs()

void lsst::afw::image::wrapCoaddInputs ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 42 of file _coaddInputs.cc.

42  {
43  wrappers.addInheritanceDependency("lsst.afw.typehandling");
44  wrappers.wrapType(PyCoaddInputs(wrappers.module, "CoaddInputs"), [](auto &mod, auto &cls) {
45  /* Constructors */
46  cls.def(py::init<>());
47  cls.def(py::init<table::Schema const &, table::Schema const &>(), "visitSchema"_a, "ccdSchema"_a);
48  cls.def(py::init<table::ExposureCatalog const &, table::ExposureCatalog const &>(), "visits"_a,
49  "ccds"_a);
50 
51  table::io::python::addPersistableMethods<CoaddInputs>(cls);
52 
53  /* Members */
54  cls.def_readwrite("visits", &CoaddInputs::visits);
55  cls.def_readwrite("ccds", &CoaddInputs::ccds);
56  cls.def("isPersistable", &CoaddInputs::isPersistable);
57  });
58 }
py::class_< CoaddInputs, std::shared_ptr< CoaddInputs >, typehandling::Storable > PyCoaddInputs
Definition: _coaddInputs.cc:40

◆ wrapColor()

void lsst::afw::image::wrapColor ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 40 of file _color.cc.

40  {
41  /* Module level */
42  wrappers.wrapType(PyColor(wrappers.module, "Color"), [](auto &mod, auto &cls) {
43  /* Constructors */
44  cls.def(py::init<double>(), "g_r"_a = std::numeric_limits<double>::quiet_NaN());
45 
46  /* Operators */
47  cls.def(
48  "__eq__", [](Color const &self, Color const &other) { return self == other; },
49  py::is_operator());
50  cls.def(
51  "__ne__", [](Color const &self, Color const &other) { return self != other; },
52  py::is_operator());
53 
54  /* Members */
55  cls.def("isIndeterminate", &Color::isIndeterminate);
56  cls.def("getLambdaEff", &Color::getLambdaEff, "filter"_a);
57  });
58 }
py::class_< Color, std::shared_ptr< Color > > PyColor
Definition: _color.cc:38
double getLambdaEff() const noexcept
Return the filter's effective wavelength (nm)
Definition: Filter.h:82

◆ wrapDefect()

void lsst::afw::image::wrapDefect ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 56 of file _defect.cc.

56  {
57  wrappers.addSignatureDependency("lsst.afw.geom");
58  declareDefects(wrappers);
59 }

◆ wrapExposure()

void lsst::afw::image::wrapExposure ( lsst::utils::python::WrapperCollection &  )

◆ wrapExposureInfo()

void lsst::afw::image::wrapExposureInfo ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 207 of file _exposureInfo.cc.

207  {
208  wrappers.addSignatureDependency("lsst.daf.base");
209  wrappers.addSignatureDependency("lsst.afw.geom");
210  wrappers.addSignatureDependency("lsst.afw.cameraGeom");
211  wrappers.addSignatureDependency("lsst.afw.detection"); // For Psf
212  declareExposureInfo(wrappers);
213 }

◆ wrapFilter()

void lsst::afw::image::wrapFilter ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 98 of file _filter.cc.

98  {
99  wrappers.addSignatureDependency("lsst.daf.base");
100  wrappers.addInheritanceDependency("lsst.afw.typehandling");
101  declareFilterProperty(wrappers);
102  declareFilter(wrappers);
103  wrappers.wrap(
104  [](auto &mod) { mod.def("stripFilterKeywords", &detail::stripFilterKeywords, "metadata"_a); });
105 }
int stripFilterKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Filter-related keywords from the metadata.
Definition: Filter.cc:130

◆ wrapFilterLabel()

void lsst::afw::image::wrapFilterLabel ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 116 of file _filterLabel.cc.

116  {
117  // import inheritance dependencies
118  wrappers.addInheritanceDependency("lsst.afw.typehandling");
119  declareFilterLabel(wrappers);
120  wrappers.wrap(
121  [](auto &mod) { mod.def("getDatabaseFilterLabel", &getDatabaseFilterLabel, "filterLabel"_a); });
122 }
std::string getDatabaseFilterLabel(std::string const &filterLabel)
Remap special characters, etc.
Definition: FilterLabel.cc:45

◆ wrapImage()

void lsst::afw::image::wrapImage ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 448 of file _image.cc.

448  {
449  wrappers.addSignatureDependency("lsst.daf.base");
450  wrappers.addSignatureDependency("lsst.geom");
451  wrappers.wrapType(py::enum_<ImageOrigin>(wrappers.module, "ImageOrigin"), [](auto &mod, auto &enm) {
452  enm.value("PARENT", ImageOrigin::PARENT);
453  enm.value("LOCAL", ImageOrigin::LOCAL);
454  enm.export_values();
455  });
456 
457  declareImageBase<int>(wrappers, "I");
458  declareImageBase<float>(wrappers, "F");
459  declareImageBase<double>(wrappers, "D");
460  declareImageBase<std::uint16_t>(wrappers, "U");
461  declareImageBase<std::uint64_t>(wrappers, "L");
462 
463  // Mask must be declared before Image because a mask is used as a default value in at least one method
464  declareMask<MaskPixel>(wrappers, "X");
465 
466  auto clsImageI = declareImage<int>(wrappers, "I");
467  auto clsImageF = declareImage<float>(wrappers, "F");
468  auto clsImageD = declareImage<double>(wrappers, "D");
469  auto clsImageU = declareImage<std::uint16_t>(wrappers, "U");
470  auto clsImageL = declareImage<std::uint64_t>(wrappers, "L");
471 
472  // Add generalized copy constructors
473  addGeneralizedCopyConstructors<int>(clsImageI);
474  addGeneralizedCopyConstructors<float>(clsImageF);
475  addGeneralizedCopyConstructors<double>(clsImageD);
476  addGeneralizedCopyConstructors<std::uint16_t>(clsImageU);
477  addGeneralizedCopyConstructors<std::uint64_t>(clsImageL);
478 
479  // Add slice operators only for float and double
480  addImageSliceOperators<float>(clsImageF);
481  addImageSliceOperators<double>(clsImageD);
482 
483  declareDecoratedImage<int>(wrappers, "I");
484  declareDecoratedImage<float>(wrappers, "F");
485  declareDecoratedImage<double>(wrappers, "D");
486  declareDecoratedImage<std::uint16_t>(wrappers, "U");
487  declareDecoratedImage<std::uint64_t>(wrappers, "L");
488 
489  // Declare constructors for casting all exposure types to to float and double
490  // (the only two types of casts that Python supports)
491  declareCastConstructor<int, float>(clsImageF);
492  declareCastConstructor<int, double>(clsImageD);
493 
494  declareCastConstructor<float, double>(clsImageD);
495 
496  declareCastConstructor<double, float>(clsImageF);
497 
498  declareCastConstructor<std::uint16_t, float>(clsImageF);
499  declareCastConstructor<std::uint16_t, double>(clsImageD);
500 
501  declareCastConstructor<std::uint64_t, float>(clsImageF);
502  declareCastConstructor<std::uint64_t, double>(clsImageD);
503 
504  // Note: wrap both the Image and MaskedImage versions of imagesOverlap in the MaskedImage wrapper,
505  // as wrapping the Image version here results in it being invisible in lsst.afw.image
506  wrappers.wrap([](auto &mod) { mod.def("bboxFromMetadata", &bboxFromMetadata); });
507 }
lsst::geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
Definition: Image.cc:682

◆ wrapImagePca()

void lsst::afw::image::wrapImagePca ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 73 of file _imagePca.cc.

73  {
74  declareImagePca<Image<int>>(wrappers, "I");
75  declareImagePca<Image<float>>(wrappers, "F");
76  declareImagePca<Image<double>>(wrappers, "D");
77  declareImagePca<Image<std::uint16_t>>(wrappers, "U");
78  declareImagePca<Image<std::uint64_t>>(wrappers, "L");
79  declareImagePca<MaskedImage<int>>(wrappers, "MI");
80  declareImagePca<MaskedImage<float>>(wrappers, "MF");
81  declareImagePca<MaskedImage<double>>(wrappers, "MD");
82  declareImagePca<MaskedImage<std::uint16_t>>(wrappers, "MU");
83  declareImagePca<MaskedImage<std::uint64_t>>(wrappers, "ML");
84 
85  declareInnerProduct<Image<int>, Image<int>>(wrappers);
86  declareInnerProduct<Image<float>, Image<float>>(wrappers);
87  declareInnerProduct<Image<double>, Image<double>>(wrappers);
88  declareInnerProduct<Image<std::uint16_t>, Image<std::uint16_t>>(wrappers);
89  declareInnerProduct<Image<std::uint64_t>, Image<std::uint64_t>>(wrappers);
90 
91  declareInnerProduct<Image<float>, Image<double>>(wrappers);
92  declareInnerProduct<Image<double>, Image<float>>(wrappers);
93 }

◆ wrapImageSlice()

void lsst::afw::image::wrapImageSlice ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 115 of file _imageSlice.cc.

115  {
116  declareImageSlice<float>(wrappers, "F");
117  declareImageSlice<double>(wrappers, "D");
118 }

◆ wrapImageUtils()

void lsst::afw::image::wrapImageUtils ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 35 of file _imageUtils.cc.

35  {
36  wrappers.wrap([](auto &mod) {
37  mod.def("indexToPosition", indexToPosition);
38  mod.def("positionToIndex", (int (*)(double))positionToIndex);
39  mod.def("positionToIndex", (std::pair<int, double>(*)(double const, bool))positionToIndex);
40  });
41 }
double indexToPosition(double ind)
Convert image index to image position.
Definition: ImageUtils.h:55
int positionToIndex(double pos)
Convert image position to nearest integer index.
Definition: ImageUtils.h:69

◆ wrapPhotoCalib()

void lsst::afw::image::wrapPhotoCalib ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 208 of file _photoCalib.cc.

208  {
209  wrappers.addInheritanceDependency("lsst.afw.typehandling");
210  declareMeasurement(wrappers);
211  declarePhotoCalib(wrappers);
212  declareCalib(wrappers);
213 }

◆ wrapReaders()

void lsst::afw::image::wrapReaders ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 338 of file _readers.cc.

338  {
339  // wrappers.addInheritanceDependency("lsst.daf.base");
340  wrappers.addSignatureDependency("lsst.geom");
341  wrappers.addSignatureDependency("lsst.afw.image.image");
342  wrappers.addSignatureDependency("lsst.afw.image.maskedImage");
343  wrappers.addSignatureDependency("lsst.afw.image.exposure");
344  declareImageFitsReader(wrappers);
345  declareMaskFitsReader(wrappers);
346  declareMaskedImageFitsReader(wrappers);
347  declareExposureFitsReader(wrappers);
348 }

◆ wrapTransmissionCurve()

void lsst::afw::image::wrapTransmissionCurve ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 46 of file _transmissionCurve.cc.

46  {
47  wrappers.addInheritanceDependency("lsst.afw.typehandling");
48  wrappers.addSignatureDependency("lsst.afw.geom");
49  wrappers.wrapType(PyTransmissionCurve(wrappers.module, "TransmissionCurve"), [](auto &mod, auto &cls) {
50  table::io::python::addPersistableMethods(cls);
51 
52  cls.def_static("makeIdentity", &TransmissionCurve::makeIdentity);
53  cls.def_static("makeSpatiallyConstant", &TransmissionCurve::makeSpatiallyConstant, "throughput"_a,
54  "wavelengths"_a, "throughputAtMin"_a = 0.0, "throughputAtMax"_a = 0.0);
55  cls.def_static("makeRadial", &TransmissionCurve::makeRadial, "throughput"_a, "wavelengths"_a,
56  "radii"_a, "throughputAtMin"_a = 0.0, "throughputAtMax"_a = 0.0);
57  cls.def("__mul__", &TransmissionCurve::multipliedBy, py::is_operator());
58  cls.def("multipliedBy", &TransmissionCurve::multipliedBy);
59  cls.def("transformedBy", &TransmissionCurve::transformedBy, "transform"_a);
60  cls.def("getWavelengthBounds", &TransmissionCurve::getWavelengthBounds);
61  cls.def("getThroughputAtBounds", &TransmissionCurve::getThroughputAtBounds);
62  cls.def("sampleAt",
63  (void (TransmissionCurve::*)(lsst::geom::Point2D const &,
64  ndarray::Array<double const, 1, 1> const &,
65  ndarray::Array<double, 1, 1> const &) const) &
66  TransmissionCurve::sampleAt,
67  "position"_a, "wavelengths"_a, "out"_a);
68  cls.def("sampleAt",
69  (ndarray::Array<double, 1, 1>(TransmissionCurve::*)(
70  lsst::geom::Point2D const &, ndarray::Array<double const, 1, 1> const &) const) &
71  TransmissionCurve::sampleAt,
72  "position"_a, "wavelengths"_a);
73  });
74 }
py::class_< TransmissionCurve, std::shared_ptr< TransmissionCurve >, typehandling::Storable > PyTransmissionCurve

◆ wrapVisitInfo()

void lsst::afw::image::wrapVisitInfo ( lsst::utils::python::WrapperCollection &  wrappers)

Definition at line 143 of file _visitInfo.cc.

143  {
144  wrappers.addInheritanceDependency("lsst.daf.base");
145  wrappers.addInheritanceDependency("lsst.geom");
146  wrappers.addInheritanceDependency("lsst.afw.coord");
147  wrappers.addInheritanceDependency("lsst.afw.typehandling");
148  declareRotType(wrappers);
149  declareVisitInfo(wrappers);
150  wrappers.wrap([](auto &mod) {
151  /* Free Functions */
152  mod.def("setVisitInfoMetadata", &detail::setVisitInfoMetadata, "metadata"_a, "visitInfo"_a);
153  mod.def("stripVisitInfoKeywords", &detail::stripVisitInfoKeywords, "metadata"_a);
154  });
155 }
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:339
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:356
void declareVisitInfo(lsst::utils::python::WrapperCollection &wrappers)
Definition: _visitInfo.cc:57
void declareRotType(lsst::utils::python::WrapperCollection &wrappers)
Definition: _visitInfo.cc:133

◆ write()

void lsst::afw::image::write ( OutputArchiveHandle &  handle) const
overrideprotected

Variable Documentation

◆ final

class Filter lsst::afw::image::final
Initial value:
{
public:
explicit FilterProperty(std::string const& name, double lambdaEff, double lambdaMin = NAN,
double lambdaMax = NAN, bool force = false)
: _name(name), _lambdaEff(lambdaEff), _lambdaMin(lambdaMin), _lambdaMax(lambdaMax) {
_insert(force);
}
explicit FilterProperty(std::string const& name,
bool force = false)
Class for storing generic metadata.
Definition: PropertySet.h:66
FilterProperty(FilterProperty &&) noexcept=default

Describe the properties of a Filter (e.g.

Holds an integer identifier for an LSST filter.

effective wavelength)

Definition at line 53 of file Filter.h.

◆ PixelZeroPos

const double lsst::afw::image::PixelZeroPos = 0.0

position of center of pixel 0

FITS uses 1.0, SDSS uses 0.5, LSST uses 0.0 (http://dev.lsstcorp.org/trac/wiki/BottomLeftPixelProposalII%3A)

Definition at line 44 of file ImageUtils.h.