LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
BaselineUtils.h
Go to the documentation of this file.
1// -*- LSST-C++ -*-
2#if !defined(LSST_DEBLENDER_BASELINE_H)
3#define LSST_DEBLENDER_BASELINE_H
5
6#include <vector>
7#include <utility>
8
14
15namespace lsst {
16 namespace meas {
17 namespace deblender {
18
19 template <typename ImagePixelT,
20 typename MaskPixelT=lsst::afw::image::MaskPixel,
21 typename VariancePixelT=lsst::afw::image::VariancePixel>
23
24 public:
31
35
37
38 static
41 int cx, int cy);
42
43 static
48 double sigma1,
49 bool minZero,
50 bool patchEdges,
51 bool* patchedEdges);
52
53 static void
54 medianFilter(ImageT const& img,
55 ImageT & outimg,
56 int halfsize);
57
58 static void
61
62 static const int ASSIGN_STRAYFLUX = 0x1;
64 static const int STRAYFLUX_TO_POINT_SOURCES_ALWAYS = 0x4;
65 // split flux according to the closest distance to the template?
66 // (default is according to distance to the peak)
67 static const int STRAYFLUX_R_TO_FOOTPRINT = 0x8;
68 static const int STRAYFLUX_NEAREST_FOOTPRINT = 0x10;
69 static const int STRAYFLUX_TRIM = 0x20;
70
71 // swig doesn't seem to understand std::vector<MaskedImagePtrT>...
72 static
74 apportionFlux(MaskedImageT const& img,
78 //
79 ImagePtrT templ_sum,
80 std::vector<bool> const& ispsf,
81 std::vector<int> const& pkx,
82 std::vector<int> const& pky,
84 int strayFluxOptions,
85 double clipStrayFluxFraction
86 );
87
88 static
89 bool
92 ImagePixelT threshold);
93
94 static
98 ImagePixelT threshold);
99
100
101 static
102 void
104 ImagePtrT tsum);
105
106 static
107 void
109 ImagePtrT tsum,
110 MaskedImageT const& img,
111 int strayFluxOptions,
113 std::vector<bool> const& ispsf,
114 std::vector<int> const& pkx,
115 std::vector<int> const& pky,
116 double clipStrayFluxFraction,
118
119 };
120 }
121 }
122}
123
124#endif
table::Key< double > sigma1
Class to describe the properties of a detected object from an image.
Definition Footprint.h:63
A set of pixels in an Image, including those pixels' actual values.
Record class that represents a peak in a Footprint.
Definition Peak.h:42
A class to represent a 2-dimensional array of pixels.
Definition Image.h:51
Represent a 2-dimensional array of bitmask pixels.
Definition Mask.h:77
A class to manipulate images, masks, and variance as a single object.
Definition MaskedImage.h:74
std::shared_ptr< lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > > MaskedImagePtrT
static void medianFilter(ImageT const &img, ImageT &outimg, int halfsize)
Run a spatial median filter over the given input img, writing the results to out.
static const int STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY
std::shared_ptr< lsst::afw::image::Image< ImagePixelT > > ImagePtrT
static void _find_stray_flux(lsst::afw::detection::Footprint const &foot, ImagePtrT tsum, MaskedImageT const &img, int strayFluxOptions, std::vector< std::shared_ptr< lsst::afw::detection::Footprint > > tfoots, std::vector< bool > const &ispsf, std::vector< int > const &pkx, std::vector< int > const &pky, double clipStrayFluxFraction, std::vector< std::shared_ptr< typename lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > > &strays)
std::shared_ptr< lsst::afw::detection::Footprint > FootprintPtrT
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > MaskedImageT
static std::shared_ptr< lsst::afw::detection::Footprint > getSignificantEdgePixels(ImagePtrT, std::shared_ptr< lsst::afw::detection::Footprint >, ImagePixelT threshold)
Returns a list of pixels that are on the edge of the given Footprint sfoot* in image img,...
static std::pair< ImagePtrT, FootprintPtrT > buildSymmetricTemplate(MaskedImageT const &img, lsst::afw::detection::Footprint const &foot, lsst::afw::detection::PeakRecord const &pk, double sigma1, bool minZero, bool patchEdges, bool *patchedEdges)
Given an img, footprint foot, and peak, creates a symmetric template around the peak; produce a Maske...
static void makeMonotonic(ImageT &img, lsst::afw::detection::PeakRecord const &pk)
Given an image mimg and Peak location peak, overwrite mimg so that pixels further from the peak have ...
static std::vector< typename std::shared_ptr< lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > > > apportionFlux(MaskedImageT const &img, lsst::afw::detection::Footprint const &foot, std::vector< typename std::shared_ptr< lsst::afw::image::Image< ImagePixelT > > > templates, std::vector< std::shared_ptr< lsst::afw::detection::Footprint > > templ_footprints, ImagePtrT templ_sum, std::vector< bool > const &ispsf, std::vector< int > const &pkx, std::vector< int > const &pky, std::vector< std::shared_ptr< typename lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > > &strays, int strayFluxOptions, double clipStrayFluxFraction)
Splits flux in a given image img, within a given footprint foot, among a number of templates timgs,...
std::shared_ptr< lsst::afw::image::Mask< MaskPixelT > > MaskPtrT
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > HeavyFootprintT
lsst::afw::image::Image< ImagePixelT > ImageT
lsst::afw::image::Mask< MaskPixelT > MaskT
static std::shared_ptr< lsst::afw::detection::Footprint > symmetrizeFootprint(lsst::afw::detection::Footprint const &foot, int cx, int cy)
Given a Footprint foot and peak cx,cy, returns a Footprint that is symmetric around the peak (with tw...
std::shared_ptr< lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > HeavyFootprintPtrT
static void _sum_templates(std::vector< ImagePtrT > timgs, ImagePtrT tsum)
static bool hasSignificantFluxAtEdge(ImagePtrT, std::shared_ptr< lsst::afw::detection::Footprint >, ImagePixelT threshold)
Returns true if the given Footprint sfoot in image img has flux above value thresh at its edge.
lsst::afw::detection::Footprint FootprintT
static const int STRAYFLUX_TO_POINT_SOURCES_ALWAYS
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
float VariancePixel
default type for MaskedImage variance images