SuperNOVAS v1.2
The NOVAS C library, made better
|
Functions | |
short | ephem_close (void) |
short | ephem_open (const char *ephem_name, double *jd_begin, double *jd_end, short *de_number) |
int | interpolate (const double *buf, const double *t, long ncf, long na, double *position, double *velocity) |
short | planet_ephemeris (const double tjd[2], enum de_planet target, enum de_planet origin, double *position, double *velocity) |
int | split (double tt, double *fr) |
short | state (const double *jed, enum de_planet target, double *target_pos, double *target_vel) |
Variables | |
double * | BUFFER |
(for internal use) Array containing Chebyshev coefficients of position. | |
double | EM_RATIO |
(for internal use) | |
FILE * | EPHFILE = NULL |
(for internal use) The currently open JPL DE planetary ephemeris file | |
int | IPT [3][12] |
(for internal use) | |
double | JPLAU |
(for internal use) | |
short | KM |
Flag that defines physical units of the output states. | |
int | LPT [3] |
(for internal use) | |
long | NP |
(for internal use) | |
long | NRL |
(for internal use) Current record number buffered | |
long | NV |
(for internal use) | |
double | PC [18] |
(for internal use) | |
long | RECORD_LENGTH |
(for internal use) | |
double | SS [3] |
(for internal use) | |
double | TWOT |
(for internal use) | |
double | VC [18] |
(for internal use) | |
SuperNOVAS planetary ephemeris manager for the planet_eph_manager and planet_eph_manager_hp() functions.
This module exposes a lot of its own internal state variables globally. You probably should not access them from outside this module, but they are kept ad globals to ensure compatibility with existing NOVAS C applications that might access those values.
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
short ephem_close | ( | void | ) |
Closes a JPL planetary ephemeris file and frees the memory.
REFERENCES:
NOTES:
short ephem_open | ( | const char * | ephem_name, |
double * | jd_begin, | ||
double * | jd_end, | ||
short * | de_number | ||
) |
This function opens a JPL planetary ephemeris file and sets initial values. This function must be called prior to calls to the other JPL ephemeris functions.
REFERENCES:
ephem_name | Name/path of the direct-access ephemeris file. | |
[out] | jd_begin | [day] Beginning Julian date of the ephemeris file. It may be NULL if not required. |
[out] | jd_end | [day] Ending Julian date of the ephemeris file. It may be NULL if not required. |
[out] | de_number | DE number of the ephemeris file opened. It may be NULL if not required. |
References BUFFER, EM_RATIO, EPHFILE, IPT, JPLAU, KM, LPT, NP, NRL, NV, PC, RECORD_LENGTH, SS, TWOT, and VC.
int interpolate | ( | const double * | buf, |
const double * | t, | ||
long | ncf, | ||
long | na, | ||
double * | position, | ||
double * | velocity | ||
) |
Differentiates and interpolates a set of Chebyshev coefficients to give position and velocity.
REFERENCES:
buf | Array of Chebyshev coefficients of position. | |
t | t[0] is fractional time interval covered by coefficients at which interpolation is desired (0 <= t[0] <= 1). t[1] is length of whole interval in input time units. | |
ncf | Number of coefficients per component. | |
na | Number of sets of coefficients in full array (i.e., number of sub-intervals in full interval). | |
[out] | position | Position array of requested object. |
[out] | velocity | Velocity array of requested object. |
short planet_ephemeris | ( | const double | tjd[2], |
enum de_planet | target, | ||
enum de_planet | origin, | ||
double * | position, | ||
double * | velocity | ||
) |
Retries planet position and velocity data from the JPL planetary ephemeris
(If nutations are desired, set 'target' = 13; 'center' will be ignored on that call.)
REFERENCES:
tjd | [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 in the TDB or "T_eph" time scale. | |
target | The integer code (see above) for the planet for which coordinates are requested, e.g. DE_JUPITER. | |
origin | The integer code of the planet or position relative to which coordinates are measured. | |
[out] | position | [AU] Position vector array of target relative to center, measured in AU. |
[out] | velocity | [AU/day] Velocity vector array of target relative to center, measured in AU/day. |
int split | ( | double | tt, |
double * | fr | ||
) |
reaks up a double number into a double integer part and a fractional part.
tt | Input number. | |
[out] | fr | 2-element output array; fr[0] contains integer part, fr[1] contains fractional part. For negative input numbers, fr[0] contains the next more negative integer; fr[1] contains a positive fraction. |
short state | ( | const double * | jed, |
enum de_planet | target, | ||
double * | target_pos, | ||
double * | target_vel | ||
) |
Reads and interpolates the JPL planetary ephemeris file.
For ease in programming, the user may put the entire epoch in jed[0] and set jed[1] = 0. For maximum interpolation accuracy, set jed[0] = the most recent midnight at or before interpolation epoch, and set jed[1] = fractional part of a day elapsed between jed[0] and epoch. As an alternative, it may prove convenient to set jed[0] = some fixed epoch, such as start of the integration and jed[1] = elapsed interval between then and epoch.
REFERENCES:
jed | [day] 2-element Julian date (TDB) at which interpolation is wanted. Any combination of jed[0]+jed[1] which falls within the time span on the file is a permissible epoch. See Note 1 below. target (short) | |
target | The integer code (see above) for the planet for which coordinates are requested, e.g. DE_JUPITER. | |
[out] | target_pos | [AU] The barycentric position vector array of the requested object, in AU. |
[out] | target_vel | [AU/day] The barycentric velocity vector array of the requested object, in AU/Day. |
References BUFFER, ephem_close(), EPHFILE, interpolate(), IPT, JPLAU, KM, NRL, RECORD_LENGTH, split(), and SS.
short KM |
Flag that defines physical units of the output states.
Flag that defines physical units of the output states. 1: km and km/sec; 0: AU and AU/day. Its default value is 0 (KM determines time unit for nutations. Angle unit is always radians.)