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
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
Include files required for standard LSST Exception handling.
tbl::Key< int > wcs
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
size_type size() const
Return the number of elements in the catalog.
Definition: Catalog.h:401
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