LSST Applications g02d81e74bb+86cf3d8bc9,g180d380827+7a4e862ed4,g2079a07aa2+86d27d4dc4,g2305ad1205+e1ca1c66fa,g29320951ab+012e1474a1,g295015adf3+341ea1ce94,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+c429d67c83,g48712c4677+f88676dd22,g487adcacf7+27e1e21933,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+b41db86c35,g5a732f18d5+53520f316c,g64a986408d+86cf3d8bc9,g858d7b2824+86cf3d8bc9,g8a8a8dda67+585e252eca,g99cad8db69+84912a7fdc,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+a2b54eae19,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6681f309db,gc120e1dc64+f0fcc2f6d8,gc28159a63d+0e5473021a,gcf0d15dbbd+c429d67c83,gdaeeff99f8+f9a426f77a,ge6526c86ff+0433e6603d,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+86cf3d8bc9,w.2024.17
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: