From fbef9ccf2e4bd5f33f1615938368ea9ff48ebdba Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Mon, 13 May 2024 08:10:06 -0400 Subject: [PATCH] v1.0.1 bug fix release (#13) * Add cirs_to_app_ra() and app_to_cirs_ra() for convenience. * Use IAU definition of AU. (legacy definition of AU, based on DE405 ephemeris, as DE405_AU.) * Fixes to example.c * Minor tweak to example.yml workflow * Updated and edited documentation --- .github/workflows/dox.yml | 36 +++++++++++++++++++++ .github/workflows/example.yml | 24 ++++++++++++++ .github/workflows/indexnow.yml | 2 +- .settings/language.settings.xml | 2 +- CHANGELOG.md | 45 ++++++++++++++++++++++---- README.md | 29 +++++++++-------- examples/example.c | 4 +-- include/novas.h | 27 +++++++++++++--- resources/header.html | 10 +++--- src/novas.c | 56 ++++++++++++++++++++++++++++++++- src/solsys1.c | 4 +-- src/solsys2.c | 8 ++--- test/reference/rad_vel.out | 44 +++++++++++++------------- test/src/test-super.c | 15 +++++++++ 14 files changed, 242 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/example.yml diff --git a/.github/workflows/dox.yml b/.github/workflows/dox.yml index d5f7cc9e..7a369999 100644 --- a/.github/workflows/dox.yml +++ b/.github/workflows/dox.yml @@ -1,6 +1,9 @@ name: API documentation on: + release: + types: [published] + push: paths: - 'src/**' @@ -75,3 +78,36 @@ jobs: git add -A git commit -m "[automated site update]" && git push || true + + changelog-update: + name: Update CHANGELOG on github pages + if: github.repository_owner == 'Smithsonian' && contains(github.event.head_commit.message, 'changelog update') + + runs-on: ubuntu-latest + steps: + + - name: Checkout source + uses: actions/checkout@v4 + + - name: Checkout gh-pages + uses: actions/checkout@v4 + with: + ref: 'gh-pages' + path: site + + - name: Assert site/doc/ + run: mkdir -p site/doc + + - name: Copy CHANGELOG + run: cp CHANGELOG.md site/doc/ + + - name: Push to pages + run: | + cd site + git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions" + git add -A + git commit -m "[automated site update]" && git push || true + + + diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 00000000..818e70e3 --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,24 @@ +name: Example + +on: + push: + paths: + - 'examples/**' + - '.github/workflows/example.yml' + +jobs: + + build: + name: Check examples + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Compile example.c + run: | + cd examples + gcc -c -Wall -Werror -I ../include example.c + + + diff --git a/.github/workflows/indexnow.yml b/.github/workflows/indexnow.yml index 3081bfd8..a879f0be 100644 --- a/.github/workflows/indexnow.yml +++ b/.github/workflows/indexnow.yml @@ -15,6 +15,6 @@ jobs: with: sitemap-location: 'https://smithsonian.github.io/SuperNOVAS/sitemap.xml' key: ${{ secrets.INDEXNOW_KEY }} - since-unit: week + key-location: 'https://smithsonian.github.io/SuperNOVAS/${{ secrets.INDEXNOW_KEY }}.txt' limit: 200 diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 5850d763..102e1af4 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a5715b6..31b46414 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,39 @@ # Changelog +All notable changes to the SuperNOVAS library will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [1.0.1] -- 2024-05-13 + +Bug fix release with minor changes. + +### Fixed + + - `cirs_to_itrs()`, `itrs_to_cirs()`, `tod_to_itrs()`, and `itrs_to_tod()` all had a unit conversion bug in using the + `ut1_to_tt` argument [s] when converting TT-based Julian date to UT1-based JD [day] internally. + + - Fixed errors in `example.c` [by hannorein]. + +### Added + + - Added `cirs_to_app_ra()` and `app_to_cirs_ra()` for convenience to convert between right ascensions measured from + the CIO (for CIRS) vs measured from the true equinox of date, on the same true equator of date. + +### Changes + + - Changed definition of `NOVAS_AU` to the IAU definition of exactly 1.495978707e+11 m. The old definition is also + available as `DE405_AU`. + - Various corrections and changes to documentation. + + ## [1.0.0] - 2024-03-01 -This is the initial release of the SuperNOVAS library. +This is the initial release of the SuperNOVAS library. Changes are indicated w.r.t. the upstream NOVAS C 3.1 library +from which SuperNOVAS is forked from. ### Fixed @@ -32,13 +62,13 @@ This is the initial release of the SuperNOVAS library. - Fixes multiple NOVAS C 3.1 bugs related to using cached values in `cio_basis()` with alternating CIO location reference systems. This affected many CIRS-based position calculations downstream. - - Fixes NOVAS C 3.1 buga in `equ2ecl_vec()` and `ecl2equ_vec()` whereby a query with `coord_sys = 2` (GCRS) has + - Fixes NOVAS C 3.1 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. - Fixes NOVAS C 3.1 `aberration()` returning NaN vectors if the `ve` argument is 0. It now returns the unmodified - input vector appropriately instead. + input vector appropriately instead. - Fixes unpopulated `az` output value in `equ2hor()` at zenith in NOVAS C 3.1. While any azimuth is acceptable really, it results in unpredictable behavior. Hence, we set `az` to 0.0 for zenith to be consistent. @@ -76,7 +106,7 @@ This is the initial release of the SuperNOVAS library. `set_ephem_provider()` can set the user-specified function to use with these to actually read ephemeris data (e.g. from a JPL ephemeris file). - * If CIO locations vs GSRS are important to the user, the user may call `set_cio_locator_file()` at runtime to + * If CIO locations vs GCRS are important to the user, the user may call `set_cio_locator_file()` at runtime to specify the location of the binary CIO interpolation table (e.g. `cio_ra.bin`) to use, even if the library was compiled with the different default CIO locator path. @@ -119,7 +149,7 @@ This is the initial release of the SuperNOVAS library. `planet_eph_manager` vs `planet_ephem_provider()`. - New `novas_case_sensitive(int)` to enable (or disable) case-sensitive processing of object names. (By default NOVAS - `object` names were converted to upper-case, making them effectively case-insensitive.) + `object` names are converted to upper-case, making them effectively case-insensitive.) - New `make_planet()` and `make_ephem_object()` to make it simpler to configure Solar-system objects. @@ -172,6 +202,9 @@ This is the initial release of the SuperNOVAS library. - Object ID numbers are `long` instead of `short` (in NOVAS C 3.1) to accommodate NAIF IDs, which require minimum 32-bit integers. + + - `precession()` can now take arbitrary input and output epochs. Unlike NOVAS C 3.1, it is not required that either + of those epochs be J2000. - `cel2ter()` and `ter2cel()` can now process 'option'/'class' = 1 (`NOVAS_REFERENCE_CLASS`) regardless of the methodology (`EROT_ERA` or `EROT_GST`) used to input or output coordinates in GCRS (unlike in NOVAS C 3.1). @@ -195,7 +228,7 @@ This is the initial release of the SuperNOVAS library. - IAU 2000 nutation made a bit faster vs NOVAS C 3.1, via reducing the the number of floating-point multiplications necessary by skipping terms that do not contribute. Its coefficients are also packed more frugally in memory, - resulting in a smaller foortprint than in NOVAS C 3.1. + resulting in a smaller footprint than in NOVAS C 3.1. - More efficient paging (cache management) for `cio_array()` vs NOVAS C 3.1, including I/O error checking. diff --git a/README.md b/README.md index eb391ac6..51e4fc8b 100644 --- a/README.md +++ b/README.md @@ -139,9 +139,13 @@ provided by SuperNOVAS over the upstream NOVAS C 3.1 code: ## Compatibility with NOVAS C 3.1 SuperNOVAS strives to maintain API compatibility with the upstream NOVAS C 3.1 library, but not binary compatibility. -In practical terms it means that you cannot simply drop-in replace your compiled objects (e.g. `novas.o`), or the -static (e.g. `novas.a`) or shared (e.g. `novas.so`) libraries, from NOVAS C 3.1 with that from SuperNOVAS. Instead, -you will need to (re)build your application with the SuperNOVAS versions of these. + +If you have code that was written for NOVAS C 3.1, it should work with SuperNOVAS as is, without modifications. Simply +(re)build your application against SuperNOVAS, and you are good to go. + +The lack of binary compatibility just means that you cannot drop-in replace your compiled objects (e.g. `novas.o`, or +the static `novas.a`, or the shared `novas.so`) libraries, from NOVAS C 3.1 with those from SuperNOVAS. Instead, you +will have to build (compile) your application referencing the SuperNOVAS headers and/or libraries from the start. This is because some function signatures have changed, e.g. to use an `enum` argument instead of the nondescript `short int` argument of NOVAS C 3.1, or because we added a return value to a function that was declared `void` in @@ -405,14 +409,7 @@ above), you have one more step to go still. The CIRS equator is the true equator not the true equinox of date. Thus, we must correct for the difference of the origins to get the true apparent R.A.: ```c - double ra_cio; // [h] R.A. of the CIO (from the true equinox) we'll calculate - - // Obtain the R.A. [h] of the CIO at the given date - cio_ra(jd_tt, NOVAS_FULL_ACCURACY, &ra_cio); - - // Convert CIRS R.A. to true apparent R.A., keeping the result in the [0:24] h range - ra = remainder(ra + ra_cio, 24.0); - if(ra < 0.0) ra += 24.0; + ra = cirs_to_app_ra(jd_tt, NOVAS_FULL_ACCURACY, ra); ``` #### B. Azimuth and elevation angles at the observing location @@ -852,6 +849,7 @@ And, when you are done using the ephemeris file, you should close it with Note, that at any given time `eph_manager` can have only one ephemeris data file opened. You cannot use it to retrieve data from multiple ephemeris input files at the same time. (But you can with the CSPICE toolkit, which you can integrate as discussed further above!) + That's all, except the warning that this method will not work with newer JPL ephemeris data, beyond DE421. @@ -869,10 +867,11 @@ your application should set your planetary ephemeris provider at runtime via: ``` Integrating JPL ephemeris data this way can be arduous. You will need to compile and link FORTRAN with C (not the end -of the world), but you may also have to modify `jplint.f` (providing the intermediate FORTRAN `jplint_` / `jplihp_()` -interfaces to `pleph`) to work with the version of `pleph.f` that you will be using. Unless you already have code that -relies on this method, you are probably better off choosing one of the other ways for integrating planetary ephemeris -data with SuperNOVAS. +of the world), but you may also have to modify `jplint.f` (providing the intermediate FORTRAN `jplint_()` / +`jplihp_()` interfaces to `pleph`) to work with the version of `pleph.f` that you will be using. Unless you already +have code that relies on this method, you are probably better off choosing one of the other ways for integrating +planetary ephemeris data with SuperNOVAS. + ### 3. Explicit linking of custom ephemeris functions diff --git a/examples/example.c b/examples/example.c index 60683b99..7c811827 100644 --- a/examples/example.c +++ b/examples/example.c @@ -15,7 +15,6 @@ #include #include "novas.h" -#include "novascon.h" #include "eph_manager.h" // For solsys1.c int main(void) { @@ -104,6 +103,7 @@ int main(void) { // Establish time arguments. jd_utc = julian_date(2008, 4, 24, 10.605); + jd_tt = jd_utc + ((double) leap_secs + 32.184) / 86400.0; jd_ut1 = jd_utc + ut1_utc / 86400.0; delta_t = get_ut1_to_tt(leap_secs, ut1_utc); @@ -195,7 +195,7 @@ int main(void) { return (error); } - error = equ2ecl_vec(T0, NOVAS_MEAN_EQUATOR, NOVAS_FULL_ACCURACY, pos, pose); + error = equ2ecl_vec(NOVAS_JD_J2000, NOVAS_MEAN_EQUATOR, NOVAS_FULL_ACCURACY, pos, pose); if(error != 0) { printf("Error %d from equ2ecl_vec.", error); return (error); diff --git a/include/novas.h b/include/novas.h index bbcf8312..c1d100f2 100644 --- a/include/novas.h +++ b/include/novas.h @@ -2,7 +2,7 @@ * @file * * @author G. Kaplan and A. Kovacs - * @version 1.0.0 + * @version 1.0.1 * * SuperNOVAS astrometry softwate based on the Naval Observatory Vector Astrometry Software (NOVAS). * It has been modified to fix outstanding issues and to make it easier to use. @@ -53,7 +53,7 @@ #define SUPERNOVAS_MAJOR_VERSION 1 ///< API major version #define SUPERNOVAS_MINOR_VERSION 0 ///< API minor version #define SUPERNOVAS_PATCHLEVEL 1 ///< Integer sub version of the release -#define SUPERNOVAS_RELEASE_STRING "-devel" ///< Additional release information in version, e.g. "-1", or "-rc1". +#define SUPERNOVAS_RELEASE_STRING "" ///< Additional release information in version, e.g. "-1", or "-rc1". /// The version string for this library #define SUPERNOVAS_VERSION_STRING #SUPERNOVAS_MAJOR_VERSION "." #SUPERNOVAS_MINOR_VERSION \ @@ -85,10 +85,16 @@ /// [m/s] Speed of light in meters/second is a defining physical constant. #define NOVAS_C 299792458.0 -/// [m] Astronomical unit in meters. Value is AU_SEC * C. -#define NOVAS_AU 1.4959787069098932e+11 +/// [m] Astronomical unit. IAU definition. +/// See IAU 2012 Resolution B2. +/// @sa DE405_AU +#define NOVAS_AU 1.495978707e+11 -/// [AU] Light-time for one astronomical unit (AU) in seconds, from DE-405. +/// [m] Astronomical unit. based on DE-405. (old definition) +/// @sa NOVAS_AU +#define DE405_AU 1.4959787069098932e+11 + +/// [AU] Light-time for one astronomical unit (AU) in seconds. #define NOVAS_AU_SEC ( NOVAS_AU / NOVAS_C ) /// [AU/day] Speed of light in AU/day. Value is 86400 / AU_SEC. @@ -869,8 +875,19 @@ int itrs_to_hor(const on_surface *location, const double *itrs, double *az, doub int hor_to_itrs(const on_surface *location, double az, double za, double *itrs); +// ---------------------- Added in 1.0.1 ------------------------- +double cirs_to_app_ra(double jd_tt, enum novas_accuracy accuracy, double ra); + +double app_to_cirs_ra(double jd_tt, enum novas_accuracy accuracy, double ra); + + +// <================= END of SuperNOVAS API =====================> + #include "solarsystem.h" + +// <================= SuperNOVAS internals ======================> + /// \cond PRIVATE #ifdef __NOVAS_INTERNAL_API__ diff --git a/resources/header.html b/resources/header.html index 70477ae8..82f52518 100644 --- a/resources/header.html +++ b/resources/header.html @@ -14,7 +14,7 @@ - + @@ -29,10 +29,10 @@ gtag('config', 'G-HLFWKSM8V9'); - - - - + + + + $projectname: $title $title diff --git a/src/novas.c b/src/novas.c index 461184fa..1909304c 100644 --- a/src/novas.c +++ b/src/novas.c @@ -2,7 +2,7 @@ * @file * * @author G. Kaplan and A. Kovacs - * @version 1.0.0 + * @version 1.0.1 * * SuperNOVAS astrometry softwate based on the Naval Observatory Vector Astrometry Software (NOVAS). * It has been modified to fix outstanding issues and to make it easier to use. @@ -5167,6 +5167,60 @@ short cio_ra(double jd_tt, enum novas_accuracy accuracy, double *ra_cio) { return 0; } +/** + * Converts a CIRS right ascension coordinate (measured from the CIO) to an apparent R.A. + * measured from the true equinox of date. + * + * @param jd_tt [day] Terrestrial Time (TT) based Julian date + * @param accuracy NOVAS_FULL_ACCURACY (0) or NOVAS_REDUCED_ACCURACY (1) + * @param ra [h] The CIRS right ascension coordinate, measured from the CIO. + * @return [h] the apparent R.A. coordinate measured from the true equinox of date [0:24]. + * + * @see app_to_cirs_ra() + * + * @since 1.0.1 + * @author Attila Kovacs + */ +double cirs_to_app_ra(double jd_tt, enum novas_accuracy accuracy, double ra) { + double ra_cio; // [h] R.A. of the CIO (from the true equinox) we'll calculate + + // Obtain the R.A. [h] of the CIO at the given date + cio_ra(jd_tt, NOVAS_FULL_ACCURACY, &ra_cio); + + // Convert CIRS R.A. to true apparent R.A., keeping the result in the [0:24] h range + ra = remainder(ra + ra_cio, 24.0); + if(ra < 0.0) ra += 24.0; + + return ra; +} + +/** + * Converts an apparent right ascension coordinate (measured from the true equinox of date) to a + * CIRS R.A., measured from the CIO. + * + * @param jd_tt [day] Terrestrial Time (TT) based Julian date + * @param accuracy NOVAS_FULL_ACCURACY (0) or NOVAS_REDUCED_ACCURACY (1) + * @param ra [h] the apparent R.A. coordinate measured from the true equinox of date. + * @return [h] The CIRS right ascension coordinate, measured from the CIO [0:24]. + * + * @see cirs_to_app_ra() + * + * @since 1.0.1 + * @author Attila Kovacs + */ +double app_to_cirs_ra(double jd_tt, enum novas_accuracy accuracy, double ra) { + double ra_cio; // [h] R.A. of the CIO (from the true equinox) we'll calculate + + // Obtain the R.A. [h] of the CIO at the given date + cio_ra(jd_tt, NOVAS_FULL_ACCURACY, &ra_cio); + + // Convert CIRS R.A. to true apparent R.A., keeping the result in the [0:24] h range + ra = remainder(ra - ra_cio, 24.0); + if(ra < 0.0) ra += 24.0; + + return ra; +} + /** * Sets the CIO interpolaton data file to use to interpolate CIO locations vs the GCRS. * The necessary binary data file may be obtained via the cio_file.c utility diff --git a/src/solsys1.c b/src/solsys1.c index 609c42a4..d7d4f176 100644 --- a/src/solsys1.c +++ b/src/solsys1.c @@ -146,9 +146,9 @@ short planet_eph_manager_hp(const double jd_tdb[2], enum novas_planet body, enum * @param body Major planet number (or that for Sun, Moon, or Solar-system barycenter) * @param origin NOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1), or 2 for Earth geocenter * -- relative to which to report positions and velocities. - * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular * coordinates in AU referred to the ICRS. - * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular * system referred to the ICRS, in AU/day. * @return 0 if successful, or else an error code of solarsystem(). * diff --git a/src/solsys2.c b/src/solsys2.c index 61bcc7b1..de7d5225 100644 --- a/src/solsys2.c +++ b/src/solsys2.c @@ -66,9 +66,9 @@ extern void jplihp_(const double *jd_tdb, long *targ, long *cent, double *posvel * @param body Major planet number (or that for Sun, Moon, or Solar-system barycenter) * @param origin NOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1), or 2 for Earth geocenter * -- relative to which to report positions and velocities. - * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular * coordinates in AU referred to the ICRS. - * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular * system referred to the ICRS, in AU/day. * @return 0 if successful, or else 1 if the 'body' or 'origin' argument is * invalid, or else 2 if the 'jplint_()' call failed. @@ -158,9 +158,9 @@ short planet_jplint(double jd_tdb, enum novas_planet body, enum novas_origin ori * @param body Major planet number (or that for Sun, Moon, or Solar-system barycenter) * @param origin NOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1), or 2 for Earth geocenter * -- relative to which to report positions and velocities. - * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] position [AU] Position vector of 'body' at jd_tdb; equatorial rectangular * coordinates in AU referred to the ICRS. - * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular + * @param[out] velocity [AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular * system referred to the ICRS, in AU/day. * @return 0 if successful, or else an error code of solarsystem(). * diff --git a/test/reference/rad_vel.out b/test/reference/rad_vel.out index 15cc12a7..b1b04682 100644 --- a/test/reference/rad_vel.out +++ b/test/reference/rad_vel.out @@ -3,7 +3,7 @@ -10000.0 22+20 S2 O1 A0: 3.002410 --10000.0 22+20 S2 O2 A0: -13454.981910 +-10000.0 22+20 S2 O2 A0: -13454.981911 -10000.0 16-20 S2 O0 A0: 9.995353 @@ -21,25 +21,25 @@ -10000.0 EARTH S0 O1 A0: 0.118525 --10000.0 EARTH S0 O2 A0: -13269.692257 +-10000.0 EARTH S0 O2 A0: -13269.692258 0.0 22+20 S2 O0 A0: 9.995353 0.0 22+20 S2 O1 A0: 32.248645 - 0.0 22+20 S2 O2 A0: -13427.829742 + 0.0 22+20 S2 O2 A0: -13427.829743 0.0 16-20 S2 O0 A0: 9.995353 0.0 16-20 S2 O1 A0: -8.660204 - 0.0 16-20 S2 O2 A0: 8352.477325 + 0.0 16-20 S2 O2 A0: 8352.477326 0.0 SUN S0 O0 A0: -0.008546 0.0 SUN S0 O1 A0: -29.336121 - 0.0 SUN S0 O2 A0: 17001.598559 + 0.0 SUN S0 O2 A0: 17001.598560 0.0 EARTH S0 O0 A0: 0.202616 @@ -51,7 +51,7 @@ 10000.0 22+20 S2 O1 A0: -14.454478 - 10000.0 22+20 S2 O2 A0: -13471.128617 + 10000.0 22+20 S2 O2 A0: -13471.128618 10000.0 16-20 S2 O0 A0: 9.995353 @@ -69,13 +69,13 @@ 10000.0 EARTH S0 O1 A0: 0.095426 - 10000.0 EARTH S0 O2 A0: 9450.472941 + 10000.0 EARTH S0 O2 A0: 9450.472942 10000.0 22+20 S2 O0 A0: 9.995353 10000.0 22+20 S2 O1 A0: -14.454478 - 10000.0 22+20 S2 O2 A0: -13471.128617 + 10000.0 22+20 S2 O2 A0: -13471.128618 10000.0 16-20 S2 O0 A0: 9.995353 @@ -93,13 +93,13 @@ 10000.0 EARTH S0 O1 A0: 0.095426 - 10000.0 EARTH S0 O2 A0: 9450.472941 + 10000.0 EARTH S0 O2 A0: 9450.472942 10000.0 22+20 S2 O0 A0: 9.995353 10000.0 22+20 S2 O1 A0: -14.448132 - 10000.0 22+20 S2 O2 A0: -13471.129438 + 10000.0 22+20 S2 O2 A0: -13471.129439 10000.0 16-20 S2 O0 A0: 9.995353 @@ -117,13 +117,13 @@ 10000.0 EARTH S0 O1 A0: 0.070141 - 10000.0 EARTH S0 O2 A0: 9447.855995 + 10000.0 EARTH S0 O2 A0: 9447.855996 -10000.0 22+20 S2 O0 A1: 9.995353 -10000.0 22+20 S2 O1 A1: 3.002410 --10000.0 22+20 S2 O2 A1: -13454.981910 +-10000.0 22+20 S2 O2 A1: -13454.981911 -10000.0 16-20 S2 O0 A1: 9.995353 @@ -141,25 +141,25 @@ -10000.0 EARTH S0 O1 A1: 0.118525 --10000.0 EARTH S0 O2 A1: -13269.692257 +-10000.0 EARTH S0 O2 A1: -13269.692258 0.0 22+20 S2 O0 A1: 9.995353 0.0 22+20 S2 O1 A1: 32.248645 - 0.0 22+20 S2 O2 A1: -13427.829742 + 0.0 22+20 S2 O2 A1: -13427.829743 0.0 16-20 S2 O0 A1: 9.995353 0.0 16-20 S2 O1 A1: -8.660204 - 0.0 16-20 S2 O2 A1: 8352.477325 + 0.0 16-20 S2 O2 A1: 8352.477326 0.0 SUN S0 O0 A1: -0.008546 0.0 SUN S0 O1 A1: -29.336121 - 0.0 SUN S0 O2 A1: 17001.598559 + 0.0 SUN S0 O2 A1: 17001.598560 0.0 EARTH S0 O0 A1: 0.202616 @@ -171,7 +171,7 @@ 10000.0 22+20 S2 O1 A1: -14.454478 - 10000.0 22+20 S2 O2 A1: -13471.128617 + 10000.0 22+20 S2 O2 A1: -13471.128618 10000.0 16-20 S2 O0 A1: 9.995353 @@ -189,13 +189,13 @@ 10000.0 EARTH S0 O1 A1: 0.095426 - 10000.0 EARTH S0 O2 A1: 9450.472941 + 10000.0 EARTH S0 O2 A1: 9450.472942 10000.0 22+20 S2 O0 A1: 9.995353 10000.0 22+20 S2 O1 A1: -14.454478 - 10000.0 22+20 S2 O2 A1: -13471.128617 + 10000.0 22+20 S2 O2 A1: -13471.128618 10000.0 16-20 S2 O0 A1: 9.995353 @@ -213,13 +213,13 @@ 10000.0 EARTH S0 O1 A1: 0.095426 - 10000.0 EARTH S0 O2 A1: 9450.472941 + 10000.0 EARTH S0 O2 A1: 9450.472942 10000.0 22+20 S2 O0 A1: 9.995353 10000.0 22+20 S2 O1 A1: -14.448132 - 10000.0 22+20 S2 O2 A1: -13471.129438 + 10000.0 22+20 S2 O2 A1: -13471.129439 10000.0 16-20 S2 O0 A1: 9.995353 @@ -237,4 +237,4 @@ 10000.0 EARTH S0 O1 A1: 0.070141 - 10000.0 EARTH S0 O2 A1: 9447.855995 + 10000.0 EARTH S0 O2 A1: 9447.855996 diff --git a/test/src/test-super.c b/test/src/test-super.c index 55e2cc43..73b73e32 100644 --- a/test/src/test-super.c +++ b/test/src/test-super.c @@ -580,6 +580,20 @@ static int test_cal_date() { return 0; } +static int test_cirs_app_ra() { + double cio_dra, ra0; + + if(!is_ok("cirs_app_ra:cio_ra", cio_ra(tdb, NOVAS_FULL_ACCURACY, &cio_dra))) return 1; + + for (ra0 = -12.0; ra0 < 36.0; ra0 += 2.0) { + double ra1 = cirs_to_app_ra(tdb, NOVAS_FULL_ACCURACY, ra0); + if (!is_ok("cirs_app_ra:cirs_to_app", fabs(ra1 - ra0 - cio_dra) < 1e-12)) return 1; + ra1 = app_to_cirs_ra(tdb, NOVAS_FULL_ACCURACY, ra1); + if (!is_ok("cirs_app_ra:app_to_cirs", fabs(ra1 - ra0) < 1e-12)) return 1; + } + return 0; +} + static int test_dates() { double offsets[] = {-10000.0, 0.0, 10000.0, 10000.0, 10000.01 }; int i, n = 0; @@ -588,6 +602,7 @@ static int test_dates() { if(test_get_utc_to_tt()) n++; if(test_nutation_lp_provider()) n++; if(test_cal_date()) n++; + if(test_cirs_app_ra()) n++; for(i = 0; i < 5; i++) { tdb = J2000 + offsets[i];