Skip to content

Commit

Permalink
More fixes, generally consistent with NOVAS C 3.1 (given known issues).
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Feb 8, 2024
1 parent 1494ac4 commit 85e4b94
Show file tree
Hide file tree
Showing 42 changed files with 1,072 additions and 1,091 deletions.
16 changes: 11 additions & 5 deletions README-headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,19 @@ provided by SuperNOVAS over the upstream NOVAS C 3.1 code:
`equinox` argument was changing from 1 to 0, and back to 1 again with the date being held the same. This affected
routines downstream also, such as `sidereal_time()`.

- Fixes accuracy bug in `ecl2equ_vec()`, `equ2ecl_vec()`, `geo_posvel()`, `place()`, and `sidereal_time()`, which
returned a cached value for the other accuracy if the other input parameters are the same as a prior call,
except the accuracy.
- Fixes accuracy switch bug in `cio_basis()`, `cio_location()`, `ecl2equ`, `equ2ecl_vec()`, `geo_posvel()`,
`place()`, and `sidereal_time()`. All these functions returned a cached value for the other accuracy if the other
input parameters are the same as a prior call, except the accuracy.

- Fix bug in `equ2ecl_vec()` and `ecl2equ_vec()` whereby a query with `coord_sys = 2` (GCRS) has overwritten the
cached mean obliquity value for `coord_sys = 0` (mean equinox of date). As a result, a subsequent call with
`coord_sys = 0` and the same date as before would return the results GCRS coordinates instead of the
requested mean equinox of date coordinates.

- The use of `fmod()` in NOVAS C 3.1 led to the wrong results when the numerator was negative and the result was
not turned into a proper remainder. This affected the calculation of the mean anomaly in `solsys3.c` (line 261)
for dates prior to J2000.
not turned into a proper remainder. This affected the calculation of the mean anomaly in `solsys3.c` (line 261)
and the fundamental arguments calculted in `fund_args()` and `ee_ct()` for dates prior to J2000. Less
critically, it also was the reason `cal_date()` did not work for negative JD values.


-----------------------------------------------------------------------------
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,19 @@ provided by SuperNOVAS over the upstream NOVAS C 3.1 code:
`equinox` argument was changing from 1 to 0, and back to 1 again with the date being held the same. This affected
routines downstream also, such as `sidereal_time()`.

- Fixes accuracy bug in `ecl2equ_vec()`, `equ2ecl_vec()`, `geo_posvel()`, `place()`, and `sidereal_time()`, which
returned a cached value for the other accuracy if the other input parameters are the same as a prior call,
except the accuracy.
- Fixes accuracy switch bug in `cio_basis()`, `cio_location()`, `ecl2equ`, `equ2ecl_vec()`, `geo_posvel()`,
`place()`, and `sidereal_time()`. All these functions returned a cached value for the other accuracy if the other
input parameters are the same as a prior call, except the accuracy.

- Fix bug in `equ2ecl_vec()` and `ecl2equ_vec()` whereby a query with `coord_sys = 2` (GCRS) has overwritten the
cached mean obliquity value for `coord_sys = 0` (mean equinox of date). As a result, a subsequent call with
`coord_sys = 0` and the same date as before would return the results GCRS coordinates instead of the
requested mean equinox of date coordinates.

- The use of `fmod()` in NOVAS C 3.1 led to the wrong results when the numerator was negative and the result was
not turned into a proper remainder. This affected the calculation of the mean anomaly in `solsys3.c` (line 261)
for dates prior to J2000.
not turned into a proper remainder. This affected the calculation of the mean anomaly in `solsys3.c` (line 261)
and the fundamental arguments calculted in `fund_args()` and `ee_ct()` for dates prior to J2000. Less
critically, it also was the reason `cal_date()` did not work for negative JD values.


-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions include/novas.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ int place_cirs(double jd_tt, const object *source, enum novas_accuracy accuracy,

double refract_astro(const on_surface *location, enum novas_refraction_model ref_option, double zd_calc);

int light_time2(double jd_tdb, const object *ss_object, const double *pos_obs, double tlight0, enum novas_accuracy accuracy, double *pos,
double *vel, double *tlight);
int light_time2(double jd_tdb, const object *ss_object, const double *pos_obs, double tlight0, enum novas_accuracy accuracy, double *prel,
double *vsb, double *tlight);

double tt2tdb(double jd_tt);

Expand Down
Loading

0 comments on commit 85e4b94

Please sign in to comment.