SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ErrorEllipseTask.cpp
Go to the documentation of this file.
1
17/*
18 * ErrorEllipseTask.cpp
19 *
20 * Created on: Feb 11 2022
21 * Author: mkuemmel
22 */
23
24#include <iostream>
25
32
34
35namespace SourceXtractor {
36
38 const auto& pixel_variances = source.getProperty<DetectionFramePixelValues>().getVariances();
39 const auto& centroid_x = source.getProperty<PixelCentroid>().getCentroidX();
40 const auto& centroid_y = source.getProperty<PixelCentroid>().getCentroidY();
41 const auto& coordinates = source.getProperty<PixelCoordinateList>().getCoordinateList();
42 auto total_intensity = source.getProperty<ShapeParameters>().getIntensity();
43 auto singu = source.getProperty<ShapeParameters>().getSinguFlag();
44
45 SeFloat x_2_error = 0.0;
46 SeFloat y_2_error = 0.0;
47 SeFloat x_y_error = 0.0;
48
50
51 auto j = pixel_variances.begin();
52 for (auto pixel_coord : coordinates) {
53 SeFloat variance = *j++;
56
60
62 }
63
68
69 //esum *= 0.08333/flux2; // from the original SE2 code
71 // handle fully correlated x/y
75 }
76
77 /*------------------------- Error ellipse parameters ------------------------*/
78 /* if (FLAG(obj2.poserr_a))
79 {
80 double pmx2,pmy2,temp,theta;
81
82 if (fabs(temp=obj->poserr_mx2-obj->poserr_my2) > 0.0)
83 theta = atan2(2.0 * obj->poserr_mxy,temp) / 2.0;
84 else
85 theta = PI/4.0;
86
87 temp = sqrt(0.25*temp*temp+obj->poserr_mxy*obj->poserr_mxy);
88 pmy2 = pmx2 = 0.5*(obj->poserr_mx2+obj->poserr_my2);
89 pmx2+=temp;
90 pmy2-=temp;
91
92 obj2->poserr_a = (float)sqrt(pmx2);
93 obj2->poserr_b = (float)sqrt(pmy2);
94 obj2->poserr_theta = theta*180.0/PI;
95 }
96 */
97
98 // angle of the error ellipse
101 if (temp_error>0.0)
102 theta_error = atan2(2.0*x_y_error, temp_error); // when dividing by 2.0 as in SE2 the range is -45 < theta_error < 45 which is smaller than in SE2
103 else
104 theta_error = M_PI /4.0;
105
106 // major/minor axis for the error ellipse
112
113 // set the property
115}
116
117
118}
T atan2(T... args)
The values of a Source's pixels in the detection image. They are returned as a vector in the same ord...
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values.
The SourceInterface is an abstract "source" that has properties attached to it.
T fabs(T... args)
T sqrt(T... args)