2 #if !defined(LSST_DEBLENDER_BASELINE_H) 3 #define LSST_DEBLENDER_BASELINE_H 9 #include "lsst/afw/image/Image.h" 10 #include "lsst/afw/image/MaskedImage.h" 11 #include "lsst/afw/detection/Footprint.h" 12 #include "lsst/afw/detection/HeavyFootprint.h" 13 #include "lsst/afw/detection/Peak.h" 19 template <
typename ImagePixelT,
20 typename MaskPixelT=lsst::afw::image::MaskPixel,
21 typename VariancePixelT=lsst::afw::image::VariancePixel>
25 typedef typename lsst::afw::image::MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>
MaskedImageT;
26 typedef typename PTR(lsst::afw::image::MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>)
MaskedImagePtrT;
27 typedef typename lsst::afw::image::Image<ImagePixelT>
ImageT;
28 typedef typename PTR(lsst::afw::image::Image<ImagePixelT>)
ImagePtrT;
29 typedef typename lsst::afw::image::Mask<MaskPixelT>
MaskT;
30 typedef typename PTR(lsst::afw::image::Mask<MaskPixelT>)
MaskPtrT;
32 typedef typename lsst::afw::detection::Footprint
FootprintT;
34 typedef typename lsst::afw::detection::HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT>
HeavyFootprintT;
36 typedef typename PTR(lsst::afw::detection::HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT>)
HeavyFootprintPtrT;
39 PTR(lsst::afw::detection::Footprint)
44 std::pair<ImagePtrT, FootprintPtrT>
46 lsst::afw::detection::Footprint
const& foot,
47 lsst::afw::detection::PeakRecord
const& pk,
60 lsst::afw::detection::PeakRecord
const& pk);
73 std::vector<typename PTR(lsst::afw::image::MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>)>
75 lsst::afw::detection::Footprint
const& foot,
76 std::vector<
typename PTR(lsst::afw::image::Image<ImagePixelT>)> templates,
77 std::vector<std::shared_ptr<lsst::afw::detection::Footprint> > templ_footprints,
80 std::vector<bool>
const& ispsf,
81 std::vector<int>
const& pkx,
82 std::vector<int>
const& pky,
83 std::vector<std::shared_ptr<typename lsst::afw::detection::HeavyFootprint<ImagePixelT,MaskPixelT,VariancePixelT> > > & strays,
85 double clipStrayFluxFraction
91 std::shared_ptr<lsst::afw::detection::Footprint>,
92 ImagePixelT threshold);
95 std::shared_ptr<lsst::afw::detection::Footprint>
97 std::shared_ptr<lsst::afw::detection::Footprint>,
98 ImagePixelT threshold);
110 MaskedImageT
const& img,
111 int strayFluxOptions,
112 std::vector<std::shared_ptr<lsst::afw::detection::Footprint> > tfoots,
113 std::vector<bool>
const& ispsf,
114 std::vector<int>
const& pkx,
115 std::vector<int>
const& pky,
116 double clipStrayFluxFraction,
117 std::vector<std::shared_ptr<
typename lsst::afw::detection::HeavyFootprint<ImagePixelT,MaskPixelT,VariancePixelT> > > & strays);
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...
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...
lsst::afw::image::Image< ImagePixelT > ImageT
static const int STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY
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)
boost::shared_ptr< lsst::afw::detection::Footprint > FootprintPtrT
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > MaskedImageT
static boost::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...
static const int STRAYFLUX_NEAREST_FOOTPRINT
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. ...
boost::shared_ptr< lsst::afw::image::Mask< MaskPixelT > > MaskPtrT
static const int STRAYFLUX_TRIM
static const int ASSIGN_STRAYFLUX
lsst::afw::image::Mask< MaskPixelT > MaskT
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 boost::shared_ptr< lsst::afw::image::MaskedImage< ImagePixelT > MaskPixelT, VariancePixelT >)> apportionFlux(MaskedImageT const &img, lsst::afw::detection::Footprint const &foot, std::vector< typename boost::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...
static void _sum_templates(std::vector< ImagePtrT > timgs, ImagePtrT tsum)
lsst::afw::detection::Footprint FootprintT
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 const int STRAYFLUX_TO_POINT_SOURCES_ALWAYS
boost::shared_ptr< lsst::afw::image::MaskedImage< ImagePixelT > MaskPixelT, VariancePixelT > MaskedImagePtrT
static const int STRAYFLUX_R_TO_FOOTPRINT
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > HeavyFootprintT
boost::shared_ptr< lsst::afw::detection::HeavyFootprint< ImagePixelT > MaskPixelT, VariancePixelT > HeavyFootprintPtrT
boost::shared_ptr< lsst::afw::image::Image< ImagePixelT > > ImagePtrT