lsst.afw
g3a5ebb7d8a+28b83bf6a5
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
afw
geom
SipApproximation.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
/*
3
* Developed for the LSST Data Management System.
4
* This product includes software developed by the LSST Project
5
* (https://www.lsst.org).
6
* See the COPYRIGHT file at the top-level directory of this distribution
7
* for details of code ownership.
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 GNU General Public License
20
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21
*/
22
23
#ifndef LSST_AFW_GEOM_SipApproximation_h_INCLUDED
24
#define LSST_AFW_GEOM_SipApproximation_h_INCLUDED
25
26
#include <memory>
27
#include <optional>
28
#include <vector>
29
30
#include "Eigen/Core"
31
32
#include "
lsst/afw/geom/SkyWcs.h
"
33
#include "
lsst/geom/Box.h
"
34
#include "
lsst/geom/LinearTransform.h
"
35
36
namespace
lsst
{
namespace
afw
{
namespace
geom
{
37
89
class
SipApproximation
final {
90
public
:
91
116
SipApproximation
(
117
SkyWcs
const
& target,
118
lsst::geom::Box2D
const
& bbox,
119
lsst::geom::Extent2I
const
& gridShape,
120
int
order = 5,
121
std::optional<lsst::geom::Point2D>
const
& pixelOrigin = std::nullopt,
122
double
svdThreshold=-1
123
);
124
125
// No copies just because they'd be a pain to implement and probably aren't necessary
126
SipApproximation
(
SipApproximation
const
&) =
delete
;
127
SipApproximation
&
operator=
(
SipApproximation
const
&) =
delete
;
128
129
// Moves are fine.
130
SipApproximation
(
SipApproximation
&&) noexcept = default;
131
SipApproximation
& operator=(
SipApproximation
&&) noexcept = default;
132
133
// Needs to be defined in .cc, where compiler can see the definitions of forward-declared
134
// private implementation classes.
135
~
SipApproximation
() noexcept;
136
138
int
getOrder
() const noexcept;
139
147
double
getA
(
int
p,
int
q) const;
148
156
double
getB
(
int
p,
int
q) const;
157
159
Eigen::MatrixXd
getA
() const;
160
162
Eigen::MatrixXd
getB
() const;
163
165
lsst
::
geom
::
Box2D
getBBox
() const noexcept {
return
_bbox; }
166
168
lsst::geom::SpherePoint
getSkyOrigin
() const noexcept {
return
_skyOrigin; }
169
171
lsst::geom::Point2D
getPixelOrigin
() const noexcept {
return
lsst::geom::Point2D
(_pixelOrigin); }
172
174
Eigen::Matrix2d
getCdMatrix
() const noexcept;
175
177
std
::shared_ptr<
SkyWcs
>
getWcs
() const noexcept;
178
190
std
::pair<
lsst
::
geom
::Angle,
double
>
computeDeltas
() const;
191
192
private:
193
194
struct FitGrid;
195
struct ValidationGrid;
196
struct Solution;
197
198
lsst
::
geom
::
Box2D
_bbox;
199
lsst
::
geom
::Point2D _pixelOrigin;
200
lsst
::
geom
::SpherePoint _skyOrigin;
201
std
::unique_ptr<FitGrid const> _fitGrid;
202
std
::unique_ptr<ValidationGrid const> _validationGrid;
203
std
::unique_ptr<Solution const> _solution;
204
std
::shared_ptr<
SkyWcs
> _wcs;
205
};
206
207
}}}
// namespace lsst::afw::geom
208
209
#endif
// !LSST_AFW_GEOM_SipApproximation_h_INCLUDED
Box.h
LinearTransform.h
SkyWcs.h
lsst::afw::geom::SipApproximation::getBBox
lsst::geom::Box2D getBBox() const noexcept
Return the pixel-coordinate bounding box over which the approximation should be valid.
Definition
SipApproximation.h:165
lsst::afw::geom::SipApproximation::SipApproximation
SipApproximation(SkyWcs const &target, lsst::geom::Box2D const &bbox, lsst::geom::Extent2I const &gridShape, int order=5, std::optional< lsst::geom::Point2D > const &pixelOrigin=std::nullopt, double svdThreshold=-1)
Construct a new approximation by fitting on a grid of points.
Definition
SipApproximation.cc:244
lsst::afw::geom::SipApproximation::getSkyOrigin
lsst::geom::SpherePoint getSkyOrigin() const noexcept
Return the sky-coordinate origin of the WCS.
Definition
SipApproximation.h:168
lsst::afw::geom::SipApproximation::SipApproximation
SipApproximation(SipApproximation const &)=delete
lsst::afw::geom::SipApproximation::getWcs
std::shared_ptr< SkyWcs > getWcs() const noexcept
Return a TAN-SIP WCS object that evaluates the approximation.
Definition
SipApproximation.cc:325
lsst::afw::geom::SipApproximation::SipApproximation
SipApproximation(SipApproximation &&) noexcept=default
lsst::afw::geom::SipApproximation::getB
double getB(int p, int q) const
Return a coefficient of the forward transform polynomial.
Definition
SipApproximation.cc:288
lsst::afw::geom::SipApproximation::getOrder
int getOrder() const noexcept
Return the polynomial order of the current solution (same for forward and reverse).
Definition
SipApproximation.cc:280
lsst::afw::geom::SipApproximation::getCdMatrix
Eigen::Matrix2d getCdMatrix() const noexcept
Return the CD matrix of the WCS (in degrees).
Definition
SipApproximation.cc:321
lsst::afw::geom::SipApproximation::getA
double getA(int p, int q) const
Return a coefficient of the forward transform polynomial.
Definition
SipApproximation.cc:284
lsst::afw::geom::SipApproximation::operator=
SipApproximation & operator=(SipApproximation const &)=delete
lsst::afw::geom::SipApproximation::computeDeltas
std::pair< lsst::geom::Angle, double > computeDeltas() const
Return the maximum deviations of the solution from the exact transform on a grid offset from the one ...
Definition
SipApproximation.cc:329
lsst::afw::geom::SipApproximation::getPixelOrigin
lsst::geom::Point2D getPixelOrigin() const noexcept
Return the pixel origin of the WCS.
Definition
SipApproximation.h:171
lsst::afw::geom::SkyWcs
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Definition
SkyWcs.h:119
lsst::geom::Box2D
lsst::geom::SpherePoint
lsst::afw::geom
Definition
frameSetUtils.h:40
lsst::afw
Definition
imageAlgorithm.dox:1
lsst::geom
lsst::geom::Point2D
Point< double, 2 > Point2D
lsst::geom::Extent2I
Extent< int, 2 > Extent2I
lsst
std
STL namespace.
Generated on
for lsst.afw by
1.17.0