Skip to content

Commit 12d27ce

Browse files
committed
Remove accuracy argument from grav_undo_planets()
1 parent 157a9a4 commit 12d27ce

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

include/novas.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ int grav_undef(double jd_tdb, enum novas_accuracy accuracy, const double *pos_ap
11551155

11561156
int grav_planets(const double *pos_src, const double *pos_obs, const novas_planet_bundle *planets, double *out);
11571157

1158-
int grav_undo_planets(const double *pos_app, const double *pos_obs, enum novas_accuracy accuracy, const novas_planet_bundle *planets, double *out);
1158+
int grav_undo_planets(const double *pos_app, const double *pos_obs, const novas_planet_bundle *planets, double *out);
11591159

11601160
int make_airborne_observer(const on_surface *location, const double *vel, observer *obs);
11611161

src/frames.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ int novas_app_to_geom(const novas_frame *frame, enum novas_reference_system sys,
923923
frame_aberration(frame, APP_TO_GEOM, app_pos);
924924

925925
// Undo gravitational deflection and aberration.
926-
prop_error(fn, grav_undo_planets(app_pos, frame->obs_pos, frame->accuracy, &frame->planets, geom_icrs), 0);
926+
prop_error(fn, grav_undo_planets(app_pos, frame->obs_pos, &frame->planets, geom_icrs), 0);
927927

928928
return 0;
929929
}

src/novas.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -4388,8 +4388,6 @@ int grav_planets(const double *pos_src, const double *pos_obs, const novas_plane
43884388
* @param pos_obs [AU] Position 3-vector of observer (or the geocenter), with respect to
43894389
* origin at solar system barycenter, referred to ICRS axes,
43904390
* components in AU.
4391-
* @param accuracy NOVAS_FULL_ACCURACY (0) for sub-μas accuracy or NOVAS_REDUCED_ACCURACY (1)
4392-
* for sub-mas accuracy.
43934391
* @param planets Apparent planet data containing positions and velocities for the major
43944392
* gravitating bodies in the solar-system.
43954393
* @param[out] out [AU] Nominal position vector of observed object, with respect to origin at
@@ -4405,12 +4403,12 @@ int grav_planets(const double *pos_src, const double *pos_obs, const novas_plane
44054403
* @since 1.1
44064404
* @author Attila Kovacs
44074405
*/
4408-
int grav_undo_planets(const double *pos_app, const double *pos_obs, enum novas_accuracy accuracy, const novas_planet_bundle *planets, double *out) {
4406+
int grav_undo_planets(const double *pos_app, const double *pos_obs, const novas_planet_bundle *planets, double *out) {
44094407
static const char *fn = "grav_undo_planets";
44104408

4409+
const double tol = 1e-13;
44114410
double pos_def[3] = { }, pos0[3] = { };
44124411
double l;
4413-
double tol = accuracy == NOVAS_FULL_ACCURACY ? 1e-13 : 1e-10;
44144412
int i;
44154413

44164414
if(!pos_app || !pos_obs)
@@ -4499,7 +4497,6 @@ int obs_planets(double jd_tdb, enum novas_accuracy accuracy, const double *pos_o
44994497
if(!pos_obs)
45004498
return novas_error(-1, EINVAL, fn, "NULL observer position parameter");
45014499

4502-
45034500
// Set up the structures of type 'object' containing the body information.
45044501
if(!initialized) {
45054502
for(i = 0; i < NOVAS_PLANETS; i++)
@@ -4666,7 +4663,7 @@ int grav_undef(double jd_tdb, enum novas_accuracy accuracy, const double *pos_ap
46664663
return novas_error(-1, EINVAL, fn, "NULL source position 3-vector: pos_app=%p, out=%p", pos_app, out);
46674664

46684665
prop_error(fn, obs_planets(jd_tdb, accuracy, pos_obs, pl_mask, &planets), 0);
4669-
prop_error(fn, grav_undo_planets(pos_app, pos_obs, accuracy, &planets, out), 0);
4666+
prop_error(fn, grav_undo_planets(pos_app, pos_obs, &planets, out), 0);
46704667
return 0;
46714668
}
46724669

test/src/test-errors.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -917,13 +917,13 @@ static int test_grav_undo_planets() {
917917
double p[3] = {2.0}, po[3] = {0.0, 1.0}, out[3] = {};
918918
int n = 0;
919919

920-
if(check("grav_undo_planets:pos_app", -1, grav_undo_planets(NULL, po, NOVAS_REDUCED_ACCURACY, &planets, out))) n++;
921-
if(check("grav_undo_planets:pos_obs", -1, grav_undo_planets(p, NULL, NOVAS_REDUCED_ACCURACY, &planets, out))) n++;
922-
if(check("grav_undo_planets:planets", -1, grav_undo_planets(p, po, NOVAS_REDUCED_ACCURACY, NULL, out))) n++;
923-
if(check("grav_undo_planets:pos_src", -1, grav_undo_planets(p, po, NOVAS_REDUCED_ACCURACY, &planets, NULL))) n++;
920+
if(check("grav_undo_planets:pos_app", -1, grav_undo_planets(NULL, po, &planets, out))) n++;
921+
if(check("grav_undo_planets:pos_obs", -1, grav_undo_planets(p, NULL, &planets, out))) n++;
922+
if(check("grav_undo_planets:planets", -1, grav_undo_planets(p, po, NULL, out))) n++;
923+
if(check("grav_undo_planets:pos_src", -1, grav_undo_planets(p, po, &planets, NULL))) n++;
924924

925925
planets.mask = 1 << NOVAS_SUN;
926-
if(check("grav_undo_planets:converge", -1, grav_undo_planets(p, po, NOVAS_REDUCED_ACCURACY, &planets, out))) {
926+
if(check("grav_undo_planets:converge", -1, grav_undo_planets(p, po, &planets, out))) {
927927
if(check("grav_undo_planets:converge:errno", ECANCELED, errno)) n++;
928928
}
929929

0 commit comments

Comments
 (0)