SuperNOVAS v1.0
The NOVAS C library, made better
Loading...
Searching...
No Matches
solarsystem.h File Reference

Typedefs

typedef int(* novas_ephem_provider) (const char *name, long id, double jd_tdb_high, double jd_tdb_low, enum novas_origin *origin, double *pos, double *vel)
 
typedef short(* novas_planet_provider) (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
typedef short(* novas_planet_provider_hp) (const double jd_tdb[2], enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 

Functions

short earth_sun_calc (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short earth_sun_calc_hp (const double jd_tdb[2], enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
void enable_earth_sun_hp (int value)
 
novas_ephem_provider get_ephem_provider ()
 
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 planet_ephem_provider (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short planet_ephem_provider_hp (const double jd_tdb[2], enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short planet_jplint (double jd_tdb, enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
short planet_jplint_hp (const double jd_tdb[2], enum novas_planet body, enum novas_origin origin, double *position, double *velocity)
 
double * readeph (int mp, const char *name, double jd_tdb, int *error)
 
int set_ephem_provider (novas_ephem_provider func)
 
int set_planet_provider (novas_planet_provider func)
 
int set_planet_provider_hp (novas_planet_provider_hp func)
 
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 header for custom solar-system ephemeris calculations for major planets plus the Sun, Moon, and the Solar-system barycenter. The source files solsys1.c, solsys2.c, solsys3.c and solsys-ephem.c provide various standard implementations that users may use (some require additional sources, or user-specific implementations), or you can write your own version if that seems more appropriate.

If the standard implementations are compiled with the DEFAULT_SOLSYS option set (see Makefile), then the library is compiled with that version providing a built-in default implementation (the default is to use solsys3, which is a self-contained orbital calculation).

Additionally, users may set their custom choice of major planet ephemeris handler at runtime via the set_ephem_size().

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

Typedef Documentation

◆ novas_ephem_provider

typedef int(* novas_ephem_provider) (const char *name, long id, double jd_tdb_high, double jd_tdb_low, enum novas_origin *origin, double *pos, double *vel)

Function to obtain ephemeris data for minor planets, which are not handled by the solarsystem() type calls. The library does not provide a default implementation, but users can provide their own, either as a default statically compiled readeph() implementation, or else a dynamically defined one via ephemeris_set_reader().

Parameters
idThe ID number of the solar-system body for which the position in desired.
nameThe name of the solar-system body
jd_tdb_high[day] The high-order part of Barycentric Dynamical Time (TDB) based Julian date for which to find the position and velocity. Typically this may be the integer part of the Julian date for high-precision calculations, or else the entire Julian date for reduced precision.
jd_tdb_low[day] The low-order part of Barycentric Dynamical Time (TDB) based Julian date for which to find the position and velocity. Typically this may be the fractional part of the Julian date for high-precision calculations, or else 0.0 if the date is defined entirely by the high-order component for reduced precision.
[out]originSet to NOVAS_BARYCENTER or NOVAS_HELIOCENTER to indicate relative to which the ephemeris positions/velocities are reported.
[out]pos[AU] position 3-vector to populate with rectangular equatorial coordinates in AU. It may be NULL if position is not required.
[out]vel[AU/day] velocity 3-vector to populate in rectangular equatorial coordinates in AU/day. It may be NULL if velocities are not required.
Returns
0 if successful, -1 if any of the pointer arguments are NULL, or some non-zero value if the was an error s.t. the position and velocity vector should not be used.
See also
set_ephem_provider()
ephemeris()
NOVAS_EPHEM_OBJECT
Since
1.0
Author
Attila Kovacs

◆ novas_planet_provider

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

Provides the position and velocity of major planets (as well as the Sun, Moon, and Solar-system Barycenter position. This version provides positions and velocities at regular precision (see NOVAS_REDUCED_PRECISION).

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).
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
set_planet_provider()
ephemeris()
novas_solarsystem_hp_func

◆ novas_planet_provider_hp

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

Provides the position and velocity of major planets (as well as the Sun, Moon, and Solar-system Barycenter position. This version provides positions and velocities at high precision (see NOVAS_FULL_PRECISION).

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).
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
set_planet_provider_hp()
novas_solarsystem_func
ephemeris()

Function Documentation

◆ earth_sun_calc()

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

Provides the position and velocity of the Earth and Sun only at epoch 'jd_tdb' by evaluating a closed-form theory without reference to an external file. This function can also provide the position and velocity of the Sun.

REFERENCES:

  1. Kaplan, G. H. "NOVAS: Naval Observatory Vector Astrometry Subroutines"; USNO internal document dated 20 Oct 1988; revised 15 Mar 1990.
  2. Explanatory Supplement to The Astronomical Almanac (1992).
Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date
bodyNOVAS_EARTH (3) or NOVAS_SUN (10) only.
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 if one of the output pointer arguments is NULL (errno set to EINVAL). 1 if the input Julian date ('tjd') is out of range, 2 if 'body' is invalid.
See also
earth_sun_calc_hp()
set_planet_provider()
solarsystem()
novas_planet_provider

References NOVAS_BARYCENTER, NOVAS_EARTH, NOVAS_PLANETS, NOVAS_SSB, NOVAS_SUN, precession(), radec2vector(), sun_eph(), T0, and TWOPI.

◆ earth_sun_calc_hp()

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

It may provide the position and velocity of the Earth and Sun, the same as solarsystem_earth_sun(), if enable_earth_sun_hp() is set to true (non-zero). Otherwise, it will return with an error code of 3, indicating that high-precision calculations are not provided by this implementation.

NOTES:

  1. This implementation will always propulate the output position and velocity vectors with the low-precision result, regardless of the return error code, in order to reduce the chance of unpredictable behavior, even if the user does not check the returned error status (which of course they should).
Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date
bodyNOVAS_EARTH (3) or NOVAS_SUN (10) only.
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 if one of the output pointer arguments is NULL (errno set to EINVAL). 1 if the input Julian date ('tjd') is out of range, 2 if 'body' is invalid, or 3 if the high-precision orbital data cannot be produced (default return value).
See also
enable_earth_sun_hp()
earth_sun_calc()
set_planet_provider()
solarsystem_hp()
novas_planet_provider_hp

References earth_sun_calc().

◆ enable_earth_sun_hp()

void enable_earth_sun_hp ( int value)

Specify whether the high-precision call is allowed to return a low-precision result. If set to 0 (false) solarsystem_earth_sun_hp() will return with an error code 3 indicating that a high-precision calculation is not possible. Otherise, a non-zero value (true) will let the function to be used without errors, returning the low-precison result of solarsystem_earth_sun() instead.

Parameters
value(boolean) A non-zero value enables the error-free use of the earth_sun_calc_hp() by allowing to return the low-precision result. Otherwise, earth_sun_calc_hp() will return an error code 3 indicating that the high-precision result is not available (this latter is the default behavior).
See also
earth_sun_calc_hp()

◆ get_ephem_provider()

novas_ephem_provider get_ephem_provider ( )

Returns the user-defined ephemeris accessor function.

Returns
the currently defined function for accessing ephemeris data for minor planets or satellites, ot NULL if no function was set via set_ephem_provider() previously.
See also
set_ephem_provider()
ephemeris()
Since
1.0
Author
Attila Kovacs

◆ 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_ephemeris() 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_ephemeris() 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().

◆ planet_ephem_provider()

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

Major planet ephemeris data via the same generic ephemeris provider that is configured by set_ephem_provider() prior to calling this routine. This is the regular (reduced) precision version.

Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date.
bodyMajor planet number (or that for Sun, Moon, or Solar-system barycenter)
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1) 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_ephem_provider_hp()
set_ephem_provider()
solarsystem()
Since
1.0
Author
Attila Kovacs

References planet_ephem_provider_hp().

◆ planet_ephem_provider_hp()

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

Major planet ephemeris data via the same generic ephemeris provider that is configured by set_ephem_provider() prior to calling this routine. This is the highest precision version.

Parameters
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date, split into high and low order components (e.g. integer and fractional parts) for high-precision calculations.
bodyMajor planet number (or that for Sun, Moon, or Solar-system barycenter)
originNOVAS_BARYCENTER (0) or NOVAS_HELIOCENTER (1) 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_hp().
See also
planet_ephem_provider()
set_ephem_provider()
solarsystem_hp()
Since
1.0
Author
Attila Kovacs

References get_ephem_provider(), NOVAS_BARYCENTER, NOVAS_HELIOCENTER, NOVAS_PLANET_NAMES_INIT, NOVAS_PLANETS, NOVAS_SSB, and NOVAS_SUN.

◆ planet_jplint()

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

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, 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' 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[2],
enum novas_planet body,
enum novas_origin origin,
double * position,
double * velocity )

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, 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_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.

◆ readeph()

double * readeph ( int mp,
const char * name,
double jd_tdb,
int * error )

Provides a default ephemeris implementation to handle position and velocity calculations for minor planets, which are not handled by the solarsystem() type calls. The library does not provide a default implementation, but users can provide their own, either as a default statically compiled readeph() implementation, or else a dynamically defined one via ephemeris_set_reader().

You can set the built-in implementation for the library by setting the DEFAULT_READEPH variable in the Makefile.

Deprecated
This old ephemeris reader is prone to memory leaks, and lacks some useful functionality. Users are strongly encouraged to use the new novas_ephem_provider instead, which can provide dynamically configured implementations at runtime.
Parameters
mpThe ID number of the solar-system body for which the position are desired.
nameThe name of the solar-system body (usually upper-case)
jd_tdb[day] Barycentric Dynamical Time (TDB) based Julian date for which to find the position and velocity.
[out]errorPointer to integer to populate with the error status: 0 if successful, -1 if any of the pointer arguments are NULL, or some non-zero value if the was an error s.t. the position and velocity vector should not be used.
Returns
[AU, AU/day] A newly allocated 6-vector in rectangular equatorial coordinates, containing the heliocentric position coordinates in AU, followed by hte heliocentric velocity components in AU/day. The caller is responsible for calling free() on the returned value when it is no longer needed.
See also
novas_ephem_provider
ephemeris()
NOVAS_EPHEM_OBJECT
Since
1.0
Author
Attila Kovacs

◆ set_ephem_provider()

int set_ephem_provider ( novas_ephem_provider func)

Sets the function to use for obtaining position / velocity information for minor planets, or sattelites.

Parameters
funcnew function to use for accessing ephemeris data for minor planets or satellites.
Returns
0 if successful, or else -1 if the function argument is NULL.
Since
1.0
Author
Attila Kovacs
See also
get_ephem_provider()
ephemeris()

◆ set_planet_provider()

int set_planet_provider ( novas_planet_provider func)

Set a custom function to use for regular precision (see NOVAS_REDUCED_ACCURACY) ephemeris calculations instead of the default solarsystem() routine.

Parameters
funcThe function to use for solar system position/velocity calculations. See solarsystem() for further details on what is required of this function.
Author
Attila Kovacs
Since
1.0
See also
set_planet_provider_hp()
solarsystem()
NOVAS_REDUCED_ACCURACY

◆ set_planet_provider_hp()

int set_planet_provider_hp ( novas_planet_provider_hp func)

Set a custom function to use for high precision (see NOVAS_FULL_ACCURACY) ephemeris calculations instead of the default solarsystem_hp() routine.

Parameters
funcThe function to use for solar system position/velocity calculations. See solarsystem_hp() for further details on what is required of this function.
Author
Attila Kovacs
Since
1.0
See also
set_planet_provider()
solarsystem_hp()
NOVAS_FULL_ACCURACY

◆ 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 earth_sun_calc(), planet_eph_manager(), planet_ephem_provider(), and planet_jplint().

◆ 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 earth_sun_calc_hp(), planet_eph_manager_hp(), planet_ephem_provider_hp(), and planet_jplint_hp().