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

Functions

short planet_eph_manager (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short planet_eph_manager_hp (const double jd_tdb[2], enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short solarsystem (double jd_tdb, short body, short origin, double *position, double *velocity)
 
short solarsystem_hp (const double jd_tdb[2], short body, short origin, double *position, double *velocity)
 

Detailed Description

Author
G. Kaplan and A. Kovacs

SuperNOVAS major planet ephemeris lookup implementation using JPL 1997 ephemeris data, to be used together with eph_manager.c. This is a legacy API, maiunly for supporting older code written for NOVAS C.

A more generic solution is to implement a novas_ephem_provider (e.g. relying on the current version of the CSPICE library) 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.

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
solarsystem.h
solsys-calceph.c
solsys-cspice.c

Function Documentation

◆ planet_eph_manager()

short planet_eph_manager ( double  jd_tdb,
enum novas_planet  body,
enum novas_origin  origin,
double *  position,
double *  velocity 
)

Provides an interface between the JPL direct-access solar system ephemerides and NOVAS-C for regular (reduced) precision applications.

This function and planet_eph_manager_hp() were designed to work with the 1997 version of the JPL ephemerides, as noted in the references.

The user must create the binary ephemeris files using software from JPL, and open the file using function ephem_open(), prior to calling this function.

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, or Solar-system barycenter)
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_eph_manager_hp()
planet_ephem_provider()
ephem_open()
set_planet_provider()
solarsystem()
Since
1.0

References planet_eph_manager_hp().

◆ planet_eph_manager_hp()

short planet_eph_manager_hp ( const double  jd_tdb[2],
enum novas_planet  body,
enum novas_origin  origin,
double *  position,
double *  velocity 
)

Provides an interface between the JPL direct-access solar system ephemerides and NOVAS-C for highest precision applications.

This function and planet_eph_manager() were designed to work with the 1997 version of the JPL ephemerides, as noted in the references.

The user must create the binary ephemeris files using software from JPL, and open the file using function ephem_open(), prior to calling this function.

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, or Solar-system barycenter)
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' is invalid, or 2 if the 'origin' is invalid, or 3 if there was an error providing ephemeris data.
See also
planet_eph_manager
planet_ephem_provider_hp()
ephem_open()
set_planet_provider_hp()
Since
1.0

References NOVAS_BARYCENTER, NOVAS_HELIOCENTER, NOVAS_MOON, NOVAS_PLANETS, NOVAS_SUN, and planet_ephemeris().

◆ solarsystem()

short solarsystem ( double  jd_tdb,
short  body,
short  origin,
double *  position,
double *  velocity 
)

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 Solar-system Barycenter position), 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()
place()
ephemeris()

References planet_eph_manager().

◆ solarsystem_hp()

short solarsystem_hp ( const double  jd_tdb[2],
short  body,
short  origin,
double *  position,
double *  velocity 
)

A default implementation for high 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 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 Solar-system Barycenter position), 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()
place()
ephemeris()

References planet_eph_manager_hp().