lsst.afw  14.0-25-g0e8fc950e+7
ApCorrMap.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2014 LSST Corporation.
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_AFW_IMAGE_ApCorrMap_h_INCLUDED
25 #define LSST_AFW_IMAGE_ApCorrMap_h_INCLUDED
26 
27 #include <string>
28 #include <map>
29 
32 
33 namespace lsst {
34 namespace afw {
35 namespace image {
36 
46 
47 public:
49  static std::size_t const MAX_NAME_LENGTH = 64;
50 
53  typedef Internal::const_iterator Iterator;
54 
55  Iterator begin() const { return _internal.begin(); }
56  Iterator end() const { return _internal.end(); }
57 
58  std::size_t size() const { return _internal.size(); }
59 
62 
65 
68 
70  virtual bool isPersistable() const;
71 
73  ApCorrMap& operator*=(double const scale);
74  ApCorrMap& operator/=(double const scale) { return *this *= 1.0 / scale; }
75 
76 private:
77  virtual std::string getPersistenceName() const;
78 
79  virtual std::string getPythonModule() const;
80 
81  virtual void write(OutputArchiveHandle& handle) const;
82 
83  Internal _internal;
84 };
85 }
86 }
87 } // lsst::afw::image
88 
89 #endif // !LSST_AFW_IMAGE_ApCorrMap_h_INCLUDED
Iterator begin() const
Definition: ApCorrMap.h:55
static std::size_t const MAX_NAME_LENGTH
Maximum number of characters for an aperture correction name (required for persistence).
Definition: ApCorrMap.h:49
table::Key< std::string > name
Definition: ApCorrMap.cc:71
virtual bool isPersistable() const
Whether the map is persistable (true IFF all contained BoundedFields are persistable).
Definition: ApCorrMap.cc:113
Iterator end() const
Definition: ApCorrMap.h:56
An object passed to Persistable::write to allow it to persist itself.
A thin wrapper around std::map to allow aperture corrections to be attached to Exposures.
Definition: ApCorrMap.h:44
def scale(algorithm, min, max=None, frame=None)
Definition: ds9.py:117
ApCorrMap & operator*=(double const scale)
Scale all fields by a constant.
Definition: ApCorrMap.cc:135
T end(T... args)
STL class.
STL class.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:73
std::size_t size() const
Definition: ApCorrMap.h:58
A base class for image defects.
T size(T... args)
T begin(T... args)
ApCorrMap & operator/=(double const scale)
Definition: ApCorrMap.h:74
Internal::const_iterator Iterator
Iterator type returned by begin() and end().
Definition: ApCorrMap.h:53
std::shared_ptr< math::BoundedField > const operator[](std::string const &name) const
Return the field with the given name, throwing NotFoundError when the name is not present...
Definition: ApCorrMap.cc:39
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:173
table::Key< int > field
Definition: ApCorrMap.cc:72