LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
#include <Baseline.h>
Public Types | |
typedef lsst::afw::image::MaskedImage < ImagePixelT, MaskPixelT, VariancePixelT > | MaskedImageT |
typedef boost::shared_ptr < lsst::afw::image::MaskedImage < ImagePixelT > MaskPixelT, VariancePixelT > | MaskedImagePtrT |
typedef lsst::afw::image::Image < ImagePixelT > | ImageT |
typedef boost::shared_ptr < lsst::afw::image::Image < ImagePixelT > > | ImagePtrT |
typedef lsst::afw::image::Mask < MaskPixelT > | MaskT |
typedef boost::shared_ptr < lsst::afw::image::Mask < MaskPixelT > > | MaskPtrT |
typedef lsst::afw::detection::Footprint | FootprintT |
typedef boost::shared_ptr < lsst::afw::detection::Footprint > | FootprintPtrT |
typedef lsst::afw::detection::HeavyFootprint < ImagePixelT, MaskPixelT, VariancePixelT > | HeavyFootprintT |
typedef boost::shared_ptr < lsst::afw::detection::HeavyFootprint < ImagePixelT > MaskPixelT, VariancePixelT > | HeavyFootprintPtrT |
Static Public Member Functions | |
static boost::shared_ptr < lsst::afw::detection::Footprint > | symmetrizeFootprint (lsst::afw::detection::Footprint const &foot, int cx, int cy) |
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) |
static void | medianFilter (ImageT const &img, ImageT &outimg, int halfsize) |
static void | makeMonotonic (ImageT &img, lsst::afw::detection::PeakRecord const &pk) |
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< boost::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< boost::shared_ptr< typename lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > > &strays, int strayFluxOptions, double clipStrayFluxFraction) |
static bool | hasSignificantFluxAtEdge (ImagePtrT, boost::shared_ptr< lsst::afw::detection::Footprint >, ImagePixelT threshold) |
static boost::shared_ptr < lsst::afw::detection::Footprint > | getSignificantEdgePixels (ImagePtrT, boost::shared_ptr< lsst::afw::detection::Footprint >, ImagePixelT threshold) |
static void | _sum_templates (std::vector< ImagePtrT > timgs, ImagePtrT tsum) |
static void | _find_stray_flux (lsst::afw::detection::Footprint const &foot, ImagePtrT tsum, MaskedImageT const &img, int strayFluxOptions, std::vector< boost::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< boost::shared_ptr< typename lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > > &strays) |
Static Public Attributes | |
static const int | ASSIGN_STRAYFLUX = 0x1 |
static const int | STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY = 0x2 |
static const int | STRAYFLUX_TO_POINT_SOURCES_ALWAYS = 0x4 |
static const int | STRAYFLUX_R_TO_FOOTPRINT = 0x8 |
static const int | STRAYFLUX_NEAREST_FOOTPRINT = 0x10 |
static const int | STRAYFLUX_TRIM = 0x20 |
Definition at line 22 of file Baseline.h.
typedef boost::shared_ptr< lsst::afw::detection::Footprint > lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::FootprintPtrT |
Definition at line 33 of file Baseline.h.
typedef lsst::afw::detection::Footprint lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::FootprintT |
Definition at line 32 of file Baseline.h.
typedef boost::shared_ptr< lsst::afw::detection::HeavyFootprint<ImagePixelT > MaskPixelT, VariancePixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::HeavyFootprintPtrT |
Definition at line 36 of file Baseline.h.
typedef lsst::afw::detection::HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::HeavyFootprintT |
Definition at line 34 of file Baseline.h.
typedef boost::shared_ptr< lsst::afw::image::Image<ImagePixelT> > lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::ImagePtrT |
Definition at line 28 of file Baseline.h.
typedef lsst::afw::image::Image<ImagePixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::ImageT |
Definition at line 27 of file Baseline.h.
typedef boost::shared_ptr< lsst::afw::image::MaskedImage<ImagePixelT > MaskPixelT, VariancePixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImagePtrT |
Definition at line 26 of file Baseline.h.
typedef lsst::afw::image::MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImageT |
Definition at line 25 of file Baseline.h.
typedef boost::shared_ptr< lsst::afw::image::Mask<MaskPixelT> > lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::MaskPtrT |
Definition at line 30 of file Baseline.h.
typedef lsst::afw::image::Mask<MaskPixelT> lsst::meas::deblender::BaselineUtils< ImagePixelT, MaskPixelT, VariancePixelT >::MaskT |
Definition at line 29 of file Baseline.h.
|
static |
Hmm, this is a little bit dangerous: we're assuming that the HeavyFootprint stores its pixels in the same order that we iterate over them above (ie, lexicographic).
Definition at line 289 of file Baseline.cc.
|
static |
Definition at line 500 of file Baseline.cc.
|
static |
Splits flux in a given image img, within a given footprint foot, among a number of templates timgs,tfoots. This is where actual "deblending" takes place.
timgs* and tfoots MUST be the same length.
Flux is assigned to templates according to their relative heights at each pixel.
If strayFluxOptions includes ASSIGN_STRAYFLUX, then "stray flux" – flux in the parent footprint that is not covered by any of the template footprints – is assigned to templates based on their 1/(1+r^2) distance.
If strayFluxOptions includes STRAYFLUX_R_TO_FOOTPRINT, the stray flux is distributed to the footprints based on 1/(1+r^2) of the minimum distance from the stray flux to footprint.
If strayFluxOptions includes "STRAYFLUX_NEAREST_FOOTPRINT*, the stray flux is assigned to the footprint with lowest L-1 (Manhattan) distance to the stray flux.
Otherwise, stray flux is assigned based on (1/(1+r^2) from the peaks.
If strayFluxOptions includes STRAYFLUX_TO_POINT_SOURCES_ALWAYS, then point sources are always included in the 1/(1+r^2) splitting. Otherwise, if STRAYFLUX_TO_POINT_SOURCES_WHEN_NECESSARY, point sources are included only if there are no extended sources nearby.
If any stray-flux portion is less than clipStrayFluxFraction, it is clipped to zero.
When doing stray flux, the "strays" arg is used as an extra return value, the stray flux assigned to each template.
When doing stray flux, the ispsf, pkx, and pky arrays are required. They give the peak x,y coords plus whether the peak is believed (by the deblender) to be a point source. pkx and pky MUST be the same length as timgs. If ispsf has nonzero length, it MUST be the same length as timgs.
If tsum is given, is it set to the sum of max(0, template).
The return value is a vector of MaskedImages containing the flux assigned to each template.
Definition at line 583 of file Baseline.cc.
|
static |
Given an img, footprint foot, and peak, creates a symmetric template around the peak; produce a MaskedImage and Footprint describing a footprint where: output pixels (cx + dx, cy + dy) and (cx - dx, cy - dy) = min(input pixels (cx + dx, cy + dy) and (cx - dx, cy - dy))
If patchEdge is true and if the footprint touches pixels with the EDGE bit set, then for spans whose symmetric mirror are outside the image, the symmetric footprint is grown to include them and their pixel values are stored.
Definition at line 1084 of file Baseline.cc.
|
static |
Returns a list of pixels that are on the edge of the given Footprint sfoot* in image img, above threshold thresh.
Definition at line 1317 of file Baseline.cc.
|
static |
Returns true if the given Footprint sfoot in image img has flux above value thresh at its edge.
Definition at line 1281 of file Baseline.cc.
|
static |
Given an image mimg and Peak location peak, overwrite mimg so that pixels further from the peak have values smaller than those close to the peak; make the profile monotonic-decreasing.
The exact algorithm is a little more complicated than that. The basic idea is of "casting a shadow" from a pixel to pixels farther from the peak in the same direction. Done naively, this results in very narrow "shadows" and ragged profiles. A tweak is to make the shadows "fatter" – make a pixel shadow a wedge of pixels – but if one does this naively, the wedge gets wider and wider too quickly. The algorithm works out from the peak in square "rings" of pixels, so if a pixel shadows a wedge 30 degrees wide, in the next ring of pixels the shadowed pixel at largest angle from the shadowing pixel will shade a yet-larger wedge, expanding the shadowing angle. To reduce this effect, we work in chunks of 5 pixels in radius, only copying the intermediate pixels to the "shadowing" image at the end of each chunk.
Currently the mask and variance planes of the input are totally ignored.
For illustration, run tests/monotonic.py and look at im*.png
Definition at line 117 of file Baseline.cc.
|
static |
Run a spatial median filter over the given input img, writing the results to out. halfsize is half the box size of the filter; ie, a halfsize of 50 means that each output ixel will be the median of the pixels in a 101 x 101-pixel box in the input image.
Margins are handled horribly: the median is computed only for pixels more than halfsize away from the edges; pixels near the edges are simply copied from the input img to out.
Mask and variance planes are, likewise, simply copied from img to out*.
Definition at line 39 of file Baseline.cc.
|
static |
Given a Footprint foot and peak cx,cy, returns a Footprint that is symmetric around the peak (with twofold rotational symmetry) – the AND of the two symmetric halves.
Definition at line 867 of file Baseline.cc.
|
static |
Definition at line 62 of file Baseline.h.
|
static |
Definition at line 68 of file Baseline.h.
|
static |
Definition at line 67 of file Baseline.h.
|
static |
Definition at line 64 of file Baseline.h.
|
static |
Definition at line 63 of file Baseline.h.
|
static |
Definition at line 69 of file Baseline.h.