![]() |
SuperNOVAS v1.0
The NOVAS C library, made better
|
SuperNOVAS is a C/C++ astronomy software library, providing high-precision astrometry such as one might need for running an observatory or a precise planetarium program. It is a fork of the Naval Observatory Vector Astrometry Software (NOVAS) C version 3.1, providing bug fixes and making it easier to use overall.
SuperNOVAS is entirely free to use without licensing restrictions. Its source code is compatible with the C90 standard, and hence should be suitable for old and new platforms alike. It is light-weight and easy to use, with full support for the IAU 2000/2006 standards for sub-microarcsecond position calculations.
SuperNOVAS is a fork of the The Naval Observatory Vector Astrometry Software (NOVAS).
The primary goal of SuperNOVAS is to improve on the stock NOVAS C library via:
At the same time, SuperNOVAS aims to be fully backward compatible with the intended functionality of the upstream NOVAS C library, such that it can be used as a drop-in, build-time replacement for NOVAS in your application without having to change existing (functional) code you may have written for NOVAS C.
SuperNOVAS is currently based on NOVAS C version 3.1. We plan to rebase SuperNOVAS to the latest upstream release of the NOVAS C library, if new releases become available.
SuperNOVAS is maintained by Attila Kovacs at the Center for Astrophysics | Harvard & Smithsonian, and it is available through the Smithsonian/SuperNOVAS repository on GitHub.
Outside contributions are very welcome. See how you can contribute to make SuperNOVAS even better.
Here are some links to other SuperNOVAS related content online:
The SuperNOVAS library fixes a number of outstanding issues with NOVAS C 3.1. Here is a list of issues and fixes provided by SuperNOVAS over the upstream NOVAS C 3.1 code:
sidereal_time()
function had an incorrect unit cast. This was a documented issue of NOVAS C 3.1.fmod()
unchecked, which led to the wrong results when the numerator was negative. This affected the calculation of the mean anomaly in solsys3.c
(line 261) and the fundamental arguments calculated 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.ephemeris()
. When getting positions and velocities for Solar-system sources, it is important to use the values from the time light originated from the observed body rather than at the time that light arrives to the observer. This correction was done properly for positions, but not for velocities or distances, resulting in incorrect observed radial velocities or apparent distances being reported for spectroscopic observations or for angular-physical size conversions.ira_equinox()
which may return the result for the wrong type of equinox (mean vs. true) if the 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()
.cio_basis()
, cio_location()
, ecl2equ()
, equ2ecl_vec()
, ecl2equ_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.cio_basis()
with alternating CIO location reference systems. This affected many CIRS-based position calculations downstream.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 in GCRS coordinates instead of the requested mean equinox of date coordinates.aberration()
returning NaN vectors if the ve
argument is 0. It now returns the unmodified input vector appropriately instead.az
output value in equ2hor()
at zenith. While any azimuth is acceptable really, it results in unpredictable behavior. Hence, we set az
to 0.0 for zenith to be consistent.ephem_close()
in eph_manager.c
did not reset the EPHFILE
pointer to NULL. This was a documented issue of NOVAS C 3.1.SuperNOVAS strives to maintain API compatibility with the upstream NOVAS C 3.1 library, but not binary compatibility.
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 NOVAS C 3.1. We also changed the object
structure to contain a long
ID number instead of short
to accommodate JPL NAIF codes, for which 16-bit storage is insufficient.
The SuperNOVAS distribution contains a GNU Makefile
, which is suitable for compiling the library (as well as local documentation, and tests, etc.) on POSIX systems such as Linux, BSD, MacOS X, or Cygwin or WSL. (At this point we do not provide a similar native build setup for Windows, but speak up if you would like to add it yourself!)
Before compiling the library take a look a config.mk
and edit it as necessary for your needs, such as:
earth_sun_calc()
set BUILTIN_SOLSYS3 = 1
and/or for planet_ephem_provider()
set BUILTIN_SOLSYS_EPHEM = 1
. You can then specify these functions as the default planet calculator for ephemeris()
in your application dynamically via set_planet_provider()
.solarsystem()
implementation for ephemeris()
calls by setting DEFAULT_SOLSYS
to 1 – 3 for solsys1.c
trough solsys3.c
, respectively. If you want to link your own solarsystem()
implementation(s) against the library, you should not set DEFAULT_SOLSYS
(i.e. delete or comment out the corresponding line or else set DEFAULT_SOLSYS
to 0).readeph()
implementation for it by setting DEFAULT_READEPH
appropriately. (The default setting uses the dummy readeph0.c
which simply returns an error if one tries to use the functions from solsys1.c
). Note, that a readeph()
implementation is not always necessary and you can provide a superior ephemeris reader implementation at runtime via the set_ephem_provider()
call.cio_location()
, you can specify the path to the binary file (e.g. /usr/local/share/novas/cio_ra.bin
) on your system. (The CIO locator file is not at all necessary for the functioning of the library, unless you specifically require CIO positions relative to GCRS.)-DTHREAD_LOCAL=...
added to CFLAGS
. (Don't forget to enclose the string value in escaped quotes.)Now you are ready to build the library:
will compile the static (lib/novas.a
) and shared (lib/novas.so
) libraries, produce a CIO locator data file (tools/data/cio_ra.bin
), and compile the API documentation (into apidoc/
) using doxygen
. Alternatively, you can build select components of the above with the make
targets static
, shared
, cio_file
, and dox
respectively.
After building the library you can install the above components to the desired locations on your system. For a system-wide install you may place the static or shared library into /usr/loval/lib/
, copy the CIO locator file to the place you specified in config.mk
etc. You may also want to copy the header files in include/
to e.g. /usr/local/include
so you can compile your application against SuperNOVAS easily on your system.
Provided you have installed the SuperNOVAS headers into a standard location (such as /usr/include
or /usr/local/include
) and the static or shared library into usr/lib
(or /usr/local/lib
or similar), you can build your application against it very easily. For example, to build myastroapp.c
against SuperNOVAS, you might have a Makefile
with contents like:
If you have a legacy NOVAS C 3.1 application, it is possible that the compilation will give you errors due to missing includes for stdio.h
, stdlib.h
, ctype.h
or string.h
. This is because these were explicitly included in novas.h
in NOVAS C 3.1, but not in SuperNOVAS (at least not by default), as a matter of best practice. If this is a problem for you can 'fix' it in one of two ways: (1) Add the missing #include
directives to your application source explicitly, or if that's not an option for you, then (2) set the -DCOMPAT=1
compiler flag when compiling your application:
To use your own solarsystem()
implemetation for ephemeris()
, you will want to build the library with DEFAULT_SOLSYS
not set (or else set to 0) in config.mk
(see section above), and your applications Makefile
may contain something like:
The same principle applies to using your specific readeph()
implementation (only with DEFAULT_READEPH
being unset in config.mk
).
The IAU 2000 and 2006 resolutions have completely overhauled the system of astronomical coordinate transformations to enable higher precision astrometry. (Super)NOVAS supports coordinate calculations both in the old (pre IAU 2000) ways, and in the new IAU standard method. Here is an overview of how the old and new methods define some of the terms differently:
Concept | Old standard | New IAU standard |
---|---|---|
Catalog coordinate system | FK4, FK5, HIP... | International Celestial Reference System (ICRS) |
Dynamical system | True of Date (TOD) | Celestial Intermediate Reference System (CIRS) |
Dynamical R.A. origin | equinox of date | Celestial Intermediate Origin (CIO) |
Precession, nutation, bias | separate, no tidal terms | IAU 2006 precession/nutation model |
Celestial Pole offsets | dψ, dε | dx, dy |
Earth rotation measure | Greenwich Sidereal Time (GST) | Earth Rotation Angle (ERA) |
Fixed Earth System | WGS84 | International Terrestrial Reference System (ITRS) |
See the various enums and constants defined in novas.h
, as well as the descriptions on the various NOVAS routines on how they are appropriate for the old and new methodologies respectively.
In NOVAS, the barycentric BCRS and the geocentric GCRS systems are effectively synonymous to ICRS. The origin for positions and for velocities, in any reference system, is determined by the observer
location in the vicinity of Earth (at the geocenter, on the surface, or in Earth orbit).
A sidereal source may be anything beyond the solar-system with 'fixed' catalog coordinates. It may be a star, or a galactic molecular cloud, or a distant quasar. First, you must provide the coordinates (which may include proper motion and parallax). Let's assume we pick a star for which we have B1950 (i.e. FK4) coordinates:
We must convert these coordinates to the now standard ICRS system for calculations in SuperNOVAS, first by calculating equivalent J2000 coordinates, by applying the proper motion and the appropriate precession. Then, we apply a small adjustment to convert from J2000 to ICRS coordinates.
(Naturally, you can skip the transformation steps above if you have defined your source in ICRS coordinates from the start.)
Next, we define the location where we observe from. Here we can (but don't have to) specify local weather parameters (temperature and pressure) also for refraction correction later (in this example, we'll skip the weather):
We also need to set the time of observation. Our clocks usually measure UTC, but for astrometry we usually need time measured based on Terrestrial Time (TT) or Barycentric Time (TDB) or UT1. For a ground-based observer, you will often have to provide NOVAS with the TT - UT1 time difference, which can be calculated from the current leap seconds and the UT1 - UTC time difference (a.k.a. DUT1):
Next, you may want to set the small diurnal (sub-arcsec level) corrections to Earth orientation, which are published in the IERS Bulletins. The obvious utility of these values comes later, when converting positions from the celestial CIRS frame to the Earth-fixed ITRS frame. Less obviously, however, it is also needed for calculating the CIO location for CIRS coordinates when a CIO locator file is not available, or for calculations sidereal time measures etc. Therefore, it's best to set the pole offsets early on:
Now we can calculate the precise apparent position (CIRS or TOD) of the source, such as it's right ascension (R.A.) and declination, and the equatorial x,y,z unit vector pointing in the direction of the source (in the requested coordinate system and for the specified observing location). We also get radial velocity (for spectroscopy), and distance (e.g. for apparent-to-physical size conversion):
The placement of the celestial target in the observer's frame includes appropriate aberration corrections for the observer's motion, as well as appropriate gravitational deflection corrections due to the Sun and Earth, and for other major gravitating solar system bodies (in full precision mode and if a suitable planet provider function is available).
The calculated sky_pos
structure contains all the information needed about the apparent position of the source at the given date/time of observation. We may use it to get true apparent R.A. and declination from it, or to calculate azimuth and elevation at the observing location. We'll consider these two cases separately below.
If you want to know the apparent R.A. and declination coordinates from the sky_pos
structure you obtained, then you can follow with:
Alternatively, you can simply call radec_star()
instead of place_star()
to get apparent R.A. and declination in a single step if you do not need the sky_pos
data otherwise. If you followed the less-precise old methodology (Lieske et. al. 1977) thus far, calculating TOD coordinates, you are done here.
If, however, you calculated the position in CIRS with the more precise IAU 2006 methodology (as we did in the example above), you have one more step to go still. The CIRS equator is the true equator of date, however its origin (CIO) is not the true equinox of date. Thus, we must correct for the difference of the origins to get the true apparent R.A.:
If your goal is to calculate the astrometric azimuth and zenith distance (= 90° - elevation) angles of the source at the specified observing location (without refraction correction), you can proceed from the sky_pos
data you obtained from place_star()
as:
Above we used cirs_to_itrs()
function, and then converted the sky_pos
rectangular equatorial unit vector calculated in CIRS to the Earth-fixed International Terrestrial Reference system (ITRS) using the small (arcsec-level) measured variation of the pole (dx, dy) provided explicitly since cirs_to_itrs()
does not use the values previously set via cel_pole()
. Finally, itrs_to_hor()
converts the ITRS coordinates to the horizontal system at the observer location.
If you followed the old (Lieske et al. 1977) method instead to calculate sky_pos
in the less precise TOD coordinate system, then you'd simply replace the cirs_to_itrs()
call above with tod_to_itrs()
accordingly.
You can additionally apply an approximate optical refraction correction for the astrometric (unrefracted) zenith angle, if you want, e.g.:
Solar-system sources work similarly to the above with a few important differences.
First, You will have to provide one or more functions to obtain the barycentric ICRS positions for your Solar-system source(s) of interest for the specific Barycentric Dynamical Time (TDB) of observation. See section on integrating External Solar-system ephemeris data or services with SuperNOVAS. You can specify the functions that will handle the respective ephemeris data at runtime before making the NOVAS calls that need them, e.g.:
You can use tt2tdb()
to convert Terrestrial Time (TT) to Barycentric Dynamic Time (TDB) for your ephemeris provider functions (they only differ when you really need extreme precision – for most applications you can used TT and TDB interchangeably in the present era):
Instead of make_cat_entry()
you define your source as an object
with an name or ID number that is used by the ephemeris service you provided. For major planets you might want to use make_planet()
, if they use a novas_planet_provider
function to access ephemeris data with their NOVAS IDs, or else make_ephem_object()
for more generic ephemeris handling via a user-provided novas_ephem_provider
. E.g.:
Other than that, it's the same spiel as before, except using the appropriate place()
for generic celestial targets instead of place_star()
for the sidereal sources (or else radec_planet()
instead of radec_star()
). E.g.:
When one does not need positions at the microarcsecond level, some shortcuts can be made to the recipe above:
NOVAS_REDUCED_ACCURACY
instead of NOVAS_FULL_ACCURACY
for the calculations. This typically has an effect at the milliarcsecond level only, but may be much faster to calculate.Some of the calculations involved can be expensive from a computational perspective. For the most typical use case however, NOVAS (and SuperNOVAS) has a trick up its sleeve: it caches the last result of intensive calculations so they may be re-used if the call is made with the same environmental parameters again (such as JD time and accuracy). Therefore, when calculating positions for a large number of sources at different times:
NOVAS_FULL_ACCURACY
or NOVAS_REDUCED_ACCURACY
) to prevent re-calculating the same quantities repeatedly to alternating precision.NOVAS_REDUCED_ACCURACY
mode offers much faster calculations, in general.A direct consequence of the caching of results in NOVAS is that calculations are generally not thread-safe as implemented by the original NOVAS C 3.1 library. One thread may be in the process of returning cached values for one set of input parameters while, at the same time, another thread is saving cached values for a different set of parameters. Thus, when running calculations in more than one thread, the results returned may at times be incorrect, or more precisely they may not correspond to the requested input parameters.
While you should never call NOVAS C from multiple threads simultaneously, SuperNOVAS caches the results in thread local variables (provided your compiler supports it), and is therefore safe to use in multi-threaded applications. Just make sure that you:
config.mk
or in your equivalent build setup.The SuperNOVAS library is in principle capable of calculating positions to sub-microarcsecond, and velocities to mm/s precision for all types of celestial sources. However, there are certain prerequisites and practical considerations before that level of accuracy is reached.
cel_pole()
and get_ut1_to_tt()
functions to apply / use the published values from these to improve the astrometric precision of Earth-orientation based coordinate calculations. Without setting and using the actual polar offset values for the time of observation, positions for Earth-based observations will be accurate at the tenths of arcsecond level only.earth_sun_calc()
in solsys3.c
), but certainly not at the sub-microarcsecond level, and not for other solar-system sources. You will need to provide a way to interface SuperNOVAS with a suitable ephemeris source (such as the CSPICE toolkit from JPL) if you want to use it to obtain precise positions for Solar-system bodies. See the section further below for more information how you can do that.on_surface
data structure that specifies the observer locations. Note, that refraction at radio wavelengths is notably different from the included optical model. In any case you may want to skip the refraction corrections offered in this library, and instead implement your own as appropriate (or not at all)._Thread_local
or else the earlier GNU C >= 3.3 standard __thread
modifier. You can also set the preferred thread-local keyword for your compiler by passing it via -DTHREAD_LOCAL=...
in config.mk
to ensure that your build is thread-safe. And, if your compiler has no support whatsoever for thread_local variables, then SuperNOVAS will not be thread-safe, just as NOVAS C isn't.novas_debug(NOVAS_DEBUG_ON)
or novas_debug(NOVAS_DEBUG_EXTRA)
to enable. When enabled, any error condition (such as NULL pointer arguments, or invalid input values etc.) will be reported to the standard error, complete with call tracing within the SuperNOVAS library, s.t. users can have a better idea of what exactly did not go to plan (and where). The debug messages can be disabled by passing NOVAS_DEBUF_OFF
(0) as the argument to the same call. Here is an example error trace when your application calls grav_def()
with NOVAS_FULL_ACCURACY
while solsys3
provides Earth and Sun positions only and when debug mode is NOVAS_DEBUG_EXTRA
(otherwise we'll ignore that we skipped the almost always negligible deflection due to planets): ephemeris()
can be set at runtime via set_planet_provider()
, and set_planet_provider_hp()
(for high precision calculations). Similarly, if planet_ephem_provider()
or planet_ephem_provider_hp()
(defined in solsys-ephem.c
) are set as the planet calculator functions, then set_ephem_provider()
can set the user-specified function to use with these to actually read ephemeris data (e.g. from a JPL .bsp
file).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.nu2000k()
can be replaced by another suitable IAU 2006 nutation approximation via set_nutation_lp_provider()
. For example, the user may want to use the iau2000b()
model or some custom algorithm instead.gcrs_to_cirs()
, cirs_to_itrs()
, and itrs_to_cirs()
, cirs_to_gcrs()
.gcrs_to_j2000()
, j2000_to_tod()
, tod_to_itrs()
, and itrs_to_tod()
, tod_to_j2000()
, j2000_to_gcrs()
.itrs_to_hor()
and hor_to_itrs()
to convert Earth-fixed ITRS coordinates to astrometric azimuth and elevation or back. Whereas tod_to_itrs()
followed by itrs_to_hor()
is effectively a just a more explicit 2-step version of the existing equ2hor()
for converting from TOD to to local horizontal (old methodology), the cirs_to_itrs()
followed by itrs_to_hor()
does the same from CIRS (new IAU standard methodology), and had no prior equivalent in NOVAS C 3.1.ecl2equ()
for converting ecliptic coordinates to equatorial, complementing existing equ2ecl()
.gal2equ()
for converting galactic coordinates to ICRS equatorial, complementing existing equ2gal()
.refract_astro()
complements the existing refract()
but takes an unrefracted (astrometric) zenith angle as its argument.place()
for simpler specific use: place_star()
, place_icrs()
, place_gcrs()
, place_cirs()
, and place_tod()
.radec_star()
and radec_planet()
as the common point for existing functions such as astro_star()
, local_star()
, virtual_planet()
, topo_planet()
etc.tt2tdb()
, get_utc_to_tt()
, and get_ut1_to_tt()
make it simpler to convert between UTC, UT1, TT, and TDB time scales, and to supply ut1_to_tt
arguments to place()
or topocentric calculations.solarsystem()
variants. It is possible to use the different solarsystem()
implementations provided by solsys1.c
, solsys2.c
, solsys3.c
and/or solsys-ephem.c
side-by-side, as they define their functionalities with distinct, non-conflicting names, e.g. earth_sun_calc()
vs planet_jplint()
vs planet_eph_manager
vs planet_ephem_provider()
. See the section on Building and installation further above on including a selection of these in your library build.)novas_case_sensitive(int)
to enable (or disable) case-sensitive processing of object names. (By default NOVAS object
names are converted to upper-case, making them effectively case-insensitive.)make_planet()
and make_ephem_object()
to make it simpler to configure Solar-system objects.enum
s as their option arguments instead of raw integers. These enums are defined in novas.h
. The same header also defines a number of useful constants. The enums allow for some compiler checking, and make for more readable code that is easier to debug. They also make it easy to see what choices are available for each function argument, without having to consult the documentation each and every time.errno
set, usually to EINVAL
) if the arguments supplied are invalid (unless the NOVAS C API already defined a different return value for specific cases. If so, the NOVAS C error code is returned for compatibility).errno
so that users can track the source of the error in the standard C way and use functions such as perror()
and strerror()
to print human-readable error messages.const
whenever the function does not modify the data content being pointed at. This supports better programming practices that generally aim to avoid unintended data modifications.NULL
arguments, both for optional input values as well as outputs that are not required (see the API Documentation for specifics). This eliminates the need to declare dummy variables in your application code.NAN
so that even if the caller forgets to check the error code, it becomes obvious that the values returned should not be used as if they were valid. (No more sneaky silent failures.)frame_tie(pos, J2000_TO_ICRS, pos)
using the same pos
vector both as the input and the output. In this case the pos
vector is modified in place by the call. This can greatly simplify usage, and eliminate extraneous declarations, when intermediates are not required.struct
layouts the same as NOVAS C thanks to alignment, thus allowing cross-compatible binary exchange of cat_entry
records with NOVAS C 3.1.make_object()
to retain the specified number argument (which can be different from the starnumber
value in the supplied cat_entry
structure).cio_location()
will always return a valid value as long as neither output pointer argument is NULL. (NOVAS C 3.1 would return an error if a CIO locator file was previously opened but cannot provide the data for whatever reason).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.cio_array()
, including I/O error checking.fund_args()
, instead of the linear model in NOVAS C 3.1.If you want to use SuperNOVAS to calculate positions for a range of Solar-system objects, and/or to do it with sufficient precision, you will have to integrate it with a suitable provider of ephemeris data, such as JPL Horizons or the Minor Planet Center. Given the NOVAS C heritage, and some added SuperNOVAS flexibility in this area, you have several options on doing that. These are listed from the most flexible (and preferred) to the least flexible (old ways).
Possibly the most universal way to integrate ephemeris data with SuperNOVAS is to write your own novas_ephem_provider
, e.g.:
which takes an object ID number (such as a NAIF) an object name, and a split TDB date (for precision) as it inputs, and returns the type of origin with corresponding ICRS position and velocity vectors in the supplied pointer locations. The function can use either the ID number or the name to identify the object or file (whatever is the most appropriate for the implementation). The positions and velocities may be returned either relative to the SSB or relative to the heliocenter, and accordingly, your function should set the value pointed at by origin to NOVAS_BARYCENTER
or NOVAS_HELIOCENTER
accordingly. Positions and velocities are rectangular ICRS x,y,z vectors in units of AU and AU/day respectively.
This way you can easily integrate current ephemeris data for JPL Horizons, e.g. using the CSPICE toolkit, or for the Minor Planet Center (MPC), or whatever other ephemeris service you prefer.
Once you have your adapter function, you can set it as your ephemeris service via set_ephem_provider()
:
By default, your custom my_ephem_reader
function will be used for 'minor planets' only (i.e. anything other than the major planets, the Sun, Moon, and the Solar System Barycenter). And, you can use the same function for the mentioned 'major planets' also via:
provided you compiled SuperNOVAS with BUILTIN_SOLSYS_EPHEM = 1
(in config.mk
), or else you link your code against solsys-ephem.c
explicitly. Easy-peasy.
If you only need support for major planets, you may be able to use one of the modules included in the SuperNOVAS distribution. The modules solsys1.c
and solsys2.c
provide built-in support to older JPL ephemerides (DE200 to DE421), either via the eph_manager
interface of solsys1.c
or via the FORTRAN pleph
interface with solsys2.c
.
eph_manager
To use the eph_manager
interface for planet 1997 JPL planet ephemeris (DE200 through DE421), you must either build superNOVAS with BUILTIN_SOLSYS1 = 1
in config.mk
, or else link your application with solsys1.c
and eph_manager.c
from SuperNOVAS explicitly. If you want eph_manager
to be your default ephemeris provider (the old way) you might also want to set DEFAULT_SOLSYS = 1
in config.mk
. Otherwise, your application should set eph_manager
as your planetary ephemeris provider at runtime via:
Either way, before you can use the ephemeris, you must also open the relevant ephemeris data file with ephem_open()
:
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.
pleph
FORTRAN interfaceTo use the FORTRAN pleph
interface for planet ephemerides, you must either build SuperNOVAS with BUILTIN_SOLSYS2 = 1
in config.mk
, or else link your application with solsys2.c
and jplint.f
from SuperNOVAS explicitly (as well as pleph.f
etc. from the JPL library). If you want the JPL pleph
-based interface to be your default ephemeris provider (the old way) you might also want to set DEFAULT_SOLSYS = 2
in config.mk
. Otherwise, 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.
Finally, if none of the above is appealing, and you are fond of the old ways, you may compile SuperNOVAS with the DEFAULT_SOLSYS
option disabled (commented, removed, or else set to 0), and then link your own implementation of solarsystem()
and solarsystem_hp()
calls with your application.
For Solar-system objects other than the major planets, you may also provide your own readeph()
implementation. (In this case you will want to set DEFAULT_READEPH
in config.mk
to specify your source code for that function before building the SuperNOVAS library, or else disable that option entirely (e.g. by commenting or removing it), and link your application explicitly with your readeph()
implementation.
The downside of this approach is that your SuperNOVAS library will not be usable without invariably providing a solarsystem()
/ solarsystem_hp()
and/or readeph()
implementations for every application that you will want to use SuperNOVAS with. This is why the runtime configuration of the ephemeris provider functions is the best and most generic way to add your preferred implementations while also providing some minimum default implementations for other users of the library, who may not need your ephemeris service, or have no need for planet data beyond the approximate positions for the Earth and Sun.
A predictable release schedule and process can help manage expectations and reduce stress on adopters and developers alike.
Releases of the library shall follow a quarterly release schedule. You may expect upcoming releases to be published around March 1, June 1, September 1, and/or December 1 each year, on an as-needed basis. That means that if there are outstanding bugs, or new pull requests (PRs), you may expect a release that addresses these in the upcoming quarter. The dates are placeholders only, with no guarantee that a new release will actually be available every quarter. If nothing of note comes up, a potential release date may pass without a release being published.
Feature releases (e.g. 1.x.0 version bumps) are provided at least 6 months apart, to reduce stress on adopters who may need/want to tweak their code to integrate these. Between feature releases, bug fix releases (without significant API changes) may be provided as needed to address issues. New features are generally reserved for the feature releases, although they may also be rolled out in bug-fix releases as long as they do not affect the existing API – in line with the desire to keep bug-fix releases fully backwards compatible with their parent versions.
In the weeks and month(s) preceding releases one or more release candidates (e.g. 1.0.1-rc3
) will be published temporarily on github, under Releases, so that changes can be tested by adopters before the releases are finalized. Please use due diligence to test such release candidates with your code when they become available to avoid unexpected surprises when the finalized release is published. Release candidates are typically available for one week only before they are superseded either by another, or by the finalized release.