SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
AperturePhotometry
ApertureFlagTask.cpp
Go to the documentation of this file.
1
17
/*
18
* ApertureFlagTask.cpp
19
*
20
* Created on: Oct 09, 2018
21
* Author: Alejandro Alvarez Ayllon
22
*/
23
24
#include "
SEFramework/Aperture/FluxMeasurement.h
"
25
#include "
SEFramework/Aperture/CircularAperture.h
"
26
#include "
SEFramework/Aperture/Flagging.h
"
27
28
#include "
SEImplementation/Property/PixelCoordinateList.h
"
29
#include "
SEImplementation/CheckImages/CheckImages.h
"
30
#include "
SEImplementation/Plugin/PixelCentroid/PixelCentroid.h
"
31
#include "
SEImplementation/Plugin/SourceIDs/SourceID.h
"
32
#include "
SEImplementation/Plugin/SourceFlags/SourceFlags.h
"
33
#include "
SEImplementation/Plugin/DetectionFrameInfo/DetectionFrameInfo.h
"
34
#include "
SEImplementation/Plugin/DetectionFrameImages/DetectionFrameImages.h
"
35
36
#include "
SEImplementation/Plugin/AperturePhotometry/ApertureFlag.h
"
37
#include "
SEImplementation/Plugin/AperturePhotometry/ApertureFlagTask.h
"
38
39
namespace
SourceXtractor
{
40
41
42
void
ApertureFlagTask::computeProperties
(
SourceInterface
&
source
)
const
{
43
// get the detection frame info
44
const
auto
&
detection_frame_info
=
source
.getProperty<
DetectionFrameInfo
>();
45
const
auto
variance_threshold
=
detection_frame_info
.getVarianceThreshold();
46
47
// get detection frame images
48
const
auto
&
detection_frame_images
=
source
.getProperty<
DetectionFrameImages
>();
49
50
const
auto
detection_image
=
detection_frame_images
.getLockedImage(
LayerSubtractedImage
);
51
const
auto
detection_variance
=
detection_frame_images
.getLockedImage(
LayerVarianceMap
);
52
const
auto
threshold_image
=
detection_frame_images
.getLockedImage(
LayerThresholdedImage
);
53
54
// get the object center
55
const
auto
&
centroid_x
=
source
.getProperty<
PixelCentroid
>().getCentroidX();
56
const
auto
&
centroid_y
=
source
.getProperty<
PixelCentroid
>().getCentroidY();
57
58
// get the pixel list
59
const
auto
&
pix_list
=
source
.getProperty<
PixelCoordinateList
>().getCoordinateList();
60
61
std::map<float, Flags>
all_flags
;
62
63
for
(
auto
aperture_diameter
:
m_apertures
) {
64
auto
aperture
=
std::make_shared<CircularAperture>
(
aperture_diameter
/ 2.);
65
auto
flag
=
computeFlags
(
aperture
,
centroid_x
,
centroid_y
,
pix_list
,
detection_image
,
66
detection_variance
,
threshold_image
,
variance_threshold
);
67
all_flags
.emplace(
std::make_pair
(
aperture_diameter
,
flag
));
68
}
69
70
// set the source properties
71
source
.setProperty<
ApertureFlag
>(
all_flags
);
72
73
// draw check image for all apertures
74
auto
aperture_check_img
=
CheckImages::getInstance
().getDetectionApertureImage(
detection_frame_info
.getHduIndex());
75
if
(
aperture_check_img
) {
76
for
(
auto
aperture_diameter
:
m_apertures
) {
77
unsigned
int
src_id
=
source
.getProperty<
SourceID
>().getId();
78
auto
aperture
=
std::make_shared<CircularAperture>
(
aperture_diameter
/ 2.);
79
drawAperture<int>
(
aperture
,
centroid_x
,
centroid_y
,
aperture_check_img
,
static_cast<
unsigned
>
(
src_id
));
80
}
81
}
82
}
83
84
}
// end of namespace SourceXtractor
ApertureFlagTask.h
ApertureFlag.h
CheckImages.h
CircularAperture.h
DetectionFrameImages.h
DetectionFrameInfo.h
Flagging.h
FluxMeasurement.h
PixelCentroid.h
PixelCoordinateList.h
SourceFlags.h
SourceID.h
SourceXtractor::ApertureFlagTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
ApertureFlagTask.cpp:42
SourceXtractor::ApertureFlagTask::m_apertures
std::vector< SeFloat > m_apertures
Definition
ApertureFlagTask.h:43
SourceXtractor::ApertureFlag
Aperture photometry flag.
Definition
ApertureFlag.h:38
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition
CheckImages.h:158
SourceXtractor::DetectionFrameImages
Definition
DetectionFrameImages.h:30
SourceXtractor::DetectionFrameInfo
Definition
DetectionFrameInfo.h:29
SourceXtractor::PixelCentroid
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values.
Definition
PixelCentroid.h:37
SourceXtractor::PixelCoordinateList
Definition
PixelCoordinateList.h:33
SourceXtractor::SourceID
Definition
SourceID.h:33
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
std::function
std::make_pair
T make_pair(T... args)
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::computeFlags
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
SourceXtractor::LayerVarianceMap
@ LayerVarianceMap
Definition
Frame.h:45
SourceXtractor::LayerThresholdedImage
@ LayerThresholdedImage
Definition
Frame.h:41
SourceXtractor::LayerSubtractedImage
@ LayerSubtractedImage
Definition
Frame.h:39
Generated by
1.10.0