SourceXtractorPlusPlus  0.11
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluxMeasurement.h
Go to the documentation of this file.
1 
17 /*
18  * FluxMeasurement.h
19  *
20  * Created on: Oct 19, 2018
21  * Author: Alejandro Alvarez
22  */
23 
24 #ifndef _SEFRAMEWORK_SEFRAMEWORK_APERTURE_MEASUREFLUX_H
25 #define _SEFRAMEWORK_SEFRAMEWORK_APERTURE_MEASUREFLUX_H
26 
27 #include "Aperture.h"
30 
31 namespace SourceXtractor {
32 
38 
40 };
41 
61 FluxMeasurement measureFlux(const std::shared_ptr<Aperture> &aperture, SeFloat centroid_x, SeFloat centroid_y,
62  const std::shared_ptr<Image<SeFloat>> &img,
63  const std::shared_ptr<Image<SeFloat>> &variance_map, SeFloat variance_threshold,
64  bool use_symmetry);
65 
80 template <typename T>
81 void fillAperture(const std::shared_ptr<Aperture> &aperture, SeFloat centroid_x, SeFloat centroid_y,
82  const std::shared_ptr<WriteableImage<T>> &img, T value) {
83  auto min_pixel = aperture->getMinPixel(centroid_x, centroid_y);
84  auto max_pixel = aperture->getMaxPixel(centroid_x, centroid_y);
85 
86  for (int y = min_pixel.m_y; y <= max_pixel.m_y; ++y) {
87  for (int x = min_pixel.m_x; x <= max_pixel.m_x; ++x) {
88  if (aperture->getArea(centroid_x, centroid_y, x, y) > 0) {
89  if (x >= 0 && y >= 0 && x < img->getWidth() && y < img->getHeight()) {
90  img->setValue(x, y, value);
91  }
92  }
93  }
94  }
95 }
96 
97 } // end SourceXtractor
98 
99 #endif // _SEFRAMEWORK_SEFRAMEWORK_APERTURE_MEASUREFLUX_H
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
SeFloat32 SeFloat
Definition: Types.h:32
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Flags
Flagging of bad sources.
Definition: SourceFlags.h:34
void fillAperture(const std::shared_ptr< Aperture > &aperture, SeFloat centroid_x, SeFloat centroid_y, const std::shared_ptr< WriteableImage< T >> &img, T value)
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)