@@ -71,12 +71,12 @@ void _check_vectors(const isce3::product::GeoGridParameters& geogrid,
71
71
if (geogrid.epsg () == 4326 ) {
72
72
slant_range_error_threshold = 1e-16 ;
73
73
incidence_angle_error_threshold = 1e-5 ;
74
- sat_position_error_threshold = 1e-7 ;
74
+ sat_position_error_threshold = 1e-3 ;
75
75
vel_unit_error_threshold = 1e-3 ;
76
76
} else {
77
77
slant_range_error_threshold = 1e-16 ;
78
78
incidence_angle_error_threshold = 1e-5 ;
79
- sat_position_error_threshold = 1e-5 ;
79
+ sat_position_error_threshold = 1e-3 ;
80
80
vel_unit_error_threshold = 1e-3 ;
81
81
}
82
82
@@ -144,33 +144,34 @@ void _check_vectors(const isce3::product::GeoGridParameters& geogrid,
144
144
std::pow (los_unit_test[1 ], 2 )));
145
145
146
146
// 3. Estimate platform position
147
- isce3::core::Vec3 sat_xyz_test, sat_llh_test;
147
+ isce3::core::Vec3 sat_xyz_test, sat_llh_test, los_xyz_test ;
148
148
if (proj->code () == 4326 ) {
149
149
// For epsg == 4326, vectors are given in ENU
150
- const isce3::core::Vec3 los_xyz_test =
150
+ los_xyz_test =
151
151
enu2xyz.dot (los_unit_test).normalized ();
152
152
sat_xyz_test = target_xyz + slant_range_test * los_xyz_test;
153
153
154
154
} else {
155
- const isce3::core::Vec3 look_vector_test =
156
- slant_range_test * los_unit_test;
157
- const isce3::core::Vec3 sat_proj_test =
158
- target_proj + look_vector_test;
159
- sat_llh_test = proj->inverse (sat_proj_test);
160
- sat_xyz_test = ellipsoid.lonLatToXyz (sat_llh_test);
155
+ const isce3::core::Vec3 target_to_sat_next_proj =
156
+ target_proj + los_unit_test;
157
+ const isce3::core::Vec3 target_to_sat_next_llh =
158
+ proj->inverse (target_to_sat_next_proj);
159
+ const isce3::core::Vec3 target_to_sat_next_xyz =
160
+ ellipsoid.lonLatToXyz (target_to_sat_next_llh);
161
+ los_xyz_test =
162
+ (target_to_sat_next_xyz - target_xyz).normalized ();
163
+ sat_xyz_test = target_xyz + slant_range_test * los_xyz_test;
161
164
}
162
165
163
- /* 3. Evaluate platform position from LOS vector and slant-range
166
+ /*
167
+ 3. Evaluate platform position from LOS vector and slant-range
164
168
distance extracted from metadata cubes (errors are multiplied).
165
- Absolute values are large, therefore they are normalized
166
- for comparison */
167
- double error_norm = std::sqrt (std::pow (sat_xyz_test.norm (), 2 ) +
168
- std::pow (sat_xyz.norm (), 2 ));
169
- ASSERT_NEAR (sat_xyz_test[0 ] / error_norm, sat_xyz[0 ] / error_norm,
169
+ */
170
+ ASSERT_NEAR (sat_xyz_test[0 ], sat_xyz[0 ],
170
171
sat_position_error_threshold);
171
- ASSERT_NEAR (sat_xyz_test[1 ] / error_norm , sat_xyz[1 ] / error_norm ,
172
+ ASSERT_NEAR (sat_xyz_test[1 ], sat_xyz[1 ],
172
173
sat_position_error_threshold);
173
- ASSERT_NEAR (sat_xyz_test[2 ] / error_norm , sat_xyz[2 ] / error_norm ,
174
+ ASSERT_NEAR (sat_xyz_test[2 ], sat_xyz[2 ],
174
175
sat_position_error_threshold);
175
176
176
177
// 4. Estimate velocity from cube along-track vector
0 commit comments