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
Public Types | Public Member Functions | Private Attributes | List of all members
lsst::meas::base::SdssShapeTransform Class Reference

#include <SdssShape.h>

Inheritance diagram for lsst::meas::base::SdssShapeTransform:
lsst::meas::base::BaseTransform

Public Types

typedef SdssShapeControl Control
 

Public Member Functions

 SdssShapeTransform (Control const &ctrl, std::string const &name, afw::table::SchemaMapper &mapper)
 
virtual void operator() (afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::image::Wcs const &wcs, afw::image::Calib const &calib) const
 
- Public Member Functions inherited from lsst::meas::base::BaseTransform
 BaseTransform (std::string const &name)
 
virtual ~BaseTransform ()
 

Private Attributes

FluxTransform _fluxTransform
 
CentroidTransform _centroidTransform
 
ShapeResultKey _outShapeKey
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::meas::base::BaseTransform
void checkCatalogSize (afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
 Ensure that catalogs have the same size. More...
 
- Protected Attributes inherited from lsst::meas::base::BaseTransform
std::string _name
 

Detailed Description

Transformation for SdssShape measurements.

SdssShape measures not just shape but also flux and centroid. This transform operates on the first directly, and delegates to the Flux and Centroid transforms for the other two.

Definition at line 235 of file SdssShape.h.

Member Typedef Documentation

Definition at line 237 of file SdssShape.h.

Constructor & Destructor Documentation

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

Definition at line 904 of file SdssShape.cc.

908  :
910  _fluxTransform{name, mapper},
911  _centroidTransform{name, mapper}
912 {
913  for (auto flag = flagDefs.begin() + 1; flag < flagDefs.end(); flag++) {
914  mapper.addMapping(mapper.getInputSchema().find<afw::table::Flag>(
915  mapper.getInputSchema().join(name, flag->name)).key);
916  }
917 
918  _outShapeKey = ShapeResultKey::addFields(mapper.editOutputSchema(), name, "Shape in celestial moments",
920 }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
CentroidTransform _centroidTransform
Definition: SdssShape.h:256
The full covariance matrix is provided.
Definition: constants.h:44
BaseTransform(std::string const &name)
Definition: Transform.h:85
static ShapeResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty, afw::table::CoordinateType coordType=afw::table::CoordinateType::PIXEL)
Add the appropriate fields to a Schema, and return a ShapeResultKey that manages them.

Member Function Documentation

void lsst::meas::base::SdssShapeTransform::operator() ( afw::table::SourceCatalog const &  inputCatalog,
afw::table::BaseCatalog outputCatalog,
afw::image::Wcs const &  wcs,
afw::image::Calib const &  calib 
) const
virtual

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

Definition at line 922 of file SdssShape.cc.

927  {
928  // The flux and cetroid transforms will check that the catalog lengths
929  // match and throw if not, so we don't repeat the test here.
930  _fluxTransform(inputCatalog, outputCatalog, wcs, calib);
931  _centroidTransform(inputCatalog, outputCatalog, wcs, calib);
932 
933  CentroidResultKey centroidKey(inputCatalog.getSchema()[_name]);
934  ShapeResultKey inShapeKey(inputCatalog.getSchema()[_name]);
935 
936  afw::table::SourceCatalog::const_iterator inSrc = inputCatalog.begin();
937  afw::table::BaseCatalog::iterator outSrc = outputCatalog.begin();
938  for (; inSrc != inputCatalog.end(); ++inSrc, ++outSrc) {
939  ShapeResult inShape = inShapeKey.get(*inSrc);
940  ShapeResult outShape;
941 
942  // The transformation from the (x, y) to the (Ra, Dec) basis.
943  afw::geom::AffineTransform crdTr = wcs.linearizePixelToSky(centroidKey.get(*inSrc).getCentroid(),
945  outShape.setShape(inShape.getShape().transform(crdTr.getLinear()));
946 
947  // Transformation matrix from pixel to celestial basis.
948  ShapeTrMatrix m = makeShapeTransformMatrix(crdTr.getLinear());
949  outShape.setShapeErr((m*inShape.getShapeErr().cast<double>()*m.transpose()).cast<ErrElement>());
950 
951  _outShapeKey.set(*outSrc, outShape);
952  }
953 }
ShapeTrMatrix makeShapeTransformMatrix(afw::geom::LinearTransform const &xform)
Construct a matrix suitable for transforming second moments.
CentroidTransform _centroidTransform
Definition: SdssShape.h:256
tbl::Key< int > wcs
virtual void set(afw::table::BaseRecord &record, ShapeResult const &value) const
Set a ShapeResult in the given record.
AngleUnit const radians
constant with units of radians
Definition: Angle.h:91
tuple m
Definition: lsstimport.py:48
Base::const_iterator const_iterator
Definition: SortedCatalog.h:49
Eigen::Matrix< ShapeElement, 3, 3, Eigen::DontAlign > ShapeTrMatrix
Definition: constants.h:60
CatalogIterator< typename Internal::iterator > iterator
Definition: Catalog.h:107

Member Data Documentation

CentroidTransform lsst::meas::base::SdssShapeTransform::_centroidTransform
private

Definition at line 256 of file SdssShape.h.

FluxTransform lsst::meas::base::SdssShapeTransform::_fluxTransform
private

Definition at line 255 of file SdssShape.h.

ShapeResultKey lsst::meas::base::SdssShapeTransform::_outShapeKey
private

Definition at line 257 of file SdssShape.h.


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