CalcHJD


The CalcHJD function calculates the Heliocentric Julian Date using the date and time plus the right ascension and declination of the object. The date and time may be expressed as two strings for date and time or as a merged ISO 8601 date/time string. The Heliocentric Julian Date is refeferenced to the Sun's location, hence is independent of Earth's motion and the object coordinates. Use CalcJC to calculate the "normal", or Geocentric Julian Date.

Syntax

nJD = CalcHJD( sDate, sTime, sRA, sDec )

nJD = CalcHJD( sDateTime, sRA, sDec )

bullet.gif    sDate, sTime are the UT date and time strings to convert to Julian Date.

bullet.gif    sDateTime is the standard (ISO 8601) merged UT date/time string separated with the letter T, like '2024-12-23T04:17:49'.

bullet.gif    sRA and sDec are the right ascension and declination of the object.

bullet.gif    nJD is the Julian Date (e.g., 2441552.645325).

Remarks

The following inverse operations convert a Julian Date number to its number and string components:

bullet.gif    Use ParseJD to split the Julian Date number into 3 numbers for the date and 3 numbers for the time.

bullet.gif    Use JDtoDateTime to split the Julian Date number into two strings for date and time.

bullet.gif    To calculate the "normal", or geocentric Julian Date, use CalcJD.

Example

The following script converts UT date and time, right ascension, and declination to Heliocentric Julian Date:

sDate = "1999 6 17"

-- 17 June 1999 UT

sTime = "1 1 59"

-- 01:01:59.0 UT

sRA = "18 42 43.42"

-- RA: 18h 42m 43.42s

sDec = "63 35 6.1"

-- Dec: 63 degrees 35' 06.1"

nHJD = CalcHJD( sDate, sTime, sRA, sDec )

-- calculate the HJD

Printf("HJD = %14.5lf\r\n", nHJD )

-- Result: JD = 2451346.54326

The following script calculates the Heliocentric Julian Date using the ISO 8601 version of date and time:

sDateTime = "1999-06-17T01:01:59"

-- 17 June 1999 at 01:01:59.0 UT

sRA = "18 42 43.42"

-- RA: 18h 42m 43.42s

sDec = "63 35 6.1"

-- Dec: 63 degrees 35' 06.1"

nHJD = CalcHJD( sDateTime, sRA, sDec )

-- calculate the HJD

Printf("HJD = %14.5lf\r\n", nHJD )

-- Result: JD = 2451346.54326

Related Topics

Date and Time Functions

FormatYmdStr

JDtoDateTime

CalcJD

CalcMJD


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.