LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
|
A compact representation of a collection of pixels. More...
#include <SpanSet.h>
Public Types | |
using | const_iterator = std::vector<Span>::const_iterator |
using | size_type = std::vector<Span>::size_type |
using | value_type = Span |
using | const_reference = const value_type & |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_reference | front () const |
const_reference | back () const |
size_type | size () const |
bool | empty () const |
SpanSet () | |
Default constructor. | |
SpanSet (lsst::geom::Box2I const &box) | |
Construct a SpanSet from a box. | |
template<typename iter > | |
SpanSet (iter begin, iter end, bool normalize=true) | |
Construct a SpanSet from an iterator. | |
SpanSet (std::vector< Span > const &vec, bool normalize=true) | |
Construct a SpanSet from a std vector by copying. | |
SpanSet (std::vector< Span > &&vec, bool normalize=true) | |
Construct a SpanSet from a std vector from a move. | |
SpanSet (SpanSet const &other)=delete | |
SpanSet (SpanSet &&other)=delete | |
~SpanSet () override=default | |
SpanSet & | operator= (SpanSet const &)=default |
SpanSet & | operator= (SpanSet &&other) |
size_type | getArea () const |
Return the number of pixels in the SpanSet. | |
lsst::geom::Box2I | getBBox () const |
Return a new integer box which is the minimum size to contain the pixels. | |
bool | isContiguous () const |
Defines if the SpanSet is simply contiguous. | |
std::shared_ptr< SpanSet > | shiftedBy (int x, int y) const |
Return a new SpanSet shifted by specified amount. | |
std::shared_ptr< SpanSet > | shiftedBy (lsst::geom::Extent2I const &offset) const |
Return a new SpanSet shifted by specified amount. | |
std::shared_ptr< SpanSet > | clippedTo (lsst::geom::Box2I const &box) const |
Return a new SpanSet which has all pixel values inside specified box. | |
std::shared_ptr< SpanSet > | transformedBy (lsst::geom::LinearTransform const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. | |
std::shared_ptr< SpanSet > | transformedBy (lsst::geom::AffineTransform const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. | |
std::shared_ptr< SpanSet > | transformedBy (TransformPoint2ToPoint2 const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. | |
bool | overlaps (SpanSet const &other) const |
Specifies if this SpanSet overlaps with another SpanSet. | |
bool | contains (SpanSet const &other) const |
Check if a SpanSet instance entirely contains another SpanSet. | |
bool | contains (lsst::geom::Point2I const &point) const |
Check if a point is contained within the SpanSet instance. | |
lsst::geom::Point2D | computeCentroid () const |
Compute the point about which the SpanSet's first moment is zero. | |
ellipses::Quadrupole | computeShape () const |
Compute the shape parameters for the distribution of points in the SpanSet. | |
std::shared_ptr< SpanSet > | dilated (int r, Stencil s=Stencil::CIRCLE) const |
Perform a set dilation operation, and return a new object. | |
std::shared_ptr< SpanSet > | dilated (SpanSet const &other) const |
Perform a set dilation operation, and return a new object. | |
std::shared_ptr< SpanSet > | eroded (int r, Stencil s=Stencil::CIRCLE) const |
Perform a set erosion, and return a new object. | |
std::shared_ptr< SpanSet > | eroded (SpanSet const &other) const |
Perform a set erosion operation, and return a new object. | |
template<typename Pixel , int inN, int inC> | |
ndarray::Array< typename std::remove_const< Pixel >::type, inN - 1, inN - 1 > | flatten (ndarray::Array< Pixel, inN, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet. | |
template<typename PixelIn , typename PixelOut , int inA, int outC, int inC> | |
void | flatten (ndarray::Array< PixelOut, inA - 1, outC > const &output, ndarray::Array< PixelIn, inA, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet. | |
template<typename Pixel , int inA, int inC> | |
ndarray::Array< typename std::remove_const< Pixel >::type, inA+1, inA+1 > | unflatten (ndarray::Array< Pixel, inA, inC > const &input) const |
Expand an array by one spatial dimension at points given by SpanSet. | |
template<typename PixelIn , typename PixelOut , int inA, int outC, int inC> | |
void | unflatten (ndarray::Array< PixelOut, inA+1, outC > const &output, ndarray::Array< PixelIn, inA, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Expand an array by one spatial dimension at points given by SpanSet. | |
template<typename ImageT > | |
void | copyImage (image::Image< ImageT > const &src, image::Image< ImageT > &dest) |
Copy contents of source Image into destination image at the positions defined in the SpanSet. | |
template<typename ImageT , typename MaskT , typename VarT > | |
void | copyMaskedImage (image::MaskedImage< ImageT, MaskT, VarT > const &src, image::MaskedImage< ImageT, MaskT, VarT > &dest) |
Copy contents of source MaskedImage into destination image at the positions defined in the SpanSet. | |
template<typename ImageT > | |
void | setImage (image::Image< ImageT > &image, ImageT val, lsst::geom::Box2I const ®ion=lsst::geom::Box2I(), bool doClip=false) const |
Set the values of an Image at points defined by the SpanSet. | |
template<typename Functor , typename... Args> | |
void | applyFunctor (Functor &&func, Args &&... args) const |
Apply functor on individual elements from the supplied parameters. | |
template<typename T > | |
void | setMask (lsst::afw::image::Mask< T > &target, T bitmask) const |
Set a Mask at pixels defined by the SpanSet. | |
template<typename T > | |
void | clearMask (lsst::afw::image::Mask< T > &target, T bitmask) const |
Unset a Mask at pixels defined by the SpanSet. | |
std::shared_ptr< SpanSet > | intersect (SpanSet const &other) const |
Determine the common points between two SpanSets, and create a new SpanSet. | |
template<typename T > | |
std::shared_ptr< SpanSet > | intersect (image::Mask< T > const &other, T bitmask) const |
Determine the common points between a SpanSet and a Mask with a given bit pattern. | |
std::shared_ptr< SpanSet > | intersectNot (SpanSet const &other) const |
Determine the common points between a SpanSet and the logical inverse of a second SpanSet and return them in a new SpanSet. | |
template<typename T > | |
std::shared_ptr< SpanSet > | intersectNot (image::Mask< T > const &other, T bitmask) const |
Determine the common points between a SpanSet and the logical inverse of a Mask for a given bit pattern. | |
std::shared_ptr< SpanSet > | union_ (SpanSet const &other) const |
Create a new SpanSet that contains all points from two SpanSets. | |
template<typename T > | |
std::shared_ptr< SpanSet > | union_ (image::Mask< T > const &other, T bitmask) const |
Determine the union between a SpanSet and a Mask for a given bit pattern. | |
bool | operator== (SpanSet const &other) const |
Compute equality between two SpanSets. | |
bool | operator!= (SpanSet const &other) const |
std::vector< std::shared_ptr< geom::SpanSet > > | split () const |
Split a discontinuous SpanSet into multiple SpanSets which are contiguous. | |
bool | isPersistable () const noexcept override |
Return true if this particular object can be persisted using afw::table::io. | |
std::shared_ptr< geom::SpanSet > | findEdgePixels () const |
Select pixels within the SpanSet which touch its edge. | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. | |
Static Public Member Functions | |
static std::shared_ptr< geom::SpanSet > | fromShape (int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I()) |
Factory function for creating SpanSets from a Stencil. | |
static std::shared_ptr< geom::SpanSet > | fromShape (geom::ellipses::Ellipse const &ellipse) |
Factory function for creating SpanSets from an ellipse object. | |
template<typename T , typename UnaryPredicate = details::AnyBitSetFunctor<T>> | |
static std::shared_ptr< geom::SpanSet > | fromMask (image::Mask< T > const &mask, UnaryPredicate comparator=details::AnyBitSetFunctor< T >()) |
Create a SpanSet from a mask. | |
template<typename T > | |
static std::shared_ptr< geom::SpanSet > | fromMask (image::Mask< T > const &mask, T bitmask) |
Create a SpanSet from a mask. | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Private Member Functions | |
std::string | getPersistenceName () const override |
Return the unique name used to persist this object and look up its factory. | |
std::string | getPythonModule () const override |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. | |
void | write (OutputArchiveHandle &handle) const override |
Write the object to one or more catalogs. | |
Friends | |
class | SpansSetFactory |
A compact representation of a collection of pixels.
A SpanSet is a collection of Span classes. As each Span encodes a range of pixels on a given row, a SpanSet represents an arbitrary collection of pixels on an image. The SpanSet class also contains mathematical set style operators, for working with the collection of pixels, and helper functions which make use of the area defined to perform localized actions
using lsst::afw::geom::SpanSet::const_iterator = std::vector<Span>::const_iterator |
using lsst::afw::geom::SpanSet::const_reference = const value_type & |
|
protectedinherited |
Definition at line 108 of file Persistable.h.
using lsst::afw::geom::SpanSet::size_type = std::vector<Span>::size_type |
lsst::afw::geom::SpanSet::SpanSet | ( | ) |
Default constructor.
Construct a null SpanSet, with zero size. This is useful as a placeholder
Definition at line 177 of file SpanSet.cc.
|
explicit |
Construct a SpanSet from a box.
box | A integer box that defines the shape for which a span set should be created |
Definition at line 180 of file SpanSet.cc.
|
inline |
Construct a SpanSet from an iterator.
This constructor accepts the begin and end points of an arbitrary iterator of a container which contains previously created Spans. These Spans are used to construct the SpanSet.
begin | Beginning iterator of a container of Spans |
end | End iterator of a container of Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 123 of file SpanSet.h.
|
explicit |
Construct a SpanSet from a std vector by copying.
This constructor accepts a standard vector which contains already created Spans. These Spans are copied into the internal container of spans.
vec | Standard vector containing Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 192 of file SpanSet.cc.
|
explicit |
Construct a SpanSet from a std vector from a move.
This constructor accepts a standard vector r-reference which contains already created Spans. These Spans become the internal container of spans.
vec | Standard vector containing Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 206 of file SpanSet.cc.
|
delete |
|
delete |
|
overridedefault |
|
inline |
Apply functor on individual elements from the supplied parameters.
Use a variadic template to take a functor object, and an arbitrary number of parameters. Parameters may be of type(s) Image, MakedImage, ndarray, numeric value and generic iterators. For most of these types bound checking is done to ensure execution safety, but because a generic iterator can have any behavior, bounds checking is not possible. As such the iterator must be valid for at least the number of pixels contained in the SpanSet. Numeric values are also different in that they will not be iterated but the value will be passed to the functor for each point in the SpanSet.
Because a ndarray can either be interpreted as either a two dimensional image, or a one dimensional vector a user must break the ambiguity by using the functions ndarray::ndImage, or ndarray::ndFlat respectively.
The functor object must operate in-place on any data, no return values are captured. No exceptions are handled, if a functor throws one it will propagate back out of the applyFunctor call, possibly leaving the output array in an incomplete state. The first argument of the functor must be a lsst::geom::Point2I which will be the point in the SpanSet where the operation is occurring. All the remaining arguments to the functor will be individual values generated from the input arguments. For two dimensional types (Image, MaskedImage, ndarray) arguments will be the value taken from the input type at the location given by the SpanSet. I.e. if the SpanSet has the point (2,3) in it, then a 2 dimensional ndarray will have ndarray[2][3] passed to the functor. Thus all SpanSet coordinates must be addressable in two dimensional types. For one dimensional types (ndarray, iterator) arguments will correspond to the value at the location defined by number of pixels which have been iterated over. I.e. if there are 3 pixels defined in the SpanSet a one dimensional ndarray will have the value ndarray[0] passed to the functor on on the first functor call, ndarray[1] passed on the second call, and ndarray[2] passed on the last functor call. The total length of a one dimensional type will be equal to the area of the SpanSet, and therefore the data-type must be at least that length. The order of the parameters supplied to the functor will be the same order as they are passed to the applyFunctor method.
...Args | Variadic type specification |
func | Functor that is to be applied on each of the values taken from ...args. |
...args | Variadic arguments, may be of type Image, MaskedImage, ndarrays, numeric values and iterators. ndarrays must be specified as either image or vector with the ndarray::ndImage or ndarray::ndFlat functions |
Definition at line 512 of file SpanSet.h.
|
inline |
|
inline |
|
inline |
|
inline |
void lsst::afw::geom::SpanSet::clearMask | ( | lsst::afw::image::Mask< T > & | target, |
T | bitmask ) const |
Unset a Mask at pixels defined by the SpanSet.
T | data-type of a pixel in the Mask plane |
[in,out] | target | Mask in which a bit pattern will be unset |
[in] | bitmask | The bit pattern to clear in the mask |
Definition at line 960 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::clippedTo | ( | lsst::geom::Box2I const & | box | ) | const |
Return a new SpanSet which has all pixel values inside specified box.
box | Integer box specifying the bounds for which all pixels must be within |
Definition at line 439 of file SpanSet.cc.
lsst::geom::Point2D lsst::afw::geom::SpanSet::computeCentroid | ( | ) | const |
Compute the point about which the SpanSet's first moment is zero.
Definition at line 502 of file SpanSet.cc.
ellipses::Quadrupole lsst::afw::geom::SpanSet::computeShape | ( | ) | const |
Compute the shape parameters for the distribution of points in the SpanSet.
Definition at line 521 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::contains | ( | lsst::geom::Point2I const & | point | ) | const |
Check if a point is contained within the SpanSet instance.
point | An integer point object for which membership is to be tested |
Definition at line 492 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::contains | ( | SpanSet const & | other | ) | const |
Check if a SpanSet instance entirely contains another SpanSet.
other | The SpanSet who's membership is to be tested for |
Definition at line 466 of file SpanSet.cc.
|
inline |
Copy contents of source Image into destination image at the positions defined in the SpanSet.
ImageT | The pixel type of the Image |
[in] | src | The Image that pixel values will be taken from |
[out] | dest | The Image where pixels will be copied |
Definition at line 416 of file SpanSet.h.
|
inline |
Copy contents of source MaskedImage into destination image at the positions defined in the SpanSet.
ImageT | The pixel type of the MaskedImage's Image |
MaskT | The pixel type of the MaskedImage's Mask |
VarT | The Pixel type of the MaskedImage's Variance Image |
[in] | src | The MaskedImage that pixel values will be taken from |
[out] | dest | The MaskedImage where pixels will be copied |
Definition at line 433 of file SpanSet.h.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::dilated | ( | int | r, |
Stencil | s = Stencil::CIRCLE ) const |
Perform a set dilation operation, and return a new object.
Dilate a SpanSet with a kernel specified with the stencil parameter
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the dilation kernel. May be CIRCLE, MANHATTAN, or BOX |
Definition at line 544 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::dilated | ( | SpanSet const & | other | ) | const |
Perform a set dilation operation, and return a new object.
Dilate a SpanSet with a kernel specified by another SpanSet
other | A SpanSet which specifies the kernel to use for dilation |
Definition at line 551 of file SpanSet.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inline |
|
inline |
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::eroded | ( | int | r, |
Stencil | s = Stencil::CIRCLE ) const |
Perform a set erosion, and return a new object.
Erode a SpanSet with a kernel specified with the stencil parameter
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the erosion kernel. May be CIRCLE, MANHATTAN, or BOX |
Definition at line 572 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::eroded | ( | SpanSet const & | other | ) | const |
Perform a set erosion operation, and return a new object.
Erode a SpanSet with a kernel specified by another SpanSet
other | A SpanSet which specifies the kernel to use for erosion |
Definition at line 579 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::findEdgePixels | ( | ) | const |
Select pixels within the SpanSet which touch its edge.
Definition at line 411 of file SpanSet.cc.
|
inline |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet.
Take values from an array at points defined by SpanSet and use them to populate a new array where the x,y coordinates of the SpanSet have been flattened to one dimension. First two dimensions of the input array must be the h,w which correspond to the SpanSet coordinates. Any number of remaining dimensions is permissible.
Pixel | The datatype for the ndarray |
inN | The number of dimensions in the array object |
inC | Number of guaranteed row-major contiguous dimensions, starting from the end |
input | The ndarray from which the values will be taken |
xy0 | A point object with is used as the origin point for the SpanSet coordinate system |
Definition at line 303 of file SpanSet.h.
|
inline |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet.
Take values from an array at points defined by SpanSet and use them to populate a new array where the x,y coordinates of the SpanSet have been flattened to one dimension. First two dimensions of the input array must be the h,w which correspond to the SpanSet coordinates. Any number of remaining dimensions is permissible.
PixelOut | The data-type for the output ndarray |
PixelIn | The data-type for the input ndarray |
inA | The number of dimensions in the input array |
outC | Number of guaranteed row-major contiguous dimensions in the output array, starting from the end |
inC | Number of guaranteed row-major contiguous dimensions in the input array, starting from the end |
[out] | output | The 1d ndarray which will be populated with output parameters, will happen in place |
[in] | input | The ndarray from which the values will be taken |
[in] | xy0 | A point object which is used as the origin point for the SpanSet coordinate system |
Definition at line 336 of file SpanSet.h.
|
inlinestatic |
|
inlinestatic |
Create a SpanSet from a mask.
Create a SpanSet from a class. The default behavior is to include any pixels which have any bits set. More complex selection/filtering of bit patterns can be done by supplying a comparator function.
T | Pixel type of the Mask |
F | Type of the functor |
mask | mask to convert to a SpanSet |
comparator | Functor object to use in the decision to include pixel in SpanSet. Should return true when a given pixel in the mask should be part of the SpanSet, and false otherwise. The functor takes a single value taken from the mask at the pixel under consideration. Defaults to evaluating true if the mask has bits set, and false otherwise. |
Definition at line 644 of file SpanSet.h.
|
static |
Factory function for creating SpanSets from an ellipse object.
ellipse | An ellipse defining the region to create a SpanSet from |
Definition at line 715 of file SpanSet.cc.
|
static |
Factory function for creating SpanSets from a Stencil.
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the newly created SpanSet. May be CIRCLE, MANHATTAN, or BOX |
offset | This function usually creates a SpanSet centered about zero. This parameter is a point2I object which specifies an offset from zero to apply when creating the SpanSet. |
Definition at line 688 of file SpanSet.cc.
|
inline |
std::size_t lsst::afw::geom::SpanSet::getArea | ( | ) | const |
Return the number of pixels in the SpanSet.
Definition at line 283 of file SpanSet.cc.
lsst::geom::Box2I lsst::afw::geom::SpanSet::getBBox | ( | ) | const |
Return a new integer box which is the minimum size to contain the pixels.
Definition at line 286 of file SpanSet.cc.
|
overrideprivatevirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 1046 of file SpanSet.cc.
|
inlineoverrideprivatevirtual |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.
Will be ignored if empty.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 724 of file SpanSet.h.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersect | ( | image::Mask< T > const & | other, |
T | bitmask ) const |
Determine the common points between a SpanSet and a Mask with a given bit pattern.
T | Pixel type of the Mask |
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
Definition at line 971 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersect | ( | SpanSet const & | other | ) | const |
Determine the common points between two SpanSets, and create a new SpanSet.
other | The other SpanSet with which to intersect with |
Definition at line 720 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersectNot | ( | image::Mask< T > const & | other, |
T | bitmask ) const |
Determine the common points between a SpanSet and the logical inverse of a Mask for a given bit pattern.
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
T | Pixel type of the Mask |
Definition at line 976 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersectNot | ( | SpanSet const & | other | ) | const |
Determine the common points between a SpanSet and the logical inverse of a second SpanSet and return them in a new SpanSet.
other | The spanset which will be logically inverted when computing the intersection |
Definition at line 747 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::isContiguous | ( | ) | const |
Defines if the SpanSet is simply contiguous.
If the pixels can be traversed in such a way that every pixel can be reached without going over a pixel not contained in the SpanSet this method will return true. If the SpanSet is disjoint aka the above is not true and there is more than one region, returns false.
Definition at line 373 of file SpanSet.cc.
|
inlineoverridevirtualnoexcept |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 709 of file SpanSet.h.
bool lsst::afw::geom::SpanSet::operator!= | ( | SpanSet const & | other | ) | const |
Definition at line 683 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::operator== | ( | SpanSet const & | other | ) | const |
Compute equality between two SpanSets.
other | The SpanSet for which equality will be computed |
Definition at line 678 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::overlaps | ( | SpanSet const & | other | ) | const |
Specifies if this SpanSet overlaps with another SpanSet.
other | A SpanSet for which overlapping comparison will be made |
Definition at line 454 of file SpanSet.cc.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
template void lsst::afw::geom::SpanSet::setImage< double > | ( | image::Image< ImageT > & | image, |
ImageT | val, | ||
lsst::geom::Box2I const & | region = lsst::geom::Box2I(), | ||
bool | doClip = false ) const |
Set the values of an Image at points defined by the SpanSet.
ImageT | The pixel type of the Image to be set |
[out] | image | The Image in which pixels will be set |
[in] | val | The value to set |
[in] | region | A bounding box limiting the scope of the SpanSet, points defined in the SpanSet which fall outside this box will be ignored if the doClip parameter is set to true, defaults to the bounding box of the image |
[in] | doClip | Limit the copy operation to pixels in the SpanSet that lie within the region parameter defaults to false |
Definition at line 926 of file SpanSet.cc.
void lsst::afw::geom::SpanSet::setMask | ( | lsst::afw::image::Mask< T > & | target, |
T | bitmask ) const |
Set a Mask at pixels defined by the SpanSet.
T | data-type of a pixel in the Mask plane |
[in,out] | target | Mask in which values will be set |
[in] | bitmask | The bit pattern to set in the mask |
Definition at line 949 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::shiftedBy | ( | int | x, |
int | y ) const |
Return a new SpanSet shifted by specified amount.
x | number of pixels to shift in x dimension |
y | number of pixels to shift in y dimension |
Definition at line 419 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::shiftedBy | ( | lsst::geom::Extent2I const & | offset | ) | const |
Return a new SpanSet shifted by specified amount.
offset | integer extent which specifies amount to offset in x and y |
Definition at line 424 of file SpanSet.cc.
|
inline |
std::vector< std::shared_ptr< SpanSet > > lsst::afw::geom::SpanSet::split | ( | ) | const |
Split a discontinuous SpanSet into multiple SpanSets which are contiguous.
Definition at line 382 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | lsst::geom::AffineTransform const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | An affine transform object which will be used to map the pixels |
Definition at line 849 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | lsst::geom::LinearTransform const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | A linear transform object which will be used to map the pixels |
Definition at line 844 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | TransformPoint2ToPoint2 const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | A 2-D transform which will be used to map the pixels |
Definition at line 854 of file SpanSet.cc.
|
inline |
Expand an array by one spatial dimension at points given by SpanSet.
Take values from a lower dimensional array and insert them in an output array with one additional dimension at points defined by the SpanSet, offset by the lower left hand corner of the bounding box of the SpanSet. The first two dimensions of the output array will correspond to the y,x dimensions of the SpanSet
Pixel | The data-type for the ndarray |
inA | Number of dimension of the input array |
inC | Number of guaranteed row-major contiguous dimensions, starting from the end |
input | The ndarray from which the values will be taken |
Definition at line 360 of file SpanSet.h.
|
inline |
Expand an array by one spatial dimension at points given by SpanSet.
Take values from a lower dimensional array and insert them in an output array with one additional dimension at points defined by the SpanSet, offset by the lower left hand corner of the bounding box of the SpanSet. The first two dimensions of the output array will correspond to the y,x dimensions of the SpanSet
PixelOut | The datatype for the output ndarray |
PixelIn | The datatype for the input ndarray |
inA | Number of dimensions of the input ndarray |
outC | Number of guaranteed row-major contiguous dimensions in the output array, starting from the end |
inC | Number of guaranteed row-major contiguous dimensions in the input array, starting from the end |
[out] | output | The 1d ndarray which will be populated with output parameters, will happen in place |
[in] | input | The ndarray from which the values will be taken |
[in] | xy0 | A point object with is used as the origin point for the SpanSet coordinate system |
Definition at line 397 of file SpanSet.h.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::union_ | ( | image::Mask< T > const & | other, |
T | bitmask ) const |
Determine the union between a SpanSet and a Mask for a given bit pattern.
T | Pixel type of the Mask |
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
Definition at line 981 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::union_ | ( | SpanSet const & | other | ) | const |
Create a new SpanSet that contains all points from two SpanSets.
other | The SpanSet from which the union will be calculated |
Definition at line 830 of file SpanSet.cc.
|
overrideprivatevirtual |
Write the object to one or more catalogs.
The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 1048 of file SpanSet.cc.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 29 of file Persistable.cc.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 24 of file Persistable.cc.