LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
LSSTDataManagementBasePackage
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::afw::image Namespace Reference

Namespaces

 apCorrMap
 
 basicUtils
 
 detail
 
 details
 
 exposure
 
 image
 
 makeVisitInfo
 
 maskedImage
 
 pixel
 
 python
 
 SdssFilters
 
 slicing
 
 testUtils
 
 utils
 

Classes

class  ApCorrMap
 A thin wrapper around std::map to allow aperture corrections to be attached to Exposures. More...
 
class  Calib
 Describe an exposure's calibration. More...
 
class  CheckIndices
 A class used to request that array accesses be checked. 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...
 
struct  ConstReference
 metafunction to extract const reference type from PixelT More...
 
class  DecoratedImage
 A container for an Image and its associated metadata. 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  Filter
 Holds an integer identifier for an LSST filter. More...
 
class  FilterProperty
 Describe the properties of a Filter (e.g. More...
 
struct  GetImage
 
class  Image
 A class to represent a 2-dimensional array of pixels. 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  imageIterator
 An ImageBase iterator. More...
 
class  imageLocator
 An ImageBase locator. 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...
 
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...
 
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...
 
struct  Reference
 metafunction to extract reference type from PixelT 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

typedef std::int32_t MaskPixel
 default type for Masks and MaskedImage Masks More...
 
typedef float VariancePixel
 default type for MaskedImage variance images More...
 

Enumerations

enum  ImageOrigin { PARENT, LOCAL }
 
enum  xOrY { X, Y }
 
enum  RotType { RotType::UNKNOWN, RotType::SKY, RotType::HORIZON, RotType::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...
 
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...
 
void assertNonNegative (double value, std::string const &name)
 Raise lsst::pex::exceptions::InvalidParameterError if value is not >=0. More...
 
std::shared_ptr< PhotoCalibmakePhotoCalib (daf::base::PropertySet &metadata, bool strip=false)
 Construct a PhotoCalib from FITS FLUXMAG0/FLUXMAG0ERR keywords. More...
 
std::shared_ptr< daf::base::PropertyListreadMetadata (std::string const &fileName, int hdu=fits::DEFAULT_HDU, bool strip=false)
 Return the metadata (header entries) from a FITS file. More...
 
template<typename ImageT >
ImageT::SinglePixel badPixel (typename ImageT::Pixel bad=0)
 Return a value indicating a bad pixel for the given Image type. More...
 
std::ostreamoperator<< (std::ostream &os, VisitInfo const &visitInfo)
 
 PYBIND11_MODULE (imagePca, mod)
 
 PYBIND11_MODULE (maskedImage, mod)
 
 PYBIND11_MODULE (readMetadata, mod)
 
 PYBIND11_MODULE (visitInfo, 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)
 
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

const double PixelZeroPos = 0.0
 position of center of pixel 0 More...
 

Typedef Documentation

◆ MaskPixel

default type for Masks and MaskedImage Masks

Definition at line 34 of file LsstImageTypes.h.

◆ VariancePixel

default type for MaskedImage variance images

Definition at line 35 of file LsstImageTypes.h.

Enumeration Type Documentation

◆ ImageOrigin

Enumerator
PARENT 
LOCAL 

Definition at line 95 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 44 of file VisitInfo.h.

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

◆ xOrY

Enumerator

Definition at line 36 of file ImageUtils.h.

Function Documentation

◆ 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 61 of file Calib.h.

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

◆ abMagErrFromFluxErr() [2/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 66 of file Calib.cc.

67  {
68  if (flux.getNumElements() != fluxErr.getNumElements()) {
69  throw LSST_EXCEPT(pex::exceptions::LengthError, (boost::format("Length mismatch: %d vs %d") %
70  flux.getNumElements() % fluxErr.getNumElements())
71  .str());
72  }
73  ndarray::Array<T, 1> out = ndarray::allocate(flux.getShape());
74  for (std::size_t ii = 0; ii < flux.getNumElements(); ++ii) {
75  out[ii] = abMagErrFromFluxErr(fluxErr[ii], flux[ii]);
76  }
77  return out;
78 }
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:168
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ 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 ndarray::Array< double , 1> lsst::afw::image::abMagErrFromFluxErr ( ndarray::Array< double const, 1 > const &  fluxErr,
ndarray::Array< double const, 1 > const &  flux 
)

◆ abMagFromFlux() [1/4]

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

Compute AB magnitude from flux in Janskys.

Definition at line 58 of file Calib.h.

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

◆ abMagFromFlux() [2/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 56 of file Calib.cc.

56  {
57  ndarray::Array<T, 1> out = ndarray::allocate(flux.getShape());
58  for (std::size_t ii = 0; ii < flux.getNumElements(); ++ii) {
59  out[ii] = abMagFromFlux(flux[ii]);
60  }
61  return out;
62 }
template ndarray::Array< double, 1 > 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 ndarray::Array< double , 1> lsst::afw::image::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 66 of file PhotoCalib.h.

66  {
67  if (value < 0) {
69  (boost::format("%s must be positive: %.3g") % name % value).str());
70  }
71 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
Reports invalid arguments.
Definition: Runtime.h:66

◆ badPixel()

template<typename ImageT >
ImageT::SinglePixel badPixel ( typename ImageT::Pixel  bad = 0)

Return a value indicating a bad pixel for the given Image type.

A quiet NaN is returned for types that support it otherwise bad

Parameters
badThe bad value if NaN isn't supported

Definition at line 78 of file Utils.h.

80  {
81  typedef typename ImageT::SinglePixel SinglePixelT;
84  : bad);
85 }

◆ 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 703 of file Image.cc.

703  {
705  if (metadata.exists("ZNAXIS1") && metadata.exists("ZNAXIS2")) {
706  dims = lsst::geom::Extent2I(metadata.getAsInt("ZNAXIS1"), metadata.getAsInt("ZNAXIS2"));
707  } else {
708  dims = lsst::geom::Extent2I(metadata.getAsInt("NAXIS1"), metadata.getAsInt("NAXIS2"));
709  }
711  return lsst::geom::Box2I(xy0, dims);
712 }
Extent< int, 2 > Extent2I
Definition: Extent.h:397
lsst::geom::Point2I getImageXY0FromMetadata(daf::base::PropertySet &metadata, std::string const &wcsName, bool strip=false)
Definition: wcsUtils.cc:98
An integer coordinate rectangle.
Definition: Box.h:54
std::string const wcsNameForXY0
Definition: ImageBase.h:71

◆ 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 69 of file Calib.h.

69  {
70  return std::abs(-0.4 * magErr * fluxFromABMag(mag) * std::log(10.0));
71 }
ndarray::Array< T, 1 > fluxFromABMag(ndarray::Array< T const, 1 > const &mag)
Compute flux in Janskys from AB magnitude.
Definition: Calib.cc:82
Angle abs(Angle const &a)
Definition: Angle.h:106
T log(T... args)

◆ fluxErrFromABMagErr() [2/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 92 of file Calib.cc.

93  {
94  if (mag.getNumElements() != magErr.getNumElements()) {
95  throw LSST_EXCEPT(pex::exceptions::LengthError, (boost::format("Length mismatch: %d vs %d") %
96  mag.getNumElements() % magErr.getNumElements())
97  .str());
98  }
99  ndarray::Array<T, 1> out = ndarray::allocate(mag.getShape());
100  for (std::size_t ii = 0; ii < mag.getNumElements(); ++ii) {
101  out[ii] = fluxErrFromABMagErr(magErr[ii], mag[ii]);
102  }
103  return out;
104 }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
template ndarray::Array< double, 1 > fluxErrFromABMagErr(ndarray::Array< double const, 1 > const &magErr, ndarray::Array< double const, 1 > const &mag)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ 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 ndarray::Array< double , 1> lsst::afw::image::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 66 of file Calib.h.

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

◆ fluxFromABMag() [2/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 82 of file Calib.cc.

82  {
83  ndarray::Array<T, 1> out = ndarray::allocate(mag.getShape());
84  for (std::size_t ii = 0; ii < mag.getNumElements(); ++ii) {
85  out[ii] = fluxFromABMag(mag[ii]);
86  }
87  return out;
88 }
template ndarray::Array< double, 1 > 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 ndarray::Array< double , 1> lsst::afw::image::fluxFromABMag ( ndarray::Array< double const, 1 > const &  mag)

◆ for_each_pixel() [1/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 98 of file ImageAlgorithm.h.

100  {
101  for (int y = 0; y != lhs.getHeight(); ++y) {
102  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
103  lhsPtr != lhsEnd; ++lhsPtr) {
104  *lhsPtr = func();
105  }
106  }
107 }
int y
Definition: SpanSet.cc:49

◆ for_each_pixel() [2/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 113 of file ImageAlgorithm.h.

115  {
116  for (int y = 0; y != lhs.getHeight(); ++y) {
117  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
118  lhsPtr != lhsEnd; ++lhsPtr) {
119  *lhsPtr = func(*lhsPtr);
120  }
121  }
122 }
int y
Definition: SpanSet.cc:49

◆ for_each_pixel() [3/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 130 of file ImageAlgorithm.h.

132  {
133  for (int y = 0; y != lhs.getHeight(); ++y) {
134  int x = lhs.getX0();
135  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
136  lhsPtr != lhsEnd; ++lhsPtr, ++x) {
137  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr);
138  }
139  }
140 }
int y
Definition: SpanSet.cc:49
double x

◆ for_each_pixel() [4/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 146 of file ImageAlgorithm.h.

149  {
150  if (lhs.getDimensions() != rhs.getDimensions()) {
152  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
153  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
154  .str());
155  }
156 
157  for (int y = 0; y != lhs.getHeight(); ++y) {
158  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
159 
160  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
161  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
162  *lhsPtr = func(*rhsPtr);
163  }
164  }
165 }
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
int y
Definition: SpanSet.cc:49
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ for_each_pixel() [5/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 171 of file ImageAlgorithm.h.

174  {
175  if (lhs.getDimensions() != rhs.getDimensions()) {
177  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
178  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
179  .str());
180  }
181 
182  for (int y = 0; y != lhs.getHeight(); ++y) {
183  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
184 
185  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
186  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
187  *lhsPtr = func(*lhsPtr, *rhsPtr);
188  }
189  }
190 }
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
int y
Definition: SpanSet.cc:49
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ for_each_pixel() [6/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 197 of file ImageAlgorithm.h.

200  {
201  if (lhs.getDimensions() != rhs.getDimensions()) {
203  (boost::format("Images are of different size, %dx%d v %dx%d") % lhs.getWidth() %
204  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
205  .str());
206  }
207 
208  for (int y = 0; y != lhs.getHeight(); ++y) {
209  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
210  int x = lhs.getX0();
211  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
212  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr, ++x) {
213  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr, *rhsPtr);
214  }
215  }
216 }
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
int y
Definition: SpanSet.cc:49
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
double x
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ 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 715 of file Image.cc.

715  {
716  auto arr1 = image1.getArray();
717  // get the address of the first and one-past-the-last element of arr1 using ndarray iterators;
718  // this works because the iterators for contiguous 1-d ndarray Arrays are just pointers
719  auto beg1Addr = arr1.front().begin();
720  auto end1Addr = arr1.back().end();
721 
722  auto arr2 = image2.getArray();
723  auto beg2Addr = arr2.front().begin();
724  auto end2Addr = arr2.back().end();
725 
726  auto ptrLess = std::less<void const* const>();
727  return ptrLess(beg1Addr, end2Addr) && ptrLess(beg2Addr, end1Addr);
728 }

◆ 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 679 of file MaskedImage.cc.

680  {
681  return imagesOverlap(*image1.getImage(), *image2.getImage()) ||
682  imagesOverlap(*image1.getVariance(), *image2.getVariance()) ||
683  imagesOverlap(*image1.getMask(), *image2.getMask());
684 }
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:715

◆ 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 415 of file ImagePca.cc.

415  {
416  if (lhs.getWidth() <= 2 * border || lhs.getHeight() <= 2 * border) {
418  (boost::format("All image pixels are in the border of width %d: %dx%d") % border %
419  lhs.getWidth() % lhs.getHeight())
420  .str());
421  }
422 
423  double sum = 0.0;
424  //
425  // Handle I.I specially for efficiency, and to avoid advancing the iterator twice
426  //
427  if (imagesAreIdentical(lhs, rhs)) {
428  for (int y = border; y != lhs.getHeight() - border; ++y) {
429  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
430  lend = lhs.row_end(y) - border;
431  lptr != lend; ++lptr) {
432  typename Image1T::Pixel val = *lptr;
433  if (std::isfinite(val)) {
434  sum += val * val;
435  }
436  }
437  }
438  } else {
439  if (lhs.getDimensions() != rhs.getDimensions()) {
441  (boost::format("Dimension mismatch: %dx%d v. %dx%d") % lhs.getWidth() %
442  lhs.getHeight() % rhs.getWidth() % rhs.getHeight())
443  .str());
444  }
445 
446  for (int y = border; y != lhs.getHeight() - border; ++y) {
447  typename Image2T::const_x_iterator rptr = rhs.row_begin(y) + border;
448  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
449  lend = lhs.row_end(y) - border;
450  lptr != lend; ++lptr, ++rptr) {
451  double const tmp = (*lptr) * (*rptr);
452  if (std::isfinite(tmp)) {
453  sum += tmp;
454  }
455  }
456  }
457  }
458 
459  return sum;
460 }
float Pixel
Typedefs to be used for pixel values.
Definition: common.h:37
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
int y
Definition: SpanSet.cc:49
ImageT val
Definition: CR.cc:146
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:168
T isfinite(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ 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 446 of file Exposure.h.

450  {
452  new Exposure<ImagePixelT, MaskPixelT, VariancePixelT>(mimage, wcs));
453 }
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71

◆ 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 1280 of file MaskedImage.h.

1284  {
1285  return new MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(image, mask, variance);
1286 }
afw::table::Key< afw::table::Array< VariancePixelT > > variance
afw::table::Key< afw::table::Array< MaskPixelT > > mask
afw::table::Key< afw::table::Array< ImagePixelT > > image

◆ makePhotoCalib()

std::shared_ptr< PhotoCalib > lsst::afw::image::makePhotoCalib ( 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 397 of file PhotoCalib.cc.

397  {
398  double calibration = 0.0, calibrationErr = 0.0;
399 
400  auto key = "FLUXMAG0";
401  if (metadata.exists(key)) {
402  double fluxMag0 = metadata.getAsDouble(key);
403  if (strip) metadata.remove(key);
404 
405  calibration = utils::referenceFlux / fluxMag0;
406  key = "FLUXMAG0ERR";
407  if (metadata.exists(key)) {
408  double fluxMag0Err = metadata.getAsDouble(key);
409  calibrationErr = utils::referenceFlux * fluxMag0Err / std::pow(fluxMag0, 2);
410  if (strip) metadata.remove(key);
411  }
412  } else {
413  return nullptr;
414  }
415 
416  return std::make_shared<PhotoCalib>(calibration, calibrationErr);
417 }
Key< U > key
Definition: Schema.cc:281
T pow(T... args)
table::Key< double > fluxMag0
Definition: Calib.cc:378
const double referenceFlux
The Oke & Gunn (1983) AB magnitude reference flux, in nJy (often approximated as 3631.0).
Definition: Magnitude.h:46
table::Key< double > fluxMag0Err
Definition: Calib.cc:379
bool strip
Definition: fits.cc:831
table::Key< double > calibrationErr
Definition: PhotoCalib.cc:269

◆ 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 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*=() [2/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 692 of file Image.cc.

692  {
693  for_each_pixel(lhs, rhs, timesEq<LhsPixelT, RhsPixelT>());
694  return lhs;
695 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()

◆ 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 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+=() [2/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 680 of file Image.cc.

680  {
681  for_each_pixel(lhs, rhs, plusEq<LhsPixelT, RhsPixelT>());
682  return lhs;
683 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()

◆ 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 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-=() [2/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 686 of file Image.cc.

686  {
687  for_each_pixel(lhs, rhs, minusEq<LhsPixelT, RhsPixelT>());
688  return lhs;
689 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()

◆ 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 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/=() [2/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 698 of file Image.cc.

698  {
699  for_each_pixel(lhs, rhs, divideEq<LhsPixelT, RhsPixelT>());
700  return lhs;
701 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()

◆ operator<<() [1/2]

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

Definition at line 448 of file VisitInfo.cc.

448  {
449  os << "VisitInfo(";
450  os << "exposureId=" << visitInfo.getExposureId() << ", ";
451  os << "exposureTime=" << visitInfo.getExposureTime() << ", ";
452  os << "darkTime=" << visitInfo.getDarkTime() << ", ";
453  os << "date=" << visitInfo.getDate().toString(daf::base::DateTime::TAI) << ", ";
454  os << "UT1=" << visitInfo.getUt1() << ", ";
455  os << "ERA=" << visitInfo.getEra() << ", ";
456  os << "boresightRaDec=" << visitInfo.getBoresightRaDec() << ", ";
457  os << "boresightAzAlt=" << visitInfo.getBoresightAzAlt() << ", ";
458  os << "boresightAirmass=" << visitInfo.getBoresightAirmass() << ", ";
459  os << "boresightRotAngle=" << visitInfo.getBoresightRotAngle() << ", ";
460  os << "rotType=" << static_cast<int>(visitInfo.getRotType()) << ", ";
461  os << "observatory=" << visitInfo.getObservatory() << ", ";
462  os << "weather=" << visitInfo.getWeather();
463  os << ")";
464  return os;
465 }
std::ostream * os
Definition: Schema.cc:746

◆ operator<<() [2/2]

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

Definition at line 231 of file PhotoCalib.cc.

231  {
232  if (photoCalib._isConstant)
233  os << "spatially constant with ";
234  else
235  os << *(photoCalib._calibration) << " with ";
236  return os << "mean: " << photoCalib._calibrationMean << " error: " << photoCalib._calibrationErr;
237 }

◆ positionToIndex() [1/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 }
T floor(T... args)
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:44

◆ positionToIndex() [2/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)
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:44

◆ positionToIndex() [3/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

◆ PYBIND11_MODULE() [1/4]

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

Definition at line 34 of file readMetadata.cc.

34  { // wraps code in Utils.h, but there's an unrelated utils.py
35  /* Module level */
36  mod.def("readMetadata", readMetadata, "fileName"_a, "hdu"_a = fits::DEFAULT_HDU, "strip"_a = false);
37 }
const int DEFAULT_HDU
Specify that the default HDU should be read.
Definition: fitsDefaults.h:18

◆ PYBIND11_MODULE() [2/4]

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

Definition at line 54 of file visitInfo.cc.

54  {
55  py::module::import("lsst.daf.base");
56  py::module::import("lsst.geom");
57  py::module::import("lsst.afw.coord.observatory");
58  py::module::import("lsst.afw.coord.weather");
59 
60  /* Module level */
61  py::class_<VisitInfo, std::shared_ptr<VisitInfo>> cls(mod, "VisitInfo");
62 
63  /* Member types and enums */
64  py::enum_<RotType>(mod, "RotType")
65  .value("UNKNOWN", RotType::UNKNOWN)
66  .value("SKY", RotType::SKY)
67  .value("HORIZON", RotType::HORIZON)
68  .value("MOUNT", RotType::MOUNT)
69  .export_values();
70 
71  /* Constructors */
72  cls.def(py::init<table::RecordId, double, double, daf::base::DateTime const &, double,
73  lsst::geom::Angle const &, lsst::geom::SpherePoint const &, lsst::geom::SpherePoint const &, double,
74  lsst::geom::Angle const &, RotType const &, coord::Observatory const &,
75  coord::Weather const &>(),
76  "exposureId"_a = 0, "exposureTime"_a = nan, "darkTime"_a = nan, "date"_a = daf::base::DateTime(),
77  "ut1"_a = nan, "era"_a = nanAngle, "boresightRaDec"_a = lsst::geom::SpherePoint(nanAngle, nanAngle),
78  "boresightAzAlt"_a = lsst::geom::SpherePoint(nanAngle, nanAngle), "boresightAirmass"_a = nan,
79  "boresightRotAngle"_a = nanAngle, "rotType"_a = RotType::UNKNOWN,
80  "observatory"_a = coord::Observatory(nanAngle, nanAngle, nan),
81  "weather"_a = coord::Weather(nan, nan, nan));
82  cls.def(py::init<daf::base::PropertySet const &>(), "metadata"_a);
83  cls.def(py::init<VisitInfo const &>(), "visitInfo"_a);
84 
85  table::io::python::addPersistableMethods<VisitInfo>(cls);
86 
87  /* Operators */
88  cls.def("__eq__", [](VisitInfo const &self, VisitInfo const &other) { return self == other; },
89  py::is_operator());
90  cls.def("__ne__", [](VisitInfo const &self, VisitInfo const &other) { return self != other; },
91  py::is_operator());
92 
93  /* Members */
94  cls.def("getExposureId", &VisitInfo::getExposureId);
95  cls.def("getExposureTime", &VisitInfo::getExposureTime);
96  cls.def("getDarkTime", &VisitInfo::getDarkTime);
97  cls.def("getDate", &VisitInfo::getDate);
98  cls.def("getUt1", &VisitInfo::getUt1);
99  cls.def("getEra", &VisitInfo::getEra);
100  cls.def("getBoresightRaDec", &VisitInfo::getBoresightRaDec);
101  cls.def("getBoresightAzAlt", &VisitInfo::getBoresightAzAlt);
102  cls.def("getBoresightAirmass", &VisitInfo::getBoresightAirmass);
103  cls.def("getBoresightParAngle", &VisitInfo::getBoresightParAngle);
104  cls.def("getBoresightRotAngle", &VisitInfo::getBoresightRotAngle);
105  cls.def("getRotType", &VisitInfo::getRotType);
106  cls.def("getObservatory", &VisitInfo::getObservatory);
107  cls.def("getWeather", &VisitInfo::getWeather);
108  cls.def("isPersistable", &VisitInfo::isPersistable);
109  cls.def("getLocalEra", &VisitInfo::getLocalEra);
110  cls.def("getBoresightHourAngle", &VisitInfo::getBoresightHourAngle);
111 
112  utils::python::addOutputOp(cls, "__str__");
113 
114  /* Free Functions */
115  mod.def("setVisitInfoMetadata", &detail::setVisitInfoMetadata, "metadata"_a, "visitInfo"_a);
116  mod.def("stripVisitInfoKeywords", &detail::stripVisitInfoKeywords, "metadata"_a);
117 }
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:22
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
Definition: python.h:87
RotType
Type of rotation.
Definition: VisitInfo.h:44
def init()
Definition: tests.py:75
A class representing an angle.
Definition: Angle.h:127
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:283
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:57
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:267
ItemVariant const * other
Definition: Schema.cc:56

◆ PYBIND11_MODULE() [3/4]

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

Definition at line 63 of file imagePca.cc.

63  {
64  declareImagePca<Image<int>>(mod, "I");
65  declareImagePca<Image<float>>(mod, "F");
66  declareImagePca<Image<double>>(mod, "D");
67  declareImagePca<Image<std::uint16_t>>(mod, "U");
68  declareImagePca<Image<std::uint64_t>>(mod, "L");
69  declareImagePca<MaskedImage<int>>(mod, "MI");
70  declareImagePca<MaskedImage<float>>(mod, "MF");
71  declareImagePca<MaskedImage<double>>(mod, "MD");
72  declareImagePca<MaskedImage<std::uint16_t>>(mod, "MU");
73  declareImagePca<MaskedImage<std::uint64_t>>(mod, "ML");
74 
75  declareInnerProduct<Image<int>, Image<int>>(mod);
76  declareInnerProduct<Image<float>, Image<float>>(mod);
77  declareInnerProduct<Image<double>, Image<double>>(mod);
78  declareInnerProduct<Image<std::uint16_t>, Image<std::uint16_t>>(mod);
79  declareInnerProduct<Image<std::uint64_t>, Image<std::uint64_t>>(mod);
80 
81  declareInnerProduct<Image<float>, Image<double>>(mod);
82  declareInnerProduct<Image<double>, Image<float>>(mod);
83 }

◆ PYBIND11_MODULE() [4/4]

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

Definition at line 227 of file maskedImage.cc.

227  {
228  py::module::import("lsst.afw.image.image");
229 
230  auto clsMaskedImageF = declareMaskedImage<float>(mod, "F");
231  auto clsMaskedImageD = declareMaskedImage<double>(mod, "D");
232  auto clsMaskedImageI = declareMaskedImage<int>(mod, "I");
233  auto clsMaskedImageU = declareMaskedImage<std::uint16_t>(mod, "U");
234  auto clsMaskedImageL = declareMaskedImage<std::uint64_t>(mod, "L");
235 
236  // Declare constructors for casting all exposure types to to float and double
237  // (the only two types of casts that Python supports)
238  declareCastConstructor<int, float>(clsMaskedImageF);
239  declareCastConstructor<int, double>(clsMaskedImageD);
240  declareCastConstructor<float, double>(clsMaskedImageD);
241  declareCastConstructor<double, float>(clsMaskedImageF);
242  declareCastConstructor<std::uint16_t, float>(clsMaskedImageF);
243  declareCastConstructor<std::uint16_t, double>(clsMaskedImageD);
244  declareCastConstructor<std::uint64_t, float>(clsMaskedImageF);
245  declareCastConstructor<std::uint64_t, double>(clsMaskedImageD);
246 
247  /* Module level */
248  declareMakeMaskedImage<int>(mod);
249  declareMakeMaskedImage<float>(mod);
250  declareMakeMaskedImage<double>(mod);
251  declareMakeMaskedImage<std::uint16_t>(mod);
252  declareMakeMaskedImage<std::uint64_t>(mod);
253 
254  declareImagesOverlap<int, int>(mod);
255  declareImagesOverlap<int, float>(mod);
256  declareImagesOverlap<int, double>(mod);
257  declareImagesOverlap<int, std::uint16_t>(mod);
258  declareImagesOverlap<int, std::uint64_t>(mod);
259 
260  declareImagesOverlap<float, int>(mod);
261  declareImagesOverlap<float, float>(mod);
262  declareImagesOverlap<float, double>(mod);
263  declareImagesOverlap<float, std::uint16_t>(mod);
264  declareImagesOverlap<float, std::uint64_t>(mod);
265 
266  declareImagesOverlap<double, int>(mod);
267  declareImagesOverlap<double, float>(mod);
268  declareImagesOverlap<double, double>(mod);
269  declareImagesOverlap<double, std::uint16_t>(mod);
270  declareImagesOverlap<double, std::uint64_t>(mod);
271 
272  declareImagesOverlap<std::uint16_t, int>(mod);
273  declareImagesOverlap<std::uint16_t, float>(mod);
274  declareImagesOverlap<std::uint16_t, double>(mod);
275  declareImagesOverlap<std::uint16_t, std::uint16_t>(mod);
276  declareImagesOverlap<std::uint16_t, std::uint64_t>(mod);
277 
278  declareImagesOverlap<std::uint64_t, int>(mod);
279  declareImagesOverlap<std::uint64_t, float>(mod);
280  declareImagesOverlap<std::uint64_t, double>(mod);
281  declareImagesOverlap<std::uint64_t, std::uint16_t>(mod);
282  declareImagesOverlap<std::uint64_t, std::uint64_t>(mod);
283 }

◆ readMetadata()

std::shared_ptr<daf::base::PropertyList> lsst::afw::image::readMetadata ( std::string const &  fileName,
int  hdu = fits::DEFAULT_HDU,
bool  strip = false 
)
inline

Return the metadata (header entries) from a FITS file.

Deprecated:
Use lsst::afw::fits::readMetadata instead.
Parameters
[in]fileNameFile to read.
[in]hduHDU to read, 0-indexed. The special value of afw::fits::DEFAULT_HDU will read the first non-empty HDU.
[in]stripIf true, ignore special header keys usually managed by cfitsio (e.g. NAXIS).

Definition at line 64 of file Utils.h.

66  {
67  return afw::fits::readMetadata(fileName, hdu, strip);
68 }
std::shared_ptr< daf::base::PropertyList > readMetadata(std::string const &fileName, int hdu=fits::DEFAULT_HDU, bool strip=false)
Return the metadata (header entries) from a FITS file.
Definition: Utils.h:64
bool strip
Definition: fits.cc:831

◆ swap() [1/4]

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

Definition at line 465 of file Image.cc.

465  {
466  a.swap(b);
467 }
table::Key< int > b
table::Key< int > a

◆ swap() [2/4]

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

Definition at line 261 of file Image.cc.

261  {
262  a.swap(b);
263 }
table::Key< int > b
table::Key< int > a

◆ swap() [3/4]

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

Definition at line 86 of file DecoratedImage.cc.

86  {
87  a.swap(b);
88 }
table::Key< int > b
table::Key< int > a

◆ swap() [4/4]

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

Definition at line 144 of file Mask.cc.

144  {
145  a.swap(b);
146 }
table::Key< int > b
table::Key< int > a

Variable Documentation

◆ 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.