Skip to content

Instantly share code, notes, and snippets.

View amasolini's full-sized avatar

Alejandro Masolini amasolini

View GitHub Profile
@hannorein
hannorein / gist:5638999
Last active March 26, 2017 06:51
The functions parameters are: gjd - geocentric JD based on UTC ra - right ascension (J2000) de - declination The function returns heliocentric correction helcor. Using helcor, you can computed Heliocentric JD from Geocentric JD. The relation is: HJD = GJD + helcor. We do not compute Barycentric JD (BJD).
function computeHELCOR($gjd, $ra, $de) {
// $eps=23.45*Pi()/180;
$ra = EREgI_Replace(" ", "", $ra);
$de = EREgI_Replace(" ", "", $de);
$ra_hh = IntVal(substr($ra, 0, 2));
$ra_mm = IntVal(substr($ra, 2, 2));
$ra_vv = DoubleVal(substr($ra, 4, 4));
$de_dd = IntVal(substr($de, 0, 3));
$de_mm = IntVal(substr($de, 3, 2));