LSST Applications g034a557a3c+dd8dd8f11d,g0afe43252f+b86e4b8053,g11f7dcd041+017865fdd3,g1cd03abf6b+8446defddb,g1ce3e0751c+f991eae79d,g28da252d5a+ca8a1a9fb3,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g7f3b0d46df+ad13c1b82d,g80478fca09+f29c5d6c70,g858d7b2824+293f439f82,g8cd86fa7b1+af721d2595,g965a9036f2+293f439f82,g979bb04a14+51ed57f74c,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gbb886bcc26+b97e247655,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gcaf7e4fdec+293f439f82,gcd45df26be+293f439f82,gcdd4ae20e8+70b5def7e6,gce08ada175+da9c58a417,gcf0d15dbbd+70b5def7e6,gdaeeff99f8+006e14e809,gdbce86181e+6a170ce272,ge3d4d395c2+224150c836,ge5f7162a3a+bb2241c923,ge6cb8fbbf7+d119aed356,ge79ae78c31+b6588ad223,gf048a9a2f4+40ffced2b8,gf0baf85859+b4cca3d10f,w.2024.30
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst::meas::base::SdssCentroidTransform Class Reference

#include <SdssCentroid.h>

Inheritance diagram for lsst::meas::base::SdssCentroidTransform:
lsst::meas::base::CentroidTransform lsst::meas::base::BaseTransform

Public Types

typedef SdssCentroidControl Control
 

Public Member Functions

 SdssCentroidTransform (Control const &ctrl, std::string const &name, afw::table::SchemaMapper &mapper)
 
virtual void operator() (afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs, afw::image::PhotoCalib const &photoCalib) const
 

Protected Member Functions

void checkCatalogSize (afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
 Ensure that catalogs have the same size.
 

Protected Attributes

std::string _name
 

Detailed Description

Definition at line 101 of file SdssCentroid.h.

Member Typedef Documentation

◆ Control

Definition at line 103 of file SdssCentroid.h.

Constructor & Destructor Documentation

◆ SdssCentroidTransform()

lsst::meas::base::SdssCentroidTransform::SdssCentroidTransform ( Control const & ctrl,
std::string const & name,
afw::table::SchemaMapper & mapper )

Definition at line 527 of file SdssCentroid.cc.

531 FlagDefinition const &flag = SdssCentroidAlgorithm::getFlagDefinitions()[i];
532 if (flag == SdssCentroidAlgorithm::FAILURE) continue;
533 if (mapper.getInputSchema().getNames().count(mapper.getInputSchema().join(name, flag.name)) == 0)
534 continue;
535 afw::table::Key<afw::table::Flag> key =
536 mapper.getInputSchema().find<afw::table::Flag>(name + "_" + flag.name).key;
537 mapper.addMapping(key);
538 }
539}
table::Key< std::string > name
Definition Amplifier.cc:116
SchemaMapper * mapper
CentroidTransform(std::string const &name, afw::table::SchemaMapper &mapper)
std::size_t size() const
return the current size (number of defined elements) of the collection
static FlagDefinition const FAILURE
static FlagDefinitionList const & getFlagDefinitions()

Member Function Documentation

◆ checkCatalogSize()

void lsst::meas::base::BaseTransform::checkCatalogSize ( afw::table::BaseCatalog const & cat1,
afw::table::BaseCatalog const & cat2 ) const
inlineprotectedinherited

Ensure that catalogs have the same size.

Parameters
[in]cat1Catalog for comparison
[in]cat2Catalog for comparison
Exceptions
LengthErrorCatalog sizes do not match

Definition at line 102 of file Transform.h.

102 {
103 if (cat1.size() != cat2.size()) {
104 throw LSST_EXCEPT(pex::exceptions::LengthError, "Catalog size mismatch");
105 }
106 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48

◆ operator()()

void lsst::meas::base::CentroidTransform::operator() ( afw::table::SourceCatalog const & inputCatalog,
afw::table::BaseCatalog & outputCatalog,
afw::geom::SkyWcs const & wcs,
afw::image::PhotoCalib const & photoCalib ) const
virtualinherited

Implements lsst::meas::base::BaseTransform.

Definition at line 144 of file CentroidUtilities.cc.

146 {
147 checkCatalogSize(inputCatalog, outputCatalog);
148 CentroidResultKey centroidResultKey(inputCatalog.getSchema()[_name]);
149
150 afw::table::SourceCatalog::const_iterator inSrc = inputCatalog.begin();
151 afw::table::BaseCatalog::iterator outSrc = outputCatalog.begin();
152
153 for (; inSrc != inputCatalog.end() && outSrc != outputCatalog.end(); ++inSrc, ++outSrc) {
154 CentroidResult centroidResult = centroidResultKey.get(*inSrc);
155
156 _coordKey.set(*outSrc, wcs.pixelToSky(centroidResult.getCentroid()));
157
158 if (centroidResultKey.getCentroidErr().isValid()) {
159 CentroidCov centroidCov = centroidResult.getCentroidErr();
160 if (!(std::isnan(centroidCov(0, 0)) || std::isnan(centroidCov(1, 1)))) {
161 auto transform = wcs.linearizePixelToSky(centroidResult.getCentroid(), geom::radians)
162 .getLinear()
163 .getMatrix();
164 _coordErrKey.set(*outSrc, (transform * centroidResult.getCentroidErr().cast<double>() *
165 transform.transpose())
166 .cast<ErrElement>());
167 }
168 }
169 }
170}
CatalogIterator< typename Internal::iterator > iterator
Definition Catalog.h:110
void set(BaseRecord &record, lsst::geom::SpherePoint const &value) const override
Set an lsst::geom::SpherePoint in the given record.
void set(BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const override
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix)
typename Base::const_iterator const_iterator
void checkCatalogSize(afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
Ensure that catalogs have the same size.
Definition Transform.h:102
T isnan(T... args)
AngleUnit constexpr radians
constant with units of radians
Definition Angle.h:109
Eigen::Matrix< ErrElement, 2, 2, Eigen::DontAlign > CentroidCov
Definition constants.h:59

Member Data Documentation

◆ _name

std::string lsst::meas::base::BaseTransform::_name
protectedinherited

Definition at line 107 of file Transform.h.


The documentation for this class was generated from the following files: