SuperNOVAS v1.5
The NOVAS C library, made better
Loading...
Searching...
No Matches
solsys2.c File Reference

Functions

void jplihp_ (const double *jd_tdb, long *targ, long *cent, double *posvel, long *err_flg)
 Function prototype for the FORTRAN subroutine jplihp() e.g. in jplint.f
 
void jplint_ (const double *jd_tdb, long *targ, long *cent, double *posvel, long *err_flg)
 Function prototype for the FORTRAN subroutine jplint() e.g. in jplint.f
 
short planet_jplint (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *restrict position, double *restrict velocity)
 
short planet_jplint_hp (const double jd_tdb[restrict 2], enum novas_planet body, enum novas_origin origin, double *restrict position, double *restrict velocity)
 
short solarsystem (double jd_tdb, short body, short origin, double *restrict position, double *restrict velocity)
 
short solarsystem_hp (const double jd_tdb[restrict 2], short body, short origin, double *restrict position, double *restrict velocity)
 

Detailed Description

Author
G. Kaplan and A. Kovacs
Deprecated
This old NOVAS-C interface to the Fortran PLEPH library is incomplete at best. Unless you have already written functional adapters for this interface, you are better off choosing one of the more fully-baked ways of providing ephemeris support, such as via the CALCEPH or CSPICE plugin interfaces. See solsys-calceph.c, solsys-cspice.c

SuperNOVAS major planet ephemeris lookup wrapper for JPL ephemerides accessed over pleph(). It is a top-level wrapper, with an intermediate Fortran routine, jplint_() providing the interface between the NOVAS planet calculator functions here and the pleph() call of the JPL library. (The sample source code of jplint.f is included in the distribution).

For supporting JPL ephemerides more generally, including for satellites, asteroids, and comets, you are probably better off implementing a novas_ephem_provider and set it as the default ephemeris handler via set_ephem_provider(), and then use solsys-ephem.c instead to use the same implementation for major planets. Or, simply use the provided plugin support for the CALCEPH or CSPICE libtaries.

Based on the NOVAS C Edition, Version 3.1:

U. S. Naval Observatory
Astronomical Applications Dept.
Washington, DC
http://www.usno.navy.mil/USNO/astronomical-applications

See also
solsys-calceph.c, solsys-cspice.c, solarsystem.h

Function Documentation

◆ planet_jplint()

short planet_jplint ( double jd_tdb,
enum novas_planet body,
enum novas_origin origin,
double *restrict position,
double *restrict velocity )
Deprecated
This NOVAS C function is not usable without a user-provided custom Fortran adapter to the PLEPH library. SuperNOVAS offers many better ways of providing ephemeris support. See e.g., set_planet_provider(), or novas_use_calceph() / novas_use_cspice().

Obtains planet positions via the JPL direct-access solar system ephemerides, wtih normal (reduced) precision – typically good to the milliarcsecond level.

It generalizes access to the JPL software by calling a Fortran interface subroutine, 'jplint', instead of making a direct call to the JPL subroutine 'pleph', whose arguments have changed several times throughout the years. This way, any future change to the arguments can be accommodated in 'jplint' rather than in this function.

For supporting JPL ephemerides more generally, including for satellites, asteroids, and comets, you are probably better off using planet_ephem_provider(), and provide an interface, e.g. to the CSPICE library, via novas_ephem_provider instead, which you can then activate dynamically with set_planet_provider().

REFERENCES:

  1. JPL. 2007, JPL Planetary and Lunar Ephemerides: Export Information, (Pasadena, CA: JPL) http://ssd.jpl.nasa.gov/?planet_eph_export.
  2. Kaplan, G. H. "NOVAS: Naval Observatory Vector Astrometry Subroutines"; USNO internal document dated 20 Oct 1988; revised 15 Mar 1990.
Parameters
jd_tdb[day] Two-element array containing the Julian date, which may be split any way (although the first element is usually the "integer" part, and the second element is the "fractional" part). Julian date is on the TDB or "T_eph" time scale.
bodyMajor planet number (or that for Sun, Moon, SSB..)
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1), or 2 for Earth geocenter – relative to which to report positions and velocities.
[out]position[AU] Position vector of 'body' at jd_tdb; equatorial rectangular coordinates in AU referred to the ICRS.
[out]velocity[AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular system referred to the ICRS, in AU/day.
Returns
0 if successful, or else 1 if the 'body' or 'origin' argument is invalid, or else 2 if the 'jplint_()' call failed.
See also
planet_jplint_hp(), planet_ephem_provider(), set_planet_provider()
solarsystem()
Since
1.0

References jplint_(), NOVAS_BARYCENTER, NOVAS_HELIOCENTER, NOVAS_MERCURY, NOVAS_MOON, and NOVAS_SUN.

◆ planet_jplint_hp()

short planet_jplint_hp ( const double jd_tdb[restrict 2],
enum novas_planet body,
enum novas_origin origin,
double *restrict position,
double *restrict velocity )
Deprecated
This NOVAS C function is not usable without a user-provided custom Fortran adapter to the PLEPH library. SuperNOVAS offers many better ways of providing ephemeris support. sSee e.g., set_planet_provider(), or novas_use_calceph() / novas_use_cspice().

Obtains planet positions via the JPL direct-access solar system ephemerides, wtih high precision – typically good to below the microarcsecond level.

It generalizes access to the JPL software by calling a Fortran interface subroutine, 'jplint', instead of making a direct call to the JPL subroutine 'pleph', whose arguments have changed several times throughout the years. This way, any future change to the arguments can be accommodated in 'jplint' rather than in this function.

For supporting JPL ephemerides more generally, including for satellites, asteroids, and comets, you are probably better off using planet_ephem_provider(), and provide an interface, e.g. to the CSPICE library, via novas_ephem_provider instead, which you can then activate dynamically with set_planet_provider().

REFERENCES:

  1. JPL. 2007, JPL Planetary and Lunar Ephemerides: Export Information, (Pasadena, CA: JPL) http://ssd.jpl.nasa.gov/?planet_eph_export.
  2. Kaplan, G. H. "NOVAS: Naval Observatory Vector Astrometry Subroutines"; USNO internal document dated 20 Oct 1988; revised 15 Mar 1990.
Parameters
jd_tdb[day] Two-element array containing the Julian date, which may be split any way (although the first element is usually the "integer" part, and the second element is the "fractional" part). Julian date is on the TDB or "T_eph" time scale.
bodyMajor planet number (or that for Sun, Moon, SSB...)
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1), or 2 for Earth geocenter – relative to which to report positions and velocities.
[out]position[AU] Position vector of 'body' at jd_tdb; equatorial rectangular coordinates in AU referred to the ICRS.
[out]velocity[AU/day] Velocity vector of 'body' at jd_tdb; equatorial rectangular system referred to the ICRS, in AU/day.
Returns
0 if successful, or else an error code of solarsystem().
See also
planet_jplint(), planet_ephem_provider_hp(), set_planet_provider_hp()
solarsystem_hp()
Since
1.0

References jplihp_(), NOVAS_BARYCENTER, NOVAS_HELIOCENTER, NOVAS_MERCURY, NOVAS_MOON, and NOVAS_SUN.

◆ solarsystem()

short solarsystem ( double jd_tdb,
short body,
short origin,
double *restrict position,
double *restrict velocity )
Deprecated
(legacy function) Use set_planet_provider() instead to specify what function should be used to calculate ephemeris positions for major planets. This function is provided to extend support for legacy NOVAS C applications only. In NOVAS, the function had to be user defined, either by linking against a solsys*.c module, or by providing a custom user implementation. Use set_planet_provider() instead, or else novas_use_calceph() or novas_use_cspice().

A default implementation for regular (reduced) precision handling of major planets, Sun, Moon and the Solar-system barycenter. See DEFAULT_SOLSYS in Makefile to choose the implementation that is built into with the library as a default. Applications can define their own preferred implementations at runtime via set_planet_provider().

Since this is a function that may be provided by existing custom user implementations, we keep the original argument types for compatibility, hence 'short' instead of the more informative enums).

Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date
bodyMajor planet number (or that for the Sun, Moon, or an appropriate barycenter), as defined by enum novas_planet, e.g. NOVAS_MARS (4), NOVAS_SUN (10) or NOVAS_SSB (0). (For compatibility with existing NOVAS C compatible user implementations, we keep the original NOVAS C argument type here).
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1) relative to which to return positions and velocities. (For compatibility with existing NOVAS C compatible user implementations, we keep the original NOVAS C argument type here).
[out]position[AU] Position vector of 'body' at 'tjd'; equatorial rectangular coordinates in AU referred to the mean equator and equinox of J2000.0.
[out]velocity[AU/day] Velocity vector of 'body' at 'tjd'; equatorial rectangular system referred to the mean equator and equinox of J2000.0, in AU/Day.
Returns
0 if successful, -1 if there is a required function is not provided (errno set to ENOSYS), 1 if the input Julian date ('tjd') is out of range, 2 if 'body' is invalid, or 3 if the ephemeris data cannot be produced for other reasons.
See also
novas_planet, solarsystem_hp(), set_planet_provider(), ephemeris()
novas_sky_pos(), novas_geom_posvel()

References planet_jplint().

◆ solarsystem_hp()

short solarsystem_hp ( const double jd_tdb[restrict 2],
short body,
short origin,
double *restrict position,
double *restrict velocity )
Deprecated
(legacy function) Use set_planet_provider_hp() instead to specify what function should be used to calculate high-precision ephemeris positions for major planets. This function is provided to extend support for legacy NOVAS C applications only. In NOVAS, the function had to be user defined, either by linking against a solsys*.c module, or by providing a custom user implementation. Use set_planet_provider_hp() instead, or else novas_use_calceph() or novas_use_cspice().

A default implementation for high precision handling of major planets, Sun, Moon and the Solar-system barycenter (and other barycenters). See DEFAULT_SOLSYS in Makefile to choose the implementation that is built into the library as a default. Applications can define their own preferred implementations at runtime via set_planet_provider_hp().

Since this is a function that may be provided by existing custom user implementations, we keep the original argument types for compatibility, hence 'short' instead of the more informative enums).

Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date, broken into high and low order components, respectively. Typically, as the integer and fractional parts for the highest precision.
bodyMajor planet number (or that for the Sun, Moon, or an appropriate barycenter), as defined by enum novas_planet, e.g. NOVAS_MARS (4), NOVAS_SUN (10) or NOVAS_SSB (0). (For compatibility with existing NOVAS C compatible user implementations, we keep the original NOVAS C argument type here).
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1) relative to which to return positions and velocities. (For compatibility with existing NOVAS C compatible user implementations, we keep the original NOVAS C argument type here).
[out]position[AU] Position vector of 'body' at 'tjd'; equatorial rectangular coordinates in AU referred to the mean equator and equinox of J2000.0.
[out]velocity[AU/day] Velocity vector of 'body' at 'tjd'; equatorial rectangular system referred to the mean equator and equinox of J2000.0, in AU/Day.
Returns
0 if successful, -1 if there is a required function is not provided (errno set to ENOSYS), or some other error code (NOVAS C was not very consistent here...
See also
solarsystem(), set_planet_provider_hp(), ephemeris()
novas_sky_pos(), novas_geom_posvel(), grav_planets(), grav_undo_planets()

References planet_jplint_hp().