SourceXtractorPlusPlus  0.11
Please provide a description of the project.
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 
25 
29 
31 
32 namespace SourceXtractor {
33 
35  const auto& detection_frame = source.getProperty<DetectionFrame>();
36  const auto& pixel_values = source.getProperty<DetectionFramePixelValues>().getValues();
37  const auto& pixel_variances = source.getProperty<DetectionFramePixelValues>().getVariances();
38 
39  SeFloat total_flux = 0.0;
40  SeFloat total_variance = 0.0;
41 
42  auto variance_iter = pixel_variances.begin();
43  for (auto value : pixel_values) {
44  auto variance = *variance_iter++;
45 
46  total_flux += value;
47  total_variance += variance;
48  }
49 
50  // Add variance from gain
51  SeFloat gain = detection_frame.getFrame()->getGain();
52  if (gain >0.0)
53  total_variance += total_flux / gain;
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 
PixelCoordinateList.h
SourceXtractor::IsophotalFlux
Computes the isophotal flux and magnitude.
Definition: IsophotalFlux.h:36
std::numeric_limits::quiet_NaN
T quiet_NaN(T... args)
SourceXtractor::SeFloat
SeFloat32 SeFloat
Definition: Types.h:32
DetectionFrame.h
DetectionFramePixelValues.h
std::sqrt
T sqrt(T... args)
SourceXtractor
Definition: Aperture.h:30
IsophotalFlux.h
SourceXtractor::IsophotalFluxTask::m_magnitude_zero_point
SeFloat m_magnitude_zero_point
Definition: IsophotalFluxTask.h:51
SourceXtractor::DetectionFrame
Definition: DetectionFrame.h:33
SourceXtractor::IsophotalFluxTask::computeProperties
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition: IsophotalFluxTask.cpp:34
IsophotalFluxTask.h
std::log10
T log10(T... args)
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:57
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::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition: SourceInterface.h:46
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition: SourceInterface.h:72