LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
ShapeletPsfCandidate.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_MEAS_ALGORITHMS_SHAPELETPSFCANDIDATE_H
3 #define LSST_MEAS_ALGORITHMS_SHAPELETPSFCANDIDATE_H
4 /*
5  * LSST Data Management System
6  * Copyright 2008, 2009, 2010 LSST Corporation.
7  *
8  * This product includes software developed by the
9  * LSST Project (http://www.lsst.org/).
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the LSST License Statement and
22  * the GNU General Public License along with this program. If not,
23  * see <http://www.lsstcorp.org/LegalNotices/>.
24  */
25 
35 #include "lsst/afw/table/Source.h"
36 #include "boost/shared_ptr.hpp"
37 
38 namespace lsst {
39 namespace meas {
40 namespace algorithms {
41 
44  {
45  public :
48 
49  typedef boost::shared_ptr<ShapeletPsfCandidate> Ptr;
50  typedef boost::shared_ptr<const ShapeletPsfCandidate> ConstPtr;
51 
78  double x,
79  double y,
80  double size,
81  PTR(Source) source
82  ) :
83  base(x,y), _size(size), _source(source), _rating(1.)
84  {}
85 
89  inline void setShapelet(Shapelet::ConstPtr shapelet)
90  {
91  _shapelet = shapelet;
92  if (_shapelet->hasCovariance())
93  _rating = _shapelet->getValues()(0) / sqrt((*_shapelet->getCovariance())(0,0));
94  }
95 
99  inline double getX() const { return base::getXCenter(); }
100  inline double getY() const { return base::getYCenter(); }
101 
105  inline double getSize() const { return _size; }
106 
110  inline PTR(Source) getSource() const
111  {
112  assert(_source);
113  return _source;
114  }
115 
120  {
121  assert(_shapelet);
122  return _shapelet;
123  }
124 
128  inline bool hasShapelet() const { return static_cast<bool>(_shapelet); }
129 
133  inline double getCandidateRating() const { return _rating; }
134 
143  inline void setBad()
144  {
147  }
148 
149  private :
150 
151  double _size;
154  double _rating;
155  };
156 
157 }}}
158 
159 #endif
int y
void setStatus(Status status)
Set the candidate&#39;s status.
Definition: SpatialCell.cc:61
lsst::afw::math::SpatialCellCandidate base
float getYCenter() const
Return the object&#39;s row-centre.
Definition: SpatialCell.h:98
#define PTR(...)
Definition: base.h:41
boost::shared_ptr< const SpatialCellCandidate > ConstPtr
Definition: SpatialCell.h:77
boost::shared_ptr< const Shapelet > ConstPtr
Definition: Shapelet.h:95
ShapeletPsfCandidate(double x, double y, double size, boost::shared_ptr< Source > source)
Constructor takes position, size, and original source.
void setShapelet(Shapelet::ConstPtr shapelet)
Set the shapelet decomposition.
boost::shared_ptr< const ShapeletPsfCandidate > ConstPtr
boost::shared_ptr< ShapeletPsfCandidate > Ptr
Shapelet::ConstPtr getShapelet() const
Get the shapelet decomposition.
float getXCenter() const
Return the object&#39;s column-centre.
Definition: SpatialCell.h:95
boost::shared_ptr< Source > getSource() const
Get source.
double x
double getCandidateRating() const
Define &quot;goodness&quot; of candidate for SpatialCell.
bool hasShapelet() const
Check if shapelet decomposition is set.
Class to ensure constraints for spatial modeling.
Record class that contains measurements made on a single exposure.
Definition: Source.h:81
void setBad()
Mark the candidate as BAD.