32 template <
typename MatchT>
35 if (matchList.
empty()) {
41 for (
auto const& match : matchList) {
47 template <
typename MatchT>
51 if (matchList.
empty()) {
57 for (
auto const& match : matchList) {
58 auto refPtr = match.first;
59 auto srcPtr = match.second;
60 auto srcX = srcPtr->getX();
61 auto srcY = srcPtr->getY();
62 auto refPos = wcs.
skyToPixel(refPtr->getCoord());
63 auto refX = refPos[0];
64 auto refY = refPos[1];
65 val.
push_back(::hypot(srcX - refX, srcY - refY));
70 template <
typename MatchT>
74 if (matchList.
empty()) {
80 for (
auto const& match : matchList) {
81 auto refPtr = match.first;
82 auto srcPtr = match.second;
83 auto refCoord = refPtr->getCoord();
84 auto srcCoord = wcs.
pixelToSky(srcPtr->getCentroid());
91 #define INSTANTIATE(MATCH) \ 92 template afw::math::Statistics makeMatchStatistics<MATCH>(std::vector<MATCH> const& matchList, \ 94 afw::math::StatisticsControl const& sctrl); \ 95 template afw::math::Statistics makeMatchStatisticsInPixels<MATCH>( \ 96 afw::geom::SkyWcs const& wcs, std::vector<MATCH> const& matchList, int const flags, \ 97 afw::math::StatisticsControl const& sctrl); \ 98 template afw::math::Statistics makeMatchStatisticsInRadians<MATCH>( \ 99 afw::geom::SkyWcs const& wcs, std::vector<MATCH> const& matchList, int const flags, \ 100 afw::math::StatisticsControl const& sctrl); afw::math::Statistics makeMatchStatistics(std::vector< MatchT > const &matchList, int const flags, afw::math::StatisticsControl const &sctrl=afw::math::StatisticsControl())
Compute statistics of the distance field of a match list.
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
lsst::geom::Point2D skyToPixel(lsst::geom::SpherePoint const &sky) const
Compute pixel position(s) from sky position(s)
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
table::Key< table::Array< std::uint8_t > > wcs
A class to evaluate image statistics.
Pass parameters to a Statistics object.
A base class for image defects.
afw::math::Statistics makeMatchStatisticsInPixels(afw::geom::SkyWcs const &wcs, std::vector< MatchT > const &matchList, int const flags, afw::math::StatisticsControl const &sctrl=afw::math::StatisticsControl())
Compute statistics of on-detector radial separation for a match list, in pixels.
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Match< SimpleRecord, SourceRecord > ReferenceMatch
Angle separation(SpherePoint const &other) const noexcept
Angular distance between two points.
#define INSTANTIATE(MATCH)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
afw::math::Statistics makeMatchStatisticsInRadians(afw::geom::SkyWcs const &wcs, std::vector< MatchT > const &matchList, int const flags, afw::math::StatisticsControl const &sctrl=afw::math::StatisticsControl())
Compute statistics of on-sky radial separation for a match list, in radians.
Match< SourceRecord, SourceRecord > SourceMatch
Reports errors that are due to events beyond the control of the program.