SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
AutoPhotometry
AutoPhotometryFlagTask.cpp
Go to the documentation of this file.
1
17
/*
18
* AutoPhotometryFlagTask.cpp
19
*
20
* Created on: Oct 10, 2018
21
* Author: Alejandro Alvarez Ayllon
22
*/
23
24
#include "
SEFramework/Aperture/FluxMeasurement.h
"
25
#include "
SEFramework/Aperture/EllipticalAperture.h
"
26
#include "
SEFramework/Aperture/Flagging.h
"
27
28
#include "
SEImplementation/CheckImages/CheckImages.h
"
29
#include "
SEImplementation/Property/PixelCoordinateList.h
"
30
#include "
SEImplementation/Plugin/PixelCentroid/PixelCentroid.h
"
31
#include "
SEImplementation/Plugin/ShapeParameters/ShapeParameters.h
"
32
#include "
SEImplementation/Plugin/KronRadius/KronRadius.h
"
33
#include "
SEImplementation/Plugin/SourceIDs/SourceID.h
"
34
#include "
SEImplementation/Plugin/DetectionFrameInfo/DetectionFrameInfo.h
"
35
#include "
SEImplementation/Plugin/DetectionFrameImages/DetectionFrameImages.h
"
36
37
#include "
SEImplementation/Plugin/AutoPhotometry/AutoPhotometry.h
"
38
#include "
SEImplementation/Plugin/AutoPhotometry/AutoPhotometryFlag.h
"
39
#include "
SEImplementation/Plugin/AutoPhotometry/AutoPhotometryFlagTask.h
"
40
41
namespace
SourceXtractor
{
42
44
45
void
AutoPhotometryFlagTask::computeProperties
(
SourceInterface
&
source
)
const
{
46
// get the detection frame info
47
const
auto
&
detection_frame_info
=
source
.getProperty<
DetectionFrameInfo
>();
48
const
auto
variance_threshold
=
detection_frame_info
.getVarianceThreshold();
49
50
// get detection frame images
51
const
auto
&
detection_frame_images
=
source
.getProperty<
DetectionFrameImages
>();
52
53
const
auto
detection_image
=
detection_frame_images
.getLockedImage(
LayerSubtractedImage
);
54
const
auto
detection_variance
=
detection_frame_images
.getLockedImage(
LayerVarianceMap
);
55
const
auto
threshold_image
=
detection_frame_images
.getLockedImage(
LayerThresholdedImage
);
56
57
// get the object center
58
const
auto
&
centroid_x
=
source
.getProperty<
PixelCentroid
>().getCentroidX();
59
const
auto
&
centroid_y
=
source
.getProperty<
PixelCentroid
>().getCentroidY();
60
61
// get the shape parameters
62
const
auto
&
cxx
=
source
.getProperty<
ShapeParameters
>().getEllipseCxx();
63
const
auto
&
cyy
=
source
.getProperty<
ShapeParameters
>().getEllipseCyy();
64
const
auto
&
cxy
=
source
.getProperty<
ShapeParameters
>().getEllipseCxy();
65
66
// get the pixel list
67
const
auto
&
pix_list
=
source
.getProperty<
PixelCoordinateList
>().getCoordinateList();
68
69
// get the kron-radius
70
SeFloat
kron_radius_auto
=
m_kron_factor
*
source
.getProperty<
KronRadius
>().getKronRadius();
71
if
(
kron_radius_auto
<
m_kron_minrad
)
72
kron_radius_auto
=
m_kron_minrad
;
73
74
// create the elliptical aperture
75
auto
ell_aper
=
std::make_shared<EllipticalAperture>
(
cxx
,
cyy
,
cxy
,
kron_radius_auto
);
76
77
// get the neighbourhood information
78
Flags
global_flag
=
computeFlags
(
ell_aper
,
centroid_x
,
centroid_y
,
pix_list
,
detection_image
,
79
detection_variance
,
threshold_image
,
variance_threshold
);
80
81
// set the source properties
82
source
.setProperty<
AutoPhotometryFlag
>(
global_flag
);
83
84
// Draw the aperture
85
auto
aperture_check_img
=
CheckImages::getInstance
().getDetectionAutoApertureImage(
detection_frame_info
.getHduIndex());
86
if
(
aperture_check_img
) {
87
auto
src_id
=
source
.getProperty<
SourceID
>().getId();
88
drawAperture<int>
(
ell_aper
,
centroid_x
,
centroid_y
,
aperture_check_img
,
src_id
);
89
}
90
}
91
92
}
AutoPhotometryFlagTask.h
AutoPhotometryFlag.h
AutoPhotometry.h
CheckImages.h
DetectionFrameImages.h
DetectionFrameInfo.h
EllipticalAperture.h
Flagging.h
FluxMeasurement.h
KronRadius.h
PixelCentroid.h
PixelCoordinateList.h
ShapeParameters.h
SourceID.h
SourceXtractor::AutoPhotometryFlagTask::m_kron_factor
SeFloat m_kron_factor
Definition
AutoPhotometryFlagTask.h:43
SourceXtractor::AutoPhotometryFlagTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
AutoPhotometryFlagTask.cpp:45
SourceXtractor::AutoPhotometryFlagTask::m_kron_minrad
SeFloat m_kron_minrad
Definition
AutoPhotometryFlagTask.h:44
SourceXtractor::AutoPhotometryFlag
Definition
AutoPhotometryFlag.h:34
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition
CheckImages.h:158
SourceXtractor::DetectionFrameImages
Definition
DetectionFrameImages.h:30
SourceXtractor::DetectionFrameInfo
Definition
DetectionFrameInfo.h:29
SourceXtractor::KronRadius
Kron radius.
Definition
KronRadius.h:36
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::ShapeParameters
Definition
ShapeParameters.h:32
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
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::Flags
Flags
Flagging of bad sources.
Definition
SourceFlags.h:37
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