LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
29 #ifndef LSST_AFW_MATH_SPATIALCELL_H
30 #define LSST_AFW_MATH_SPATIALCELL_H
47 template <
typename ImagePixelT>
49 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
56 class SpatialCellCandidate;
77 : _id(++_CandidateId), _status(
UNKNOWN), _xCenter(xCenter), _yCenter(yCenter) {}
110 virtual bool isBad()
const {
return (_status ==
BAD); }
115 float const _xCenter;
116 float const _yCenter;
119 static int _CandidateId;
140 static void setWidth(
int width) { _width = width; }
208 bool ignoreBad,
bool);
211 CandidateList::iterator _iterator;
212 CandidateList::iterator _end;
335 bool const ignoreExceptions =
false,
bool const reset =
true);
350 bool const ignoreExceptions =
false,
bool const reset =
true)
const;
361 bool const reset =
true);
375 bool const reset =
true)
const;
442 bool const ignoreExceptions =
false);
453 bool const ignoreExceptions =
false)
const;
void visitCandidates(CandidateVisitor *visitor, int const nMaxPerCell=-1, bool const ignoreExceptions=false, bool const reset=true)
Call the visitor's processCandidate method for each Candidate in the SpatialCell.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
virtual ~SpatialCellSet()=default
Destructor.
Base class for candidate objects in a SpatialCell.
void insertCandidate(std::shared_ptr< SpatialCellCandidate > candidate)
Add a candidate to the list, preserving ranking.
SpatialCellImageCandidate & operator=(SpatialCellImageCandidate const &)=default
void setIgnoreBad(bool ignoreBad)
Set whether we should omit BAD candidates from candidate list when traversing.
SpatialCell & operator=(SpatialCell const &)=default
std::shared_ptr< SpatialCellCandidate > getCandidateById(int id, bool noThrow=false)
Return the SpatialCellCandidate with the specified id.
void setStatus(Status status)
Set the candidate's status.
SpatialCellImageCandidate(float const xCenter, float const yCenter)
ctor
void setIgnoreBad(bool ignoreBad)
Set whether we should omit BAD candidates from candidate list when traversing.
void insertCandidate(std::shared_ptr< SpatialCellCandidate > candidate)
Insert a candidate into the correct cell.
lsst::geom::Box2I const & getBBox() const
Get SpatialCell's BBox.
virtual ~SpatialCell()=default
Destructor.
SpatialCellCandidateIterator begin()
Return an iterator to the beginning of the Candidates.
~SpatialCellImageCandidate() override=default
void visitAllCandidates(CandidateVisitor *visitor, bool const ignoreExceptions=false)
Call the visitor's processCandidate method for every Candidate in the SpatialCellSet.
std::vector< std::shared_ptr< SpatialCellCandidate > > CandidateList
SpatialCellCandidate & operator=(SpatialCellCandidate const &)=default
void operator++()
Advance the iterator, maybe skipping over candidates labelled BAD.
SpatialCellCandidate & operator=(SpatialCellCandidate &&)=default
bool operator!=(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators unequal?
virtual bool isBad() const
Is this candidate unacceptable?
virtual double getCandidateRating() const =0
Return candidate's rating.
SpatialCell & operator=(SpatialCell &&)=default
void visitCandidates(CandidateVisitor *visitor, int const nMaxPerCell=-1, bool const ignoreExceptions=false)
Call the visitor's processCandidate method for each Candidate in the SpatialCellSet.
bool operator==(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators equal?
static void setWidth(int width)
Set the width of the image that getImage should return.
lsst::geom::Box2I getBBox() const
Return the bounding box of the image.
size_t operator-(SpatialCellCandidateIterator const &rhs) const
Return the number of candidate between this and rhs.
std::string const & getLabel() const
Get SpatialCell's label.
SpatialCellSet(SpatialCellSet const &)=default
SpatialCell(std::string const &label, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), CandidateList const &candidateList=CandidateList())
Constructor.
float getXCenter() const
Return the object's column-centre.
SpatialCellSet(SpatialCellSet &&)=default
SpatialCellCandidate(SpatialCellCandidate const &)=default
void visitAllCandidates(CandidateVisitor *visitor, bool const ignoreExceptions=false, bool const reset=true)
Call the visitor's processCandidate method for every Candidate in the SpatialCell.
SpatialCellCandidate(SpatialCellCandidate &&)=default
Class to ensure constraints for spatial modeling.
Base class for candidate objects in a SpatialCell that are able to return an Image of some sort (e....
SpatialCellCandidateIterator end(bool ignoreBad)
static int getWidth()
Return the width of the image that getImage should return.
SpatialCell(SpatialCell &&)=default
An iterator that only returns usable members of the SpatialCell.
SpatialCellSet & operator=(SpatialCellSet const &)=default
SpatialCellSet(lsst::geom::Box2I const ®ion, int xSize, int ySize=0)
Constructor.
CellList & getCellList()
Return our SpatialCells.
virtual bool instantiate()
Do anything needed to make this candidate usable.
void setChi2(double chi2)
Set the candidate's chi^2.
SpatialCellCandidateIterator(CandidateList::iterator iterator, CandidateList::iterator end, bool ignoreBad)
ctor; designed to be used to pass begin to SpatialCellCandidateIterator
int getId() const
Return the candidate's unique ID.
SpatialCellImageCandidate(SpatialCellImageCandidate &&)=default
std::shared_ptr< SpatialCellCandidate const > operator*() const
Dereference the iterator to return the Candidate (if there is one)
void removeCandidate(std::shared_ptr< SpatialCellCandidate > candidate)
Remove a candidate from the list.
virtual ~CandidateVisitor()
A base class for image defects.
virtual void processCandidate(SpatialCellCandidate *)
void sortCandidates()
Rearrange the Candidates in all SpatialCells to reflect their current ratings.
static int getHeight()
Return the height of the image that getImage should return.
std::vector< std::shared_ptr< SpatialCell > > CellList
SpatialCellImageCandidate(SpatialCellImageCandidate const &)=default
Status getStatus() const
Return the candidate's status.
SpatialCellCandidateIterator end()
Return an iterator to (one after) the end of the Candidates.
void sortCandidates()
Rearrange the candidates to reflect their current ratings.
std::shared_ptr< SpatialCellCandidate > getCandidateById(int id, bool noThrow=false)
Return the SpatialCellCandidate with the specified id.
bool empty() const
Determine if cell has no usable candidates.
An integer coordinate rectangle.
SpatialCellCandidateIterator begin(bool ignoreBad)
static void setHeight(int height)
Set the height of the image that getImage should return.
bool getIgnoreBad() const
Get whether we are omitting BAD candidates from candidate list when traversing.
virtual void setCandidateRating(double)
Set the candidate's rating.
A collection of SpatialCells covering an entire image.
size_t size() const
Return number of usable candidates in Cell.
SpatialCell(SpatialCell const &)=default
SpatialCellCandidate(float const xCenter, float const yCenter)
SpatialCellCandidateIterator iterator
SpatialCellImageCandidate & operator=(SpatialCellImageCandidate &&)=default
float getYCenter() const
Return the object's row-centre.
SpatialCellSet & operator=(SpatialCellSet &&)=default
double getChi2() const
Return the candidate's chi^2.
virtual ~SpatialCellCandidate()=default
(virtual) destructor – this is a base class you know