LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::afw::image Namespace Reference

Namespaces

 basicUtils
 
 detail
 
 details
 
 makeVisitInfo
 
 pixel
 
 SdssFilters
 
 testUtils
 
 utils
 

Classes

class  WcsFactory
 
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  Calib
 Describe an exposure's calibration. 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  DistortedTanWcs
 Combination of a TAN WCS and a distortion model. More...
 
class  Exposure
 A class to contain the data, WCS, and other information needed to describe an image of the sky. More...
 
class  ExposureInfo
 A collection of all the things that make an Exposure different from a MaskedImage. More...
 
class  FilterProperty
 Describe the properties of a Filter (e.g. More...
 
class  Filter
 Holds an integer identifier for an LSST filter. 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  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 tr1::function<ValT ()>, but with a virtual operator() More...
 
struct  pixelOp1
 A functor class equivalent to tr1::function<ValT (ValT)>, but with a virtual operator() More...
 
struct  pixelOp1XY
 A functor class equivalent to tr1::function<ValT (int, int, ValT)>, but with a virtual operator() More...
 
struct  pixelOp2
 A functor class equivalent to tr1::function<LhsT (LhsT, RhsT)>, but with a virtual operator() More...
 
struct  pixelOp2XY
 A functor class equivalent to tr1::function<LhsT (int, int, LhsT, RhsT)>, but with a virtual operator() 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  TanWcs
 Implementation of the WCS standard for the special case of the Gnomonic (tangent plane) projection. More...
 
class  VisitInfo
 Information about a single exposure of an imaging camera. More...
 
class  Wcs
 Implementation of the WCS standard for a any projection. More...
 
class  XYTransformFromWcsPair
 XYTransformFromWcsPair: An XYTransform obtained by putting two Wcs objects "back to back". More...
 

Typedefs

typedef std::uint16_t MaskPixel
 
typedef float VariancePixel
 ! default type for Masks and MaskedImage Masks 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

template<typename Image1T , typename Image2T >
double innerProduct (Image1T const &lhs, Image2T const &rhs, int border)
 Calculate the inner product of two images. More...
 
template<typename PixelT >
void swap (Mask< PixelT > &a, Mask< PixelT > &b)
 
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)
 Compute flux in Janskys from AB magnitude. More...
 
double fluxErrFromABMagErr (double magErr, double mag)
 Compute flux error in Janskys from AB magnitude error and AB magnitude. More...
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
Exposure< ImagePixelT,
MaskPixelT, VariancePixelT >
::Ptr 
makeExposure (MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())
 A function to return an Exposure of the correct type (cf. More...
 
template<typename PixelT >
void fits_read_array (fits::Fits &fitsfile, ndarray::Array< PixelT, 2, 2 > &array, geom::Point2I &xy0, lsst::daf::base::PropertySet &metadata, geom::Box2I bbox=geom::Box2I(), ImageOrigin origin=PARENT)
 
template<typename ImageT >
void fits_write_image (fits::Fits &fitsfile, const ImageT &image, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >())
 
template<typename supported_fits_types , typename ImageT >
void fits_read_image (fits::Fits &fitsfile, ImageT &img, lsst::daf::base::PropertySet &metadata, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin const origin=PARENT)
 
template<typename supported_fits_types , typename ImageT >
void fits_read_image (fits::Fits &fitsfile, ImageT &img, boost::shared_ptr< lsst::daf::base::PropertySet > metadata=boost::shared_ptr< lsst::daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin const origin=PARENT)
 
template<typename PixelT >
void swap (ImageBase< PixelT > &a, ImageBase< PixelT > &b)
 
template<typename LhsPixelT , typename RhsPixelT >
void operator+= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Add lhs to Image rhs (i.e. More...
 
template<typename LhsPixelT , typename RhsPixelT >
void operator-= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Subtract lhs from Image rhs (i.e. More...
 
template<typename LhsPixelT , typename RhsPixelT >
void operator*= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Multiply lhs by Image rhs (i.e. More...
 
template<typename LhsPixelT , typename RhsPixelT >
void operator/= (Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
 Divide lhs by Image rhs (i.e. More...
 
template<typename PixelT >
void swap (Image< PixelT > &a, Image< PixelT > &b)
 
template<typename PixelT >
void swap (DecoratedImage< PixelT > &a, DecoratedImage< PixelT > &b)
 
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 >
Image< PixelT >::Ptr operator+ (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 
template<typename PixelT >
Image< PixelT >::Ptr operator+ (ImageSlice< PixelT > const &slc, Image< PixelT > const &img)
 
template<typename PixelT >
void operator+= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator+=() More...
 
template<typename PixelT >
Image< PixelT >::Ptr operator- (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 
template<typename PixelT >
void operator-= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator-=() More...
 
template<typename PixelT >
Image< PixelT >::Ptr operator* (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 
template<typename PixelT >
Image< PixelT >::Ptr operator* (ImageSlice< PixelT > const &slc, Image< PixelT > const &img)
 
template<typename PixelT >
void operator*= (Image< PixelT > &img, ImageSlice< PixelT > const &slc)
 Overload operator*=() More...
 
template<typename PixelT >
Image< PixelT >::Ptr operator/ (Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
 
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 ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT,
MaskPixelT, VariancePixelT > * 
makeMaskedImage (typename Image< ImagePixelT >::Ptr image, typename Mask< MaskPixelT >::Ptr mask=typename Mask< MaskPixelT >::Ptr(), typename Image< VariancePixelT >::Ptr variance=typename Image< VariancePixelT >::Ptr())
 A function to return a MaskedImage of the correct type (cf. More...
 
boost::shared_ptr
< daf::base::PropertyList
readMetadata (std::string const &fileName, int hdu=0, bool strip=false)
 Return the metadata (header entries) from a FITS file. More...
 
boost::shared_ptr< WcsmakeWcs (boost::shared_ptr< lsst::daf::base::PropertySet > const &fitsMetadata, bool stripMetadata=false)
 Create a Wcs object from a fits header. More...
 
boost::shared_ptr< WcsmakeWcs (coord::Coord const &crval, geom::Point2D const &crpix, double CD11, double CD12, double CD21, double CD22)
 Create a Wcs object from crval, crpix, CD, using CD elements (useful from python) More...
 

Variables

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

Typedef Documentation

typedef std::uint16_t lsst::afw::image::MaskPixel

Definition at line 33 of file LsstImageTypes.h.

! default type for Masks and MaskedImage Masks

Definition at line 34 of file LsstImageTypes.h.

Enumeration Type Documentation

Enumerator
PARENT 
LOCAL 

Definition at line 106 of file Image.h.

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 

Orientation of E,N with respected to detector X,Y; X is flipped, if necessary, to match the handedness of E,N.

HORIZON 

orientation of Az/Alt with respect to detector X,Y; X is flipped, if necessary, to match the handedness of Az,Alt.

MOUNT 

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

Definition at line 42 of file VisitInfo.h.

42  {
43  UNKNOWN,
44  SKY,
46  HORIZON,
48  MOUNT
50 };
Orientation of E,N with respected to detector X,Y; X is flipped, if necessary, to match the handednes...
orientation of Az/Alt with respect to detector X,Y; X is flipped, if necessary, to match the handedne...
The position sent to the instrument rotator; the details depend on the rotator.
Enumerator
X 
Y 

Definition at line 40 of file ImageUtils.h.

Function Documentation

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

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

Definition at line 64 of file Calib.h.

64  {
65  return std::abs(fluxErr/(-0.4*flux*std::log(10)));
66 }
def log
Definition: log.py:83
double lsst::afw::image::abMagFromFlux ( double  flux)
inline

Compute AB magnitude from flux in Janskys.

Definition at line 59 of file Calib.h.

59  {
60  return -2.5*std::log10(flux/JanskysPerABFlux);
61 }
template<typename PixelT >
void lsst::afw::image::fits_read_array ( fits::Fits &  fitsfile,
ndarray::Array< PixelT, 2, 2 > &  array,
geom::Point2I xy0,
lsst::daf::base::PropertySet metadata,
geom::Box2I  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT 
)
inline

Definition at line 39 of file fits_io.h.

46  {
47  if (!fitsfile.checkImageType<PixelT>()) {
48  throw LSST_FITS_EXCEPT(
49  fits::FitsTypeError,
50  fitsfile,
51  "Incorrect image type for FITS image"
52  );
53  }
54  int nAxis = fitsfile.getImageDim();
55  ndarray::Vector<ndarray::Size,2> shape;
56  if (nAxis == 2) {
57  shape = fitsfile.getImageShape<2>();
58  } else if (nAxis == 3) {
59  ndarray::Vector<ndarray::Size,3> shape3 = fitsfile.getImageShape<3>();
60  if (shape3[0] != 1) {
61  throw LSST_EXCEPT(
62  fits::FitsError,
63  boost::str(boost::format("3rd dimension %d is not 1") % shape3[0])
64  );
65  }
66  shape = shape3.last<2>();
67  }
68 
69  fitsfile.readMetadata(metadata, true);
70 
71  // Origin of part of image to read
72  xy0 = geom::Point2I();
73 
75  geom::Extent2I dimensions = geom::Extent2I(shape[1], shape[0]);
76 
77  if (!bbox.isEmpty()) {
78  if (origin == PARENT) {
79  bbox.shift(-xyOffset);
80  }
81  xy0 = bbox.getMin();
82 
83  if (bbox.getMinX() < 0 || bbox.getMinY() < 0 ||
84  bbox.getWidth() > dimensions.getX() || bbox.getHeight() > dimensions.getY()
85  ) {
86  throw LSST_EXCEPT(
87  lsst::pex::exceptions::LengthError,
88  (boost::format("BBox (%d,%d) %dx%d doesn't fit in image %dx%d") %
89  bbox.getMinX() % bbox.getMinY() % bbox.getWidth() % bbox.getHeight() %
90  dimensions.getX() % dimensions.getY()).str()
91  );
92  }
93  dimensions = bbox.getDimensions();
94  }
95 
96  array = ndarray::allocate(dimensions.getY(), dimensions.getX());
97 
98  fitsfile.readImage(array, ndarray::makeVector(xy0.getY(), xy0.getX()));
99 
100  xy0 += xyOffset;
101 }
Point2I const getMin() const
Definition: Box.h:123
int getMinY() const
Definition: Box.h:125
Extent2I const getDimensions() const
Definition: Box.h:153
Point< int, 2 > Point2I
Definition: Point.h:285
int getMinX() const
Definition: Box.h:124
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:42
int getWidth() const
Definition: Box.h:154
afwGeom::Point2I getImageXY0FromMetadata(std::string const &wcsName, lsst::daf::base::PropertySet *metadata)
Return a Point2I(x0, y0) given a PropertySet containing a suitable WCS (e.g.
Definition: Wcs.cc:1213
void shift(Extent2I const &offset)
Shift the position of the box by the given offset.
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
int getHeight() const
Definition: Box.h:155
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:166
#define LSST_FITS_EXCEPT(type, fitsObj,...)
A FITS-related replacement for LSST_EXCEPT that takes an additional Fits object and uses makeErrorMes...
Definition: fits.h:91
Extent< int, 2 > Extent2I
Definition: Extent.h:358
std::string const wcsNameForXY0
Definition: Image.h:81
template<typename supported_fits_types , typename ImageT >
void lsst::afw::image::fits_read_image ( fits::Fits &  fitsfile,
ImageT &  img,
lsst::daf::base::PropertySet metadata,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin const  origin = PARENT 
)

Definition at line 87 of file fits_io_mpl.h.

92  {
93  ndarray::Array<typename ImageT::Pixel,2,2> array;
94  geom::Point2I xy0;
95  try {
96  boost::mpl::for_each<supported_fits_types>(
97  try_fits_read_array<ImageT, found_type>(
98  fitsfile, array, xy0, metadata, bbox, origin
99  )
100  );
101  } catch (found_type &) {
102  img = ImageT(array, false, xy0);
103  return;
104  }
105  throw LSST_FITS_EXCEPT(
106  fits::FitsError,
107  fitsfile,
108  "FITS file does not have one of the expected types"
109  );
110 }
#define LSST_FITS_EXCEPT(type, fitsObj,...)
A FITS-related replacement for LSST_EXCEPT that takes an additional Fits object and uses makeErrorMes...
Definition: fits.h:91
template<typename supported_fits_types , typename ImageT >
void lsst::afw::image::fits_read_image ( fits::Fits &  fitsfile,
ImageT &  img,
boost::shared_ptr< lsst::daf::base::PropertySet metadata = boost::shared_ptr< lsst::daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin const  origin = PARENT 
)

Definition at line 113 of file fits_io_mpl.h.

118  {
119  lsst::daf::base::PropertySet metadata_s;
120  fits_read_image<supported_fits_types, ImageT>(fitsfile, img, (metadata ? *metadata : metadata_s),
121  bbox, origin);
122 }
Class for storing generic metadata.
Definition: PropertySet.h:82
template<typename ImageT >
void lsst::afw::image::fits_write_image ( fits::Fits &  fitsfile,
const ImageT &  image,
boost::shared_ptr< daf::base::PropertySet const >  metadata = boost::shared_ptr< daf::base::PropertySet const>() 
)
inline

Definition at line 104 of file fits_io.h.

107  {
108  fitsfile.createImage<typename ImageT::Pixel>(image.getArray().getShape());
109  if (metadata) {
110  fitsfile.writeMetadata(*metadata);
111  }
112  fitsfile.writeImage(image.getArray());
113 }
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
double lsst::afw::image::fluxErrFromABMagErr ( double  magErr,
double  mag 
)
inline

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

Definition at line 74 of file Calib.h.

74  {
75  return std::abs(-0.4*magErr*fluxFromABMag(mag)*std::log(10.0));
76 }
double fluxFromABMag(double mag)
Compute flux in Janskys from AB magnitude.
Definition: Calib.h:69
def log
Definition: log.py:83
double lsst::afw::image::fluxFromABMag ( double  mag)
inline

Compute flux in Janskys from AB magnitude.

Definition at line 69 of file Calib.h.

69  {
70  return std::pow(10.0, -0.4*mag)*JanskysPerABFlux;
71 }
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 102 of file ImageAlgorithm.h.

105  {
106  for (int y = 0; y != lhs.getHeight(); ++y) {
107  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
108  lhsPtr != lhsEnd; ++lhsPtr) {
109  *lhsPtr = func();
110  }
111  }
112  }
int y
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 118 of file ImageAlgorithm.h.

121  {
122  for (int y = 0; y != lhs.getHeight(); ++y) {
123  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
124  lhsPtr != lhsEnd; ++lhsPtr) {
125  *lhsPtr = func(*lhsPtr);
126  }
127  }
128  }
int y
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 136 of file ImageAlgorithm.h.

139  {
140  for (int y = 0; y != lhs.getHeight(); ++y) {
141  int x = lhs.getX0();
142  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
143  lhsPtr != lhsEnd; ++lhsPtr, ++x) {
144  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr);
145  }
146  }
147  }
int y
double x
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 153 of file ImageAlgorithm.h.

157  {
158  if (lhs.getDimensions() != rhs.getDimensions()) {
159  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
160  (boost::format("Images are of different size, %dx%d v %dx%d") %
161  lhs.getWidth() % lhs.getHeight() % rhs.getWidth() % rhs.getHeight()).str());
162  }
163 
164  for (int y = 0; y != lhs.getHeight(); ++y) {
165  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
166 
167  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
168  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
169  *lhsPtr = func(*rhsPtr);
170  }
171  }
172  }
int y
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
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 178 of file ImageAlgorithm.h.

182  {
183  if (lhs.getDimensions() != rhs.getDimensions()) {
184  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
185  (boost::format("Images are of different size, %dx%d v %dx%d") %
186  lhs.getWidth() % lhs.getHeight() % rhs.getWidth() % rhs.getHeight()).str());
187  }
188 
189  for (int y = 0; y != lhs.getHeight(); ++y) {
190  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
191 
192  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
193  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
194  *lhsPtr = func(*lhsPtr, *rhsPtr);
195  }
196  }
197  }
int y
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
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 204 of file ImageAlgorithm.h.

208  {
209  if (lhs.getDimensions() != rhs.getDimensions()) {
210  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
211  (boost::format("Images are of different size, %dx%d v %dx%d") %
212  lhs.getWidth() % lhs.getHeight() % rhs.getWidth() % rhs.getHeight()).str());
213  }
214 
215  for (int y = 0; y != lhs.getHeight(); ++y) {
216  typename Image<RhsT>::const_x_iterator rhsPtr = rhs.row_begin(y);
217  int x = lhs.getX0();
218  for (typename Image<LhsT>::x_iterator lhsPtr = lhs.row_begin(y), lhsEnd = lhs.row_end(y);
219  lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr, ++x) {
220  *lhsPtr = func(x, y + lhs.getY0(), *lhsPtr, *rhsPtr);
221  }
222  }
223  }
int y
double x
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
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 54 of file ImageUtils.h.

56  {
57  return ind + PixelZeroPos;
58  }
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:42
template<typename Image1T , typename Image2T >
double lsst::afw::image::innerProduct ( Image1T const &  lhs,
Image2T const &  rhs,
int  border 
)

Calculate the inner product of two images.

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

Definition at line 455 of file ImagePca.cc.

458  {
459  if (lhs.getWidth() <= 2*border || lhs.getHeight() <= 2*border) {
460  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
461  (boost::format("All image pixels are in the border of width %d: %dx%d") %
462  border % lhs.getWidth() % lhs.getHeight()).str());
463  }
464 
465  double sum = 0.0;
466  //
467  // Handle I.I specially for efficiency, and to avoid advancing the iterator twice
468  //
469  if (imagesAreIdentical(lhs, rhs)) {
470  for (int y = border; y != lhs.getHeight() - border; ++y) {
471  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
472  lend = lhs.row_end(y) - border; lptr != lend; ++lptr) {
473  typename Image1T::Pixel val = *lptr;
474  if (std::isfinite(val)) {
475  sum += val*val;
476  }
477  }
478  }
479  } else {
480  if (lhs.getDimensions() != rhs.getDimensions()) {
481  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
482  (boost::format("Dimension mismatch: %dx%d v. %dx%d") %
483  lhs.getWidth() % lhs.getHeight() % rhs.getWidth() % rhs.getHeight()).str());
484  }
485 
486  for (int y = border; y != lhs.getHeight() - border; ++y) {
487  typename Image2T::const_x_iterator rptr = rhs.row_begin(y) + border;
488  for (typename Image1T::const_x_iterator lptr = lhs.row_begin(y) + border,
489  lend = lhs.row_end(y) - border; lptr != lend; ++lptr, ++rptr) {
490  double const tmp = (*lptr)*(*rptr);
491  if (std::isfinite(tmp)) {
492  sum += tmp;
493  }
494  }
495  }
496  }
497 
498  return sum;
499 }
int y
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
ImageT val
Definition: CR.cc:159
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
Exposure<ImagePixelT, MaskPixelT, VariancePixelT>::Ptr lsst::afw::image::makeExposure ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &  mimage,
boost::shared_ptr< Wcs const >  wcs = boost::shared_ptr< Wcs 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 314 of file Exposure.h.

317  {
318  return typename Exposure<ImagePixelT, MaskPixelT, VariancePixelT>::Ptr(
319  new Exposure<ImagePixelT, MaskPixelT, VariancePixelT>(mimage, wcs));
320 }
tbl::Key< int > wcs
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>* lsst::afw::image::makeMaskedImage ( typename Image< ImagePixelT >::Ptr  image,
typename Mask< MaskPixelT >::Ptr  mask = typename Mask<MaskPixelT>::Ptr(),
typename Image< VariancePixelT >::Ptr  variance = typename Image<VariancePixelT>::Ptr() 
)

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

std::make_pair)

Parameters
imageimage
maskmask
variancevariance

Definition at line 1073 of file MaskedImage.h.

1077  {
1078  return new MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(image, mask, variance);
1079 }
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
afwImg::Wcs::Ptr lsst::afw::image::makeWcs ( boost::shared_ptr< lsst::daf::base::PropertySet > const &  _metadata,
bool  stripMetadata = false 
)

Create a Wcs object from a fits header.

Set stripMetadata=true to remove processed keywords from the PropertySet.

It examines the header and determines the most suitable object to return, either a general Wcs object, or a more specific object specialised to a given coordinate system (e.g TanWcs)

Parameters
_metadatainput metadata
stripMetadataRemove FITS keywords from metadata?

Definition at line 40 of file makeWcs.cc.

44 {
45  //
46  // _metadata is not const (it is probably meant to be), but we don't want to modify it.
47  //
48  auto metadata = _metadata; // we'll make a copy and modify metadata if needs be
49  auto modifyable = false; // ... and set this variable to say that we did
50 
51  std::string ctype1, ctype2;
52  if (metadata->exists("CTYPE1") && metadata->exists("CTYPE2")) {
53  ctype1 = metadata->getAsString("CTYPE1");
54  ctype2 = metadata->getAsString("CTYPE2");
55  } else {
56  return PTR(Wcs)();
57  }
58  //
59  // SCAMP used to use PVi_j keys with a CTYPE of TAN to specify a "TPV" projection
60  // (cf. https://github.com/astropy/astropy/issues/299
61  // and the discussion from Dave Berry in https://jira.lsstcorp.org/browse/DM-2883)
62  //
63  // Follow Dave's AST and switch TAN to TPV
64  //
65  if (ctype1.substr(5, 3) == "TAN" &&
66  (metadata->exists("PV1_5") || metadata->exists("PV2_1"))) {
67  LOGL_INFO("makeWcs", "Interpreting %s/%s + PVi_j as TPV", ctype1.c_str(), ctype2.c_str());
68 
69  if (!modifyable) {
70  metadata = _metadata->deepCopy();
71  modifyable = true;
72  }
73 
74  ctype1.replace(5, 3, "TPV");
75  metadata->set<std::string>("CTYPE1", ctype1);
76 
77  ctype2.replace(5, 3, "TPV");
78  metadata->set<std::string>("CTYPE2", ctype2);
79  }
80 
81  afwImg::Wcs::Ptr wcs; // we can't use make_shared as ctor is private
82  if (ctype1.substr(5, 3) == "TAN") {
83  wcs = afwImg::Wcs::Ptr(new afwImg::TanWcs(metadata));
84  } else if (ctype1.substr(5, 3) == "TPV") { // unfortunately we don't support TPV
85  if (!modifyable) {
86  metadata = _metadata->deepCopy();
87  modifyable = true;
88  }
89 
90  LOGL_WARN("makeWcs", "Stripping PVi_j keys from projection %s/%s", ctype1.c_str(), ctype2.c_str());
91 
92  metadata->set<std::string>("CTYPE1", "RA---TAN");
93  metadata->set<std::string>("CTYPE2", "DEC--TAN");
94  metadata->set<bool>("TPV_WCS", true);
95  // PV1_[1-4] are in principle legal, although Swarp reuses them as part of the TPV parameterisation.
96  // It turns out that leaving PV1_[1-4] in the header breaks wcslib 4.14's ability to read
97  // DECam headers (DM-3196) so we'll delete them all for now.
98  //
99  // John Swinbank points out the maximum value of j in TVi_j is 39;
100  // http://fits.gsfc.nasa.gov/registry/tpvwcs/tpv.html
101  for (int i = 0; i != 2; ++i) {
102  for (int j = 1; j <= 39; ++j) { // 39's the max in the TPV standard
103  char pvName[8];
104  sprintf(pvName, "PV%d_%d", i, j);
105  if (metadata->exists(pvName)) {
106  metadata->remove(pvName);
107  }
108  }
109  }
110 
111  wcs = afwImg::Wcs::Ptr(new afwImg::TanWcs(metadata));
112  } else {
113  wcs = afwImg::Wcs::Ptr(new afwImg::Wcs(metadata));
114  }
115 
116  // If keywords LTV[1,2] are present, the image on disk is already a subimage, so
117  // we should shift the wcs to allow for this.
118  std::string key = "LTV1";
119  if (metadata->exists(key)) {
120  wcs->shiftReferencePixel(-metadata->getAsDouble(key), 0);
121  }
122 
123  key = "LTV2";
124  if (metadata->exists(key) ) {
125  wcs->shiftReferencePixel(0, -metadata->getAsDouble(key));
126  }
127 
128  if (stripMetadata) {
130  }
131 
132  return wcs;
133 }
tbl::Key< int > wcs
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
table::Key< std::string > ctype2
Definition: Wcs.cc:1034
std::shared_ptr< Wcs > Ptr
Definition: Wcs.h:113
#define LOGL_INFO(logger, message...)
Log a info-level message using a varargs/printf style interface.
Definition: Log.h:529
Implementation of the WCS standard for the special case of the Gnomonic (tangent plane) projection...
Definition: TanWcs.h:68
#define LOGL_WARN(logger, message...)
Log a warn-level message using a varargs/printf style interface.
Definition: Log.h:545
#define PTR(...)
Definition: base.h:41
int stripWcsKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > const &metadata, boost::shared_ptr< Wcs const > const &wcs)
Strip keywords from the input metadata that are related to the generated Wcs.
Definition: Wcs.cc:1256
daf::base::PropertySet & _metadata
Definition: fits_io_mpl.h:79
table::Key< std::string > ctype1
Definition: Wcs.cc:1033
afwImg::Wcs::Ptr lsst::afw::image::makeWcs ( coord::Coord const &  crval,
geom::Point2D const &  crpix,
double  CD11,
double  CD12,
double  CD21,
double  CD22 
)

Create a Wcs object from crval, crpix, CD, using CD elements (useful from python)

Parameters
crvalCRVAL1,2 (ie. the sky origin)
crpixCRPIX1,2 (ie. the pixel origin) in pixels
CD11CD matrix element 1,1
CD12CD matrix element 1,2
CD21CD matrix element 2,1
CD22CD matrix element 2,2

Definition at line 138 of file makeWcs.cc.

145  {
146  Eigen::Matrix2d CD;
147  CD << CD11, CD12, CD21, CD22;
148  lsst::afw::geom::Point2D crvalTmp;
149  crvalTmp[0] = crval.toIcrs().getLongitude().asDegrees();
150  crvalTmp[1] = crval.toIcrs().getLatitude().asDegrees();
151  return afwImg::Wcs::Ptr(new lsst::afw::image::TanWcs(crvalTmp, crpix, CD));
152 }
table::PointKey< double > crval
Definition: Wcs.cc:1030
A coordinate class intended to represent absolute positions.
std::shared_ptr< Wcs > Ptr
Definition: Wcs.h:113
Implementation of the WCS standard for the special case of the Gnomonic (tangent plane) projection...
Definition: TanWcs.h:68
table::PointKey< double > crpix
Definition: Wcs.cc:1031
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator* ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator* ( ImageSlice< PixelT > const &  slc,
Image< PixelT > const &  img 
)
template<typename PixelT >
void lsst::afw::image::operator*= ( afwImage::Image< PixelT > &  img,
afwImage::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 204 of file ImageSlice.cc.

207  {
208  details::operate<details::Mult<PixelT> >(img, slc, slc.getImageSliceType());
209 }
ImageSliceType getImageSliceType() const
Definition: ImageSlice.h:60
template<typename LhsPixelT , typename RhsPixelT >
void lsst::afw::image::operator*= ( image::Image< LhsPixelT > &  lhs,
image::Image< RhsPixelT > const &  rhs 
)

Multiply lhs by Image rhs (i.e.

pixel-by-pixel multiplication) where types are different

Definition at line 878 of file Image.cc.

878  {
879  image::for_each_pixel(lhs, rhs, timesEq<LhsPixelT, RhsPixelT>());
880 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image&lt;LhsT&gt; to func()
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator+ ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator+ ( ImageSlice< PixelT > const &  slc,
Image< PixelT > const &  img 
)
template<typename PixelT >
void lsst::afw::image::operator+= ( afwImage::Image< PixelT > &  img,
afwImage::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
imgThe Image
slcThe ImageSlice

Definition at line 121 of file ImageSlice.cc.

124  {
125  afwImage::details::operate<afwImage::details::Plus<PixelT> >(img, slc, slc.getImageSliceType());
126 }
ImageSliceType getImageSliceType() const
Definition: ImageSlice.h:60
template<typename LhsPixelT , typename RhsPixelT >
void lsst::afw::image::operator+= ( image::Image< LhsPixelT > &  lhs,
image::Image< RhsPixelT > const &  rhs 
)

Add lhs to Image rhs (i.e.

pixel-by-pixel addition) where types are different

Definition at line 864 of file Image.cc.

864  {
865  image::for_each_pixel(lhs, rhs, plusEq<LhsPixelT, RhsPixelT>());
866 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image&lt;LhsT&gt; to func()
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator- ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)
template<typename PixelT >
void lsst::afw::image::operator-= ( afwImage::Image< PixelT > &  img,
afwImage::ImageSlice< PixelT > const &  slc 
)

Overload operator-=()

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

Parameters
imgThe Image
slcThe ImageSlice

Definition at line 157 of file ImageSlice.cc.

160  {
161  details::operate<details::Minus<PixelT> >(img, slc, slc.getImageSliceType());
162 }
ImageSliceType getImageSliceType() const
Definition: ImageSlice.h:60
template<typename LhsPixelT , typename RhsPixelT >
void lsst::afw::image::operator-= ( image::Image< LhsPixelT > &  lhs,
image::Image< RhsPixelT > const &  rhs 
)

Subtract lhs from Image rhs (i.e.

pixel-by-pixel subtraction) where types are different

Definition at line 871 of file Image.cc.

871  {
872  image::for_each_pixel(lhs, rhs, minusEq<LhsPixelT, RhsPixelT>());
873 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image&lt;LhsT&gt; to func()
template<typename PixelT >
Image<PixelT>::Ptr lsst::afw::image::operator/ ( Image< PixelT > const &  img,
ImageSlice< PixelT > const &  slc 
)
template<typename PixelT >
void lsst::afw::image::operator/= ( afwImage::Image< PixelT > &  img,
afwImage::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 240 of file ImageSlice.cc.

243  {
244  details::operate<details::Div<PixelT> >(img, slc, slc.getImageSliceType());
245 }
ImageSliceType getImageSliceType() const
Definition: ImageSlice.h:60
template<typename LhsPixelT , typename RhsPixelT >
void lsst::afw::image::operator/= ( image::Image< LhsPixelT > &  lhs,
image::Image< RhsPixelT > const &  rhs 
)

Divide lhs by Image rhs (i.e.

pixel-by-pixel division) where types are different

Definition at line 885 of file Image.cc.

885  {
886  image::for_each_pixel(lhs, rhs, divideEq<LhsPixelT, RhsPixelT>());
887 }
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image&lt;LhsT&gt; to func()
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.

71  {
72  return static_cast<int>(std::floor(pos + 0.5 - PixelZeroPos));
73  }
Extent< int, N > floor(Extent< double, N > const &input)
Return the component-wise floor (round towards more negative).
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:42
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 86 of file ImageUtils.h.

89  {
90  double fullIndex = pos - PixelZeroPos;
91  double roundedIndex = std::floor(fullIndex + 0.5);
92  residual = fullIndex - roundedIndex;
93  return static_cast<int>(roundedIndex);
94  }
Extent< int, N > floor(Extent< double, N > const &input)
Return the component-wise floor (round towards more negative).
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:42
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 100 of file ImageUtils.h.

102  {
103  double residual; // fractional part of index
104  int const ind = positionToIndex(residual, pos); // integral part
105 
106  return std::pair<int, double>(ind, residual);
107  }
int positionToIndex(double pos)
Convert image position to nearest integer index.
Definition: ImageUtils.h:69
boost::shared_ptr< daf::base::PropertyList > lsst::afw::image::readMetadata ( std::string const &  fileName,
int  hdu = 0,
bool  strip = false 
)
inline

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

Read FITS header.

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

Definition at line 62 of file Utils.h.

62  {
63  return afw::fits::readMetadata(fileName, hdu, strip);
64 }
boost::shared_ptr< daf::base::PropertyList > readMetadata(std::string const &fileName, int hdu=0, bool strip=false)
Read FITS header.
Definition: Utils.h:62
template<typename PixelT >
void lsst::afw::image::swap ( ImageBase< PixelT > &  a,
ImageBase< PixelT > &  b 
)

Definition at line 315 of file Image.cc.

315  {
316  a.swap(b);
317 }
afw::table::Key< double > b
template<typename PixelT >
void lsst::afw::image::swap ( Mask< PixelT > &  a,
Mask< PixelT > &  b 
)

Definition at line 524 of file Mask.cc.

524  {
525  a.swap(b);
526 }
afw::table::Key< double > b
template<typename PixelT >
void lsst::afw::image::swap ( Image< PixelT > &  a,
Image< PixelT > &  b 
)

Definition at line 637 of file Image.cc.

637  {
638  a.swap(b);
639 }
afw::table::Key< double > b
template<typename PixelT >
void lsst::afw::image::swap ( DecoratedImage< PixelT > &  a,
DecoratedImage< PixelT > &  b 
)

Definition at line 120 of file DecoratedImage.cc.

120  {
121  a.swap(b);
122 }
afw::table::Key< double > b

Variable Documentation

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 42 of file ImageUtils.h.