LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
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
4 
6 #include <vector>
7 #include <utility>
8 
9 #include "lsst/afw/image/Image.h"
14 
15 namespace 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>
22  class BaselineUtils {
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
59  makeMonotonic(ImageT & img,
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
lsst::meas::deblender::BaselineUtils::STRAYFLUX_R_TO_FOOTPRINT
static const int STRAYFLUX_R_TO_FOOTPRINT
Definition: BaselineUtils.h:67
lsst::meas::deblender::BaselineUtils::buildSymmetricTemplate
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...
Definition: BaselineUtils.cc:1190
lsst::meas::deblender::BaselineUtils::ASSIGN_STRAYFLUX
static const int ASSIGN_STRAYFLUX
Definition: BaselineUtils.h:62
std::shared_ptr< lsst::afw::detection::Footprint >
lsst::afw::image::Mask
Represent a 2-dimensional array of bitmask pixels.
Definition: Mask.h:77
lsst::afw::detection::PeakRecord
Record class that represents a peak in a Footprint.
Definition: Peak.h:42
lsst::meas::deblender::BaselineUtils::medianFilter
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.
Definition: BaselineUtils.cc:148
std::pair
lsst::meas::deblender::BaselineUtils::makeMonotonic
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 ...
Definition: BaselineUtils.cc:226
lsst::meas::deblender::BaselineUtils::_find_stray_flux
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)
Definition: BaselineUtils.cc:394
MaskedImage.h
std::vector
STL class.
lsst::meas::deblender::BaselineUtils::_sum_templates
static void _sum_templates(std::vector< ImagePtrT > timgs, ImagePtrT tsum)
Definition: BaselineUtils.cc:610
lsst::meas::deblender::BaselineUtils::HeavyFootprintT
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > HeavyFootprintT
Definition: BaselineUtils.h:34
lsst::meas::deblender::BaselineUtils::MaskT
lsst::afw::image::Mask< MaskPixelT > MaskT
Definition: BaselineUtils.h:29
lsst::meas::deblender::BaselineUtils::MaskPtrT
boost::shared_ptr< lsst::afw::image::Mask< MaskPixelT > > MaskPtrT
Definition: BaselineUtils.h:30
lsst::meas::deblender::BaselineUtils::STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY
static const int STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY
Definition: BaselineUtils.h:63
lsst::meas::deblender::BaselineUtils::symmetrizeFootprint
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...
Definition: BaselineUtils.cc:975
Image.h
lsst::meas::deblender::BaselineUtils::STRAYFLUX_TO_POINT_SOURCES_ALWAYS
static const int STRAYFLUX_TO_POINT_SOURCES_ALWAYS
Definition: BaselineUtils.h:64
PTR
#define PTR(...)
Definition: base.h:41
lsst::meas::deblender::BaselineUtils
Definition: BaselineUtils.h:22
lsst::meas::deblender::BaselineUtils::getSignificantEdgePixels
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,...
Definition: BaselineUtils.cc:1419
lsst::afw::image::MaskedImage
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73
lsst::afw::detection::HeavyFootprint
A set of pixels in an Image, including those pixels' actual values.
Definition: HeavyFootprint.h:49
lsst::afw::image::VariancePixel
float VariancePixel
default type for MaskedImage variance images
Definition: LsstImageTypes.h:35
lsst::meas::deblender::BaselineUtils::hasSignificantFluxAtEdge
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.
Definition: BaselineUtils.cc:1386
sigma1
table::Key< double > sigma1
Definition: FunctionLibrary.cc:20
Footprint.h
lsst::meas::deblender::BaselineUtils::FootprintPtrT
boost::shared_ptr< lsst::afw::detection::Footprint > FootprintPtrT
Definition: BaselineUtils.h:33
lsst::afw::image::MaskPixel
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
Definition: LsstImageTypes.h:34
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::meas::deblender::BaselineUtils::ImageT
lsst::afw::image::Image< ImagePixelT > ImageT
Definition: BaselineUtils.h:27
Peak.h
lsst::meas::deblender::BaselineUtils::STRAYFLUX_TRIM
static const int STRAYFLUX_TRIM
Definition: BaselineUtils.h:69
lsst::meas::deblender::BaselineUtils::apportionFlux
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,...
Definition: BaselineUtils.cc:693
lsst::meas::deblender::BaselineUtils::FootprintT
lsst::afw::detection::Footprint FootprintT
Definition: BaselineUtils.h:32
lsst::meas::deblender::BaselineUtils::HeavyFootprintPtrT
boost::shared_ptr< lsst::afw::detection::HeavyFootprint< ImagePixelT > MaskPixelT, VariancePixelT > HeavyFootprintPtrT
Definition: BaselineUtils.h:36
HeavyFootprint.h
lsst::afw::detection::Footprint
Class to describe the properties of a detected object from an image.
Definition: Footprint.h:63
lsst::afw::image::Image< ImagePixelT >
lsst::meas::deblender::BaselineUtils::STRAYFLUX_NEAREST_FOOTPRINT
static const int STRAYFLUX_NEAREST_FOOTPRINT
Definition: BaselineUtils.h:68
lsst::meas::deblender::BaselineUtils::ImagePtrT
boost::shared_ptr< lsst::afw::image::Image< ImagePixelT > > ImagePtrT
Definition: BaselineUtils.h:28
lsst::meas::deblender::BaselineUtils::MaskedImageT
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > MaskedImageT
Definition: BaselineUtils.h:25
lsst::meas::deblender::BaselineUtils::MaskedImagePtrT
boost::shared_ptr< lsst::afw::image::MaskedImage< ImagePixelT > MaskPixelT, VariancePixelT > MaskedImagePtrT
Definition: BaselineUtils.h:26