Functions
light_t.c File Reference

Correct for light-travel time. More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "aephem.h"

Functions

void ae_light_t_orbit (double jd_tt, double o[], const struct ae_orbit_t *orb, double q[])
 Get the apparent position of an object, corrected for light-travel time. More...
 
int ae_light_t_jpl (struct ae_jpl_handle_t *jh, double jd_tt, double o[], int obj_num, double q[], double v_q[], char is_planetary)
 Get the apparent position of an object, corrected for light-travel time. More...
 
double ae_light_t (double p[], double q[], int do_retardation)
 Get light-travel time between two objects. More...
 

Detailed Description

Correct for light-travel time.

Function Documentation

double ae_light_t ( double  p[],
double  q[],
int  do_retardation 
)

Get light-travel time between two objects.

Given the position of two objects in heliocentric equatorial rectangular coordinates, returns the light-travel time between them. To correct for light-travel time, this should be done iteratively a couple of times. The routines ae_light_t_jpl() and ae_light_t_orbit() do this automatically.

This routine can approximate the effect due to the sun's gravitational retardation (AA, p. 36). However, it is usually a small effect. It will blow up if one of the objects is the sun.

Parameters
pThe first object, in heliocentric rectangular coordinates, in AU.
qThe second object, in heliocentric rectangular coordinates, in AU.
do_retardationIf 0, neglect gravitational retardation from the sun; otherwise, compute gravitational retardation from the sun.
Returns
The light-travel time, in days.

References AE_CLIGHT_AUD.

Referenced by ae_light_t_jpl(), ae_light_t_orbit(), and aes_subobs_point().

int ae_light_t_jpl ( struct ae_jpl_handle_t jh,
double  jd_tt,
double  o[],
int  obj_num,
double  q[],
double  v_q[],
char  is_planetary 
)

Get the apparent position of an object, corrected for light-travel time.

The routine does three iterations of light-time correction. Gravitational retardation from the sun is neglected. (However, it can be added if necessary by using ae_light_t() directly.)

This function uses JPL ephemerides. For orbital elements, use ae_light_t_orbit().

Parameters
jhA handle initialised by ae_jpl_init().
jd_ttThe Julian date in TT.
oThe heliocentric rectangular position of the earth, in AU.
obj_numThe object for which to get coordinates. If a planetary ephemeris file is being used, one can use the predefined ae_ss_bodies_t constants for clarity.
qFor returning the heliocentric rectangular position of the object in AU.
v_qFor returning the velocity of the object in AU. Set to NULL if you do not require the velocity.
is_planetaryIf 0, assume these are not planetary ephemerides and barycentric coordinates are returned. Otherwise, it will be assumed that a Solar System ephemeris file is being used and that the object numbers are as in ae_ss_bodies_t; heliocentric coordinates will be returned.
Returns
0 on success; on failure, a negative error code from ae_retcode_t.

References ae_jpl_get_coords(), and ae_light_t().

Referenced by ae_geocentric_from_jpl().

void ae_light_t_orbit ( double  jd_tt,
double  o[],
const struct ae_orbit_t orb,
double  q[] 
)

Get the apparent position of an object, corrected for light-travel time.

The routine does three iterations of light-time correction. Gravitational retardation from the sun is neglected. (However, it can be added if necessary by using ae_light_t() directly.)

This routine uses orbital elements. For JPL ephemerides, use ae_light_t_jpl().

Parameters
jd_ttThe Julian date in TT.
oThe heliocentric rectangular position of the observer, in AU.
orbThe orbital elements of the object.
qFor returning the heliocentric rectangular position of the object in AU.

References ae_kepler(), and ae_light_t().

Referenced by ae_geocentric_from_orbit().