LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
29 #ifndef LSST_AFW_IMAGE_MASK_H
30 #define LSST_AFW_IMAGE_MASK_H
76 template <
typename MaskPixelT = lsst::afw::image::MaskPixel>
84 template <
typename MaskPT = MaskPixelT>
107 explicit Mask(
unsigned int width,
unsigned int height, MaskPixelT initialValue,
167 bool conformMasks =
false,
bool allowUnsafe =
false);
193 bool conformMasks =
false,
bool allowUnsafe =
false);
216 bool conformMasks =
false,
bool allowUnsafe =
false);
219 template <
typename OtherPixelT>
221 :
image::
ImageBase<MaskPixelT>(rhs, deep), _maskDict(rhs._maskDict) {}
241 const bool deep =
false);
243 explicit Mask(ndarray::Array<MaskPixelT, 2, 1>
const& array,
bool deep =
false,
277 return Mask(*
this,
bbox, origin,
false);
542 static MaskPixelT getBitMaskNoThrow(
int plane);
548 static MaskPixelT getBitMask(
int plane);
566 void checkMaskDictionaries(
Mask const&
other);
569 template <
typename PixelT>
575 #endif // LSST_AFW_IMAGE_MASK_H
A FITS reader class for Masks.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
void writeFits(fits::MemFileManager &manager, fits::ImageWriteOptions const &options, std::string const &mode="w", std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
Write a mask to a FITS RAM file.
Represent a 2-dimensional array of bitmask pixels.
std::map< std::string, int > MaskPlaneDict
Mask(std::string const &fileName, int hdu=fits::DEFAULT_HDU, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Construct a Mask by reading a regular FITS file.
static std::string interpret(MaskPixelT value)
Interpret a mask value as a comma-separated list of mask plane names.
Mask(fits::Fits &fitsfile, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Construct a Mask from an already-open FITS object.
const int DEFAULT_HDU
Specify that the default HDU should be read.
static Mask readFits(std::string const &filename, int hdu=fits::DEFAULT_HDU)
Read a Mask from a regular FITS file.
static int getNumPlanesMax()
Mask & operator&=(Mask const &rhs)
AND a Mask into a Mask.
void writeFits(std::string const &fileName, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), std::string const &mode="w") const
Write a mask to a regular FITS file.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Mask< MaskPT > type
Return the desired type.
Mask & operator=(MaskPixelT const rhs)
void writeFits(fits::MemFileManager &manager, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), std::string const &mode="w") const
Write a mask to a FITS RAM file.
static MaskPlaneDict parseMaskPlaneMetadata(std::shared_ptr< lsst::daf::base::PropertySet const > metadata)
Given a PropertySet that contains the MaskPlane assignments, setup the MaskPlanes.
Mask(Mask< OtherPixelT > const &rhs, const bool deep)
Mask operator[](lsst::geom::Box2I const &bbox) const
Return a subimage corresponding to the given box (interpreted as PARENT coordinates).
void clearAllMaskPlanes()
Clear all the pixels.
static Mask readFits(fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
Read a Mask from a FITS RAM file.
Lifetime-management for memory that goes into FITS memory files.
static int getNumPlanesUsed()
static int getMaskPlane(const std::string &name)
Return the mask plane number corresponding to a plane name.
Mask(fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool allowUnsafe=false)
Construct a Mask by reading a FITS image in memory.
Mask(unsigned int width, unsigned int height, MaskPlaneDict const &planeDefs=MaskPlaneDict())
Construct a Mask initialized to 0x0.
detail::MaskPlaneDict MaskPlaneDict
Options for writing an image to FITS.
static void addMaskPlanesToMetadata(std::shared_ptr< lsst::daf::base::PropertySet >)
Given a PropertySet, replace any existing MaskPlane assignments with the current ones.
std::shared_ptr< RecordT > src
Mask & operator|=(Mask const &rhs)
OR a Mask into a Mask.
void removeAndClearMaskPlane(const std::string &name, bool const removeFromDefault=false)
Clear all pixels of the specified mask and remove the plane from the mask plane dictionary; optionall...
static void clearMaskPlaneDict()
Reset the maskPlane dictionary.
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR'd together.
Reference< PixelT >::type PixelReference
A Reference to a PixelT.
ItemVariant const * other
Mask & operator^=(Mask const &rhs)
XOR a Mask into a Mask.
afw::table::PointKey< int > dimensions
std::string getAsString(int x, int y)
void writeFits(std::string const &filename, fits::ImageWriteOptions const &options, std::string const &mode="w", std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
Write a mask to a regular FITS file.
A class used to request that array accesses be checked.
void writeFits(fits::Fits &fitsfile, fits::ImageWriteOptions const &options, std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
Write a mask to an open FITS file object.
A base class for image defects.
void printMaskPlanes() const
print the mask plane dictionary to std::cout
A templated class to return this classes' type (present in Image/Mask/MaskedImage)
void conformMaskPlanes(const MaskPlaneDict &masterPlaneDict)
Adjust this mask to conform to the standard Mask class's mask plane dictionary, adding any new mask p...
static int addMaskPlane(const std::string &name)
static void removeMaskPlane(const std::string &name)
Mask subset(lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
Return a subimage corresponding to the given box.
void writeFits(fits::Fits &fitsfile, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet const >()) const
Write a mask to an open FITS file object.
An integer coordinate rectangle.
void swap(Image< PixelT > &a, Image< PixelT > &b)
MaskPlaneDict const & getMaskPlaneDict() const
Return the Mask's maskPlaneDict.
ImageBase< MaskPixelT >::PixelReference operator()(int x, int y)
get a reference to the specified pixel
ConstReference< PixelT >::type PixelConstReference
A ConstReference to a PixelT.
The base class for all image classed (Image, Mask, MaskedImage, ...)
void clearMaskPlane(int plane)
Clear the specified bit in all pixels.
void setMaskPlaneValues(const int plane, const int x0, const int x1, const int y)
Set the bit specified by "planeId" for pixels (x0, y) ...
detail::Mask_tag image_category