SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
AutoPhotometryTask.cpp
Go to the documentation of this file.
1
17/*
18 * AutoPhotometryTask.cpp
19 *
20 * Created on: Jul 18, 2016
21 * Author: mkuemmel@usm.lmu.de
22 */
23
28
42
43
44namespace SourceXtractor {
45
47
51
52 auto variance_threshold = measurement_frame_info.getVarianceThreshold();
53 auto gain = measurement_frame_info.getGain();
54
56 const auto variance_map = measurement_frame_images.getLockedImage(LayerVarianceMap);
57
58 // get the object center
59 const auto& centroid_x = source.getProperty<MeasurementFramePixelCentroid>(m_instance).getCentroidX();
60 const auto& centroid_y = source.getProperty<MeasurementFramePixelCentroid>(m_instance).getCentroidY();
61
62 // get the shape parameters
63 const auto& cxx = source.getProperty<ShapeParameters>().getEllipseCxx();
64 const auto& cyy = source.getProperty<ShapeParameters>().getEllipseCyy();
65 const auto& cxy = source.getProperty<ShapeParameters>().getEllipseCxy();
66
67 // get the jacobian
68 const auto& jacobian = source.getProperty<JacobianSource>(m_instance);
69
70 // get the kron-radius
71 SeFloat kron_radius_auto = m_kron_factor * source.getProperty<KronRadius>().getKronRadius();
74
75 // create the elliptical aperture
78 jacobian.asTuple());
79
82
83 // compute the derived quantities
84 auto total_variance = measurement.m_variance;
85 if (gain >0.0)
86 total_variance += measurement.m_flux / gain;
89 auto mag_error = 1.0857 * flux_error / measurement.m_flux;
90
91 // Add the flags from the detection image and from the saturated and blended plugins
92 measurement.m_flags |= source.getProperty<AutoPhotometryFlag>().getFlags();
93 measurement.m_flags |= Flags::SATURATED * source.getProperty<SaturateFlag>(m_instance).getSaturateFlag();
94 measurement.m_flags |= Flags::BLENDED * source.getProperty<BlendedFlag>().getBlendedFlag();
95
96 // set the source properties
97 source.setIndexedProperty<AutoPhotometry>(m_instance, measurement.m_flux, flux_error, mag, mag_error, measurement.m_flags);
98
99 // Draw the aperture
100 auto aperture_check_img = CheckImages::getInstance().getMeasurementAutoApertureImage(m_instance);
101 if (aperture_check_img) {
102 auto src_id = source.getProperty<SourceID>().getId();
103
105 }
106}
107
108}
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Auto photometry flux and magnitude.
static CheckImages & getInstance()
The SourceInterface is an abstract "source" that has properties attached to it.
T log10(T... args)
@ BLENDED
The object was originally blended with another one.
@ SATURATED
At least one pixel of the object is saturated.
@ LayerVarianceMap
Definition Frame.h:45
@ LayerSubtractedImage
Definition Frame.h:39
FluxMeasurement measureFlux(const std::shared_ptr< Aperture > &aperture, SeFloat centroid_x, SeFloat centroid_y, const std::shared_ptr< Image< SeFloat > > &img, const std::shared_ptr< Image< SeFloat > > &variance_map, SeFloat variance_threshold, bool use_symmetry)
T quiet_NaN(T... args)
T sqrt(T... args)