SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
EllipticalAperture.cpp
Go to the documentation of this file.
1
17/*
18 * EllipticalAperture.cpp
19 *
20 * Created on: Oct 08, 2018
21 * Author: Alejandro Alvarez
22 */
23
25#include <iostream>
26namespace SourceXtractor {
27
28
33
41
43 SeFloat thickness = 1.0;
45
46 //SeFloat min_rad_squared = .877777*(m_rad_max*m_rad_max);
47 //SeFloat min_rad_squared = .877777*(m_rad_max*m_rad_max);
48 //SeFloat min_rad_squared = .133333*(m_rad_max*m_rad_max) > 6.0 ? .877777*(m_rad_max*m_rad_max) : (m_rad_max*m_rad_max)-6.0;
49
50 //SeFloat max_rad_squared = (m_rad_max + thickness) * (m_rad_max + thickness);
51
52 //if (min_supersampled_radius_squared < distance_squared && distance_squared <= max_supersampled_radius_squared) {
53 //if ((m_rad_max-1.)*(m_rad_max-1.)< distance_squared && distance_squared < m_rad_max * m_rad_max) {
54 //if ((m_rad_max*m_rad_max-thickness)< distance_squared && distance_squared < (m_rad_max * m_rad_max)) {
55 //if (fabs(distance_squared - (m_rad_max * m_rad_max)) < thickness) {
56
59 //if (min_rad_squared < distance_squared && distance_squared < max_rad_squared) {
60 return 1.0;
61 }
62 return 0.;
63 }
64
72
74 SeFloat dx, dy;
75
76 // compute the maximum extend in x/y
77 dx = m_rad_max * std::sqrt(1.0 / (m_cxx - m_cxy * m_cxy / (4.0 * m_cyy)));
78 dy = m_rad_max * std::sqrt(1.0 / (m_cyy - m_cxy * m_cxy / (4.0 * m_cxx)));
79
80 // return the absolute values
82}
83
85 SeFloat dx, dy;
86
87 // compute the maximum extend in x/y
88 dx = m_rad_max * std::sqrt(1.0 / (m_cxx - m_cxy * m_cxy / (4.0 * m_cyy)));
89 dy = m_rad_max * std::sqrt(1.0 / (m_cyy - m_cxy * m_cxy / (4.0 * m_cxx)));
90
91 // return the absolute values
92 return PixelCoordinate(centroid_x + dx + 1, centroid_y + dy + 1);
93}
94
95} // end SourceXtractor
std::shared_ptr< EngineParameter > dx
std::shared_ptr< EngineParameter > dy
SeFloat drawArea(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
PixelCoordinate getMinPixel(SeFloat centroid_x, SeFloat centroid_y) const override
SeFloat getRadiusSquared(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
PixelCoordinate getMaxPixel(SeFloat centroid_x, SeFloat centroid_y) const override
SeFloat getArea(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
EllipticalAperture(SeFloat cxx, SeFloat cyy, SeFloat cxy, SeFloat rad_max)
SeFloat32 SeFloat
Definition Types.h:32
T sqrt(T... args)
A pixel coordinate made of two integers m_x and m_y.