LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
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/image.h"
34 #include "lsst/afw/table.h"
35 #include "lsst/pex/exceptions.h"
36 
37 namespace lsst { namespace meas { namespace base {
38 
83 public:
84 
85  explicit BaseTransform(std::string const & name) : _name(name) {}
86  virtual ~BaseTransform() {}
87  virtual void operator()(afw::table::SourceCatalog const & inputCatalog,
88  afw::table::BaseCatalog & outputCatalog,
89  afw::image::Wcs const & wcs,
90  afw::image::Calib const & calib) const = 0;
91 
92 protected:
93 
102  afw::table::BaseCatalog const & cat2) const {
103  if (cat1.size() != cat2.size()) {
104  throw LSST_EXCEPT(pex::exceptions::LengthError, "Catalog size mismatch");
105  }
106  }
107  std::string _name;
108 };
109 
110 }}} // namespace lsst::meas::base
111 
112 #endif // !LSST_MEAS_BASE_Transform_h_INCLUDED
table::Key< std::string > name
Definition: ApCorrMap.cc:71
A custom container class for records, based on std::vector.
Definition: Catalog.h:94
void checkCatalogSize(afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
Ensure that catalogs have the same size.
Definition: Transform.h:101
tbl::Key< int > wcs
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
BaseTransform(std::string const &name)
Definition: Transform.h:85
An include file to include the header files for lsst::afw::image.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
Definition: fwd.h:55
virtual void operator()(afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::image::Wcs const &wcs, afw::image::Calib const &calib) const =0
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Include files required for standard LSST Exception handling.
size_type size() const
Return the number of elements in the catalog.
Definition: Catalog.h:401