lsst.afw  16.0-61-g8d4b44b59+2
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  ApCorrMap() = default;
56  ApCorrMap(ApCorrMap const&) = default;
57  ApCorrMap(ApCorrMap&&) = default;
58  ApCorrMap& operator=(ApCorrMap const&) = default;
59  ApCorrMap& operator=(ApCorrMap&&) = default;
60  ~ApCorrMap() override = default;
61 
62  Iterator begin() const { return _internal.begin(); }
63  Iterator end() const { return _internal.end(); }
64 
65  std::size_t size() const { return _internal.size(); }
66 
69 
72 
75 
77  bool isPersistable() const noexcept override;
78 
80  ApCorrMap& operator*=(double const scale);
81  ApCorrMap& operator/=(double const scale) { return *this *= 1.0 / scale; }
82 
83 private:
84  std::string getPersistenceName() const override;
85 
86  std::string getPythonModule() const override;
87 
88  void write(OutputArchiveHandle& handle) const override;
89 
90  Internal _internal;
91 };
92 } // namespace image
93 } // namespace afw
94 } // namespace lsst
95 
96 #endif // !LSST_AFW_IMAGE_ApCorrMap_h_INCLUDED
Iterator begin() const
Definition: ApCorrMap.h:62
static std::size_t const MAX_NAME_LENGTH
Maximum number of characters for an aperture correction name (required for persistence).
Definition: ApCorrMap.h:49
Iterator end() const
Definition: ApCorrMap.h:63
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:114
ApCorrMap & operator*=(double const scale)
Scale all fields by a constant.
Definition: ApCorrMap.cc:140
T end(T... args)
ApCorrMap & operator=(ApCorrMap const &)=default
STL class.
STL class.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
std::size_t size() const
Definition: ApCorrMap.h:65
A base class for image defects.
~ApCorrMap() override=default
T size(T... args)
bool isPersistable() const noexcept override
Whether the map is persistable (true IFF all contained BoundedFields are persistable).
Definition: ApCorrMap.cc:118
T begin(T... args)
ApCorrMap & operator/=(double const scale)
Definition: ApCorrMap.h:81
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:44
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:176
table::Key< int > field
Definition: ApCorrMap.cc:77