SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
Flagging.cpp
Go to the documentation of this file.
1
21
22namespace SourceXtractor {
23
26
34
36 // get the aperture borders on the image
37 auto min_pixel = aperture->getMinPixel(centroid_x, centroid_y);
38 auto max_pixel = aperture->getMaxPixel(centroid_x, centroid_y);
39
40 // clip to the actual image
41 if (min_pixel.clip(detection_img->getWidth(), detection_img->getHeight()))
43 if (max_pixel.clip(detection_img->getWidth(), detection_img->getHeight()))
45
46 // cut the bit of image we need
48
49 // get the neighbourhood information
51
52 SeFloat total_area = 0.0;
53 SeFloat bad_area = 0;
55
56 // iterate over the aperture pixels
57 for (int pixel_y = min_pixel.m_y; pixel_y <= max_pixel.m_y; pixel_y++) {
58 for (int pixel_x = min_pixel.m_x; pixel_x <= max_pixel.m_x; pixel_x++) {
59
60 // get the area coverage and continue if there is overlap
62 if (area == 0) {
63 continue;
64 }
65
67
68 full_area += neighbour_info.isNeighbourObjectPixel(pixel_x, pixel_y);
69 bad_area += (var_cutout->getValue(pixel_x - min_pixel.m_x, pixel_y - min_pixel.m_y) >
71 }
72 }
73
74 // check/set the bad area flag
77
78 // check/set the crowded area flag
81
82 return flag;
83}
84
85} // end of namespace SourceXtractor
const SeFloat BADAREA_THRESHOLD_APER
Definition Flagging.cpp:25
Flags computeFlags(const std::shared_ptr< Aperture > &aperture, SeFloat centroid_x, SeFloat centroid_y, const std::vector< PixelCoordinate > &pix_list, const std::shared_ptr< Image< SeFloat > > &detection_img, const std::shared_ptr< Image< SeFloat > > &detection_variance, const std::shared_ptr< Image< SeFloat > > &threshold_image, SeFloat variance_threshold)
Definition Flagging.cpp:27
Flags
Flagging of bad sources.
Definition SourceFlags.h:37
@ NEIGHBORS
The object has neighbors, bright and close enough.
@ BOUNDARY
The object is truncated (too close to an image boundary)
@ NONE
No flag is set.
@ BIASED
The object has bad pixels.
SeFloat32 SeFloat
Definition Types.h:32
const SeFloat CROWD_THRESHOLD_APER
Definition Flagging.cpp:24