SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
IsophotalFlux
IsophotalFluxTask.cpp
Go to the documentation of this file.
1
17
/*
18
* IsophotalTask.cpp
19
*
20
* Created on: Sep 28, 2016
21
* Author: mschefer
22
*/
23
24
#include "
SEImplementation/Property/PixelCoordinateList.h
"
25
#include "
SEImplementation/Plugin/DetectionFramePixelValues/DetectionFramePixelValues.h
"
26
#include "
SEImplementation/Plugin/IsophotalFlux/IsophotalFlux.h
"
27
#include "
SEImplementation/Plugin/DetectionFrameInfo/DetectionFrameInfo.h
"
28
29
#include "
SEImplementation/Plugin/IsophotalFlux/IsophotalFluxTask.h
"
30
31
namespace
SourceXtractor
{
32
33
void
IsophotalFluxTask::computeProperties
(
SourceInterface
&
source
)
const
{
34
const
auto
&
detection_frame_info
=
source
.getProperty<
DetectionFrameInfo
>();
35
const
auto
&
pixel_values
=
source
.getProperty<
DetectionFramePixelValues
>().getValues();
36
const
auto
&
pixel_variances
=
source
.getProperty<
DetectionFramePixelValues
>().getVariances();
37
38
SeFloat
total_flux
= 0.0;
39
SeFloat
total_variance
= 0.0;
40
41
auto
variance_iter
=
pixel_variances
.begin();
42
for
(
auto
value :
pixel_values
) {
43
auto
variance
= *
variance_iter
++;
44
45
total_flux
+= value;
46
total_variance
+=
variance
;
47
}
48
49
// Add variance from gain
50
SeFloat
gain =
detection_frame_info
.getGain();
51
if
(gain > 0.0) {
52
total_variance
+=
total_flux
/ gain;
53
}
54
55
auto
flux_error
=
sqrt
(
total_variance
);
56
57
auto
mag
=
total_flux
> 0.0 ? -2.5*
log10
(
total_flux
) +
m_magnitude_zero_point
:
std::numeric_limits<SeFloat>::quiet_NaN
();
58
auto
mag_error
= 1.0857 *
flux_error
/
total_flux
;
59
60
source
.setProperty<
IsophotalFlux
>(
total_flux
,
flux_error
,
mag
,
mag_error
);
61
}
62
63
}
64
65
DetectionFrameInfo.h
DetectionFramePixelValues.h
IsophotalFluxTask.h
IsophotalFlux.h
PixelCoordinateList.h
SourceXtractor::DetectionFrameInfo
Definition
DetectionFrameInfo.h:29
SourceXtractor::DetectionFramePixelValues
The values of a Source's pixels in the detection image. They are returned as a vector in the same ord...
Definition
DetectionFramePixelValues.h:39
SourceXtractor::IsophotalFluxTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
IsophotalFluxTask.cpp:33
SourceXtractor::IsophotalFluxTask::m_magnitude_zero_point
SeFloat m_magnitude_zero_point
Definition
IsophotalFluxTask.h:51
SourceXtractor::IsophotalFlux
Computes the isophotal flux and magnitude.
Definition
IsophotalFlux.h:36
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
std::function
std::log10
T log10(T... args)
SourceXtractor
Definition
Aperture.h:30
std::numeric_limits::quiet_NaN
T quiet_NaN(T... args)
std::sqrt
T sqrt(T... args)
Generated by
1.10.0