LSSTApplications  18.1.0
LSSTDataManagementBasePackage
PixelScaleBoundedField.cc
Go to the documentation of this file.
1 /*
2  * This file is part of afw.
3  *
4  * Developed for the LSST Data Management System.
5  * This product includes software developed by the LSST Project
6  * (https://www.lsst.org).
7  * See the COPYRIGHT file at the top-level directory of this distribution
8  * for details of code ownership.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
25 
26 namespace lsst {
27 namespace afw {
28 namespace math {
29 
31  return std::pow(_skyWcs.getPixelScale(position).asDegrees(), 2) * _inverseScale;
32 }
33 
35  auto rhsCasted = dynamic_cast<PixelScaleBoundedField const *>(&rhs);
36  if (!rhsCasted) return false;
37 
38  return getBBox() == rhsCasted->getBBox() && getSkyWcs() == rhsCasted->getSkyWcs();
39 }
40 
41 std::string PixelScaleBoundedField::toString() const {
43  os << "PixelScaleBoundedField(" << _skyWcs << ")";
44  return os.str();
45 }
46 
47 } // namespace math
48 } // namespace afw
49 } // namespace lsst
constexpr double asDegrees() const noexcept
Return an Angle&#39;s value in degrees.
Definition: Angle.h:169
bool operator==(BoundedField const &rhs) const override
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal...
lsst::geom::Angle getPixelScale(lsst::geom::Point2D const &pixel) const
Get the pixel scale at the specified pixel position.
Definition: SkyWcs.cc:164
geom::SkyWcs const & getSkyWcs() const
Get the contained SkyWcs.
STL class.
A BoundedField that gives the amount a pixel is distorted at each point.
A base class for image defects.
lsst::geom::Box2I getBBox() const
Return the bounding box that defines the region where the field is valid.
Definition: BoundedField.h:112
T str(T... args)
double evaluate(lsst::geom::Point2D const &position) const override
Evaluate the field at the given point.
T pow(T... args)
An abstract base class for 2-d functions defined on an integer bounding boxes.
Definition: BoundedField.h:55
A BoundedField that gives the amount a pixel is distorted at each point.
std::ostream * os
Definition: Schema.cc:746