LSST Applications  21.0.0-1-g8760c09+3ec9fa6d59,21.0.0-1-ga51b5d4+1a3c9f8315,21.0.0-13-g5daad6e+0252c796d2,21.0.0-14-g07a2928+6d2a161833,21.0.0-15-g543e7c3+e1f44b4e8b,21.0.0-15-g5a7caf0+22a63f14ab,21.0.0-15-ge3888ae+e70bf517f6,21.0.0-17-g8839fe5+10be924b4e,21.0.0-2-g103fe59+bd743ba87f,21.0.0-2-g45278ab+3ec9fa6d59,21.0.0-2-g5242d73+8a658b4ab3,21.0.0-2-g7f82c8f+82148d848c,21.0.0-2-g8faa9b5+a13d88a6a5,21.0.0-2-ga326454+82148d848c,21.0.0-2-gde069b7+135055f2fa,21.0.0-2-gecfae73+e9d3d7b02c,21.0.0-2-gfc62afb+8a658b4ab3,21.0.0-20-g35aa1e9+9ea05e3f8d,21.0.0-20-g8cd22d88+4d45a66d02,21.0.0-3-g357aad2+262bd63c8d,21.0.0-3-g4a4ce7f+8a658b4ab3,21.0.0-3-g4be5c26+8a658b4ab3,21.0.0-3-g65f322c+de03c300eb,21.0.0-3-ge02ed75+6d2a161833,21.0.0-30-gf21da11f8+33ac405c47,21.0.0-4-g591bb35+6d2a161833,21.0.0-4-g65b4814+10be924b4e,21.0.0-4-ge8a399c+4af7134804,21.0.0-5-g8c1d971+75b22be884,21.0.0-5-gcb07a25+7075ac2890,21.0.0-5-gcc89fd6+a13d88a6a5,21.0.0-5-gd00fb1e+2d6d6ce00a,21.0.0-6-gc675373+8a658b4ab3,21.0.0-7-gdf92d54+3ec9fa6d59,21.0.0-72-gffa78901+7884a7f5e9,21.0.0-8-g5674e7b+3979a46207,21.0.0-8-g72414d6+74174446e7,master-gac4afde19b+6d2a161833,w.2021.16
LSST Data Management Base Package
Transform.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2015 AURA/LSST.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 
24 #ifndef LSST_MEAS_BASE_Transform_h_INCLUDED
25 #define LSST_MEAS_BASE_Transform_h_INCLUDED
26 
32 #include <string>
33 #include "lsst/afw/geom.h"
34 #include "lsst/afw/image.h"
36 #include "lsst/afw/table.h"
37 #include "lsst/pex/exceptions.h"
38 
39 namespace lsst {
40 namespace meas {
41 namespace base {
42 
87 public:
88  explicit BaseTransform(std::string const& name) : _name(name) {}
89  virtual ~BaseTransform() {}
90  virtual void operator()(afw::table::SourceCatalog const& inputCatalog,
91  afw::table::BaseCatalog& outputCatalog, afw::geom::SkyWcs const& wcs,
92  afw::image::PhotoCalib const& photoCalib) const = 0;
93 
94 protected:
102  void checkCatalogSize(afw::table::BaseCatalog const& cat1, afw::table::BaseCatalog const& cat2) const {
103  if (cat1.size() != cat2.size()) {
104  throw LSST_EXCEPT(pex::exceptions::LengthError, "Catalog size mismatch");
105  }
106  }
108 };
109 
110 } // namespace base
111 } // namespace meas
112 } // namespace lsst
113 
114 #endif // !LSST_MEAS_BASE_Transform_h_INCLUDED
table::Key< std::string > name
Definition: Amplifier.cc:116
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
Implementation of the Photometric Calibration class.
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Definition: SkyWcs.h:117
The photometric calibration of an exposure.
Definition: PhotoCalib.h:114
size_type size() const
Return the number of elements in the catalog.
Definition: Catalog.h:409
Abstract base class for all C++ measurement transformations.
Definition: Transform.h:86
virtual void operator()(afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs, afw::image::PhotoCalib const &photoCalib) const =0
void checkCatalogSize(afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
Ensure that catalogs have the same size.
Definition: Transform.h:102
BaseTransform(std::string const &name)
Definition: Transform.h:88
Reports attempts to exceed implementation-defined length limits for some classes.
Definition: Runtime.h:76
A base class for image defects.
Key< int > photoCalib
Definition: Exposure.cc:67