SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
31namespace SourceXtractor {
32
41
61FluxMeasurement 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
80template <typename T>
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
111template <typename T>
113 const std::shared_ptr<WriteableImage<T>> &img, T value) {
114 auto min_pixel = aperture->getMinPixel(centroid_x, centroid_y);
115 auto max_pixel = aperture->getMaxPixel(centroid_x, centroid_y);
116
117 for (int y = min_pixel.m_y; y <= max_pixel.m_y; ++y) {
118 for (int x = min_pixel.m_x; x <= max_pixel.m_x; ++x) {
119 if (aperture->drawArea(centroid_x, centroid_y, x, y) > 0) {
120 if (x >= 0 && y >= 0 && x < img->getWidth() && y < img->getHeight()) {
121 img->setValue(x, y, value);
122 }
123 }
124 }
125 }
126}
127
128} // end SourceXtractor
129
130#endif // _SEFRAMEWORK_SEFRAMEWORK_APERTURE_MEASUREFLUX_H
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Flags
Flagging of bad sources.
Definition SourceFlags.h:37
@ NONE
No flag is set.
SeFloat32 SeFloat
Definition Types.h:32
void fillAperture(const std::shared_ptr< Aperture > &aperture, SeFloat centroid_x, SeFloat centroid_y, const std::shared_ptr< WriteableImage< T > > &img, T value)
void drawAperture(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)