lsst.afw gf03f0b42f3+e27ba6bf39
Loading...
Searching...
No Matches
wcsUtils.h
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2
3/*
4 * LSST Data Management System
5 * Copyright 2018 LSST Corporation.
6 *
7 * This product includes software developed by the
8 * LSST Project (http://www.lsst.org/).
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 LSST License Statement and
21 * the GNU General Public License along with this program. If not,
22 * see <http://www.lsstcorp.org/LegalNotices/>.
23 */
24
25#ifndef LSST_AFW_TABLE_WCSUTILS_H
26#define LSST_AFW_TABLE_WCSUTILS_H
27
29
30namespace lsst {
31namespace afw {
32namespace table {
33
47template <typename ReferenceCollection>
48void updateRefCentroids(geom::SkyWcs const& wcs, ReferenceCollection& refList);
49
63template <typename SourceCollection>
64void updateSourceCoords(geom::SkyWcs const& wcs, SourceCollection& sourceList, bool include_covariance=true);
65
79template <typename t>
80Eigen::Matrix<t, 2, 2> calculateCoordCovariance(geom::SkyWcs const& wcs, lsst::geom::Point2D center,
81 Eigen::Matrix<t, 2, 2> err,
82 double factor = lsst::geom::PI / 180.0);
83
98std::pair<std::tuple<double, double>, std::tuple<double, double, double>> convertCentroid(
99 geom::SkyWcs const& wcs, double x, double y, double xErr, double yErr, double xy_covariance = 0);
100
101} // namespace table
102} // namespace afw
103} // namespace lsst
104
105#endif // #ifndef LSST_AFW_TABLE_WCSUTILS_H
Eigen::Matrix< t, 2, 2 > calculateCoordCovariance(geom::SkyWcs const &wcs, lsst::geom::Point2D center, Eigen::Matrix< t, 2, 2 > err, double factor=lsst::geom::PI/180.0)
Calculate covariance for sky coordinates given a pixel centroid and errors.
Definition wcsUtils.cc:96
void updateRefCentroids(geom::SkyWcs const &wcs, ReferenceCollection &refList)
Update centroids in a collection of reference objects.
Definition wcsUtils.cc:73
void updateSourceCoords(geom::SkyWcs const &wcs, SourceCollection &sourceList, bool include_covariance=true)
Update sky coordinates in a collection of source objects.
Definition wcsUtils.cc:123
std::pair< std::tuple< double, double >, std::tuple< double, double, double > > convertCentroid(geom::SkyWcs const &wcs, double x, double y, double xErr, double yErr, double xy_covariance=0)
Convert an x/y centroid with errors into RA/dec.
Definition wcsUtils.cc:160
Point< double, 2 > Point2D
double constexpr PI