Skip to main content

jd algorithm

pox's picture
pox
Offline
Joined: 2010-08-12

Hi all,

I have written an app that submits observations to webobs in the AAVSO visual format. Part of this app of course converts the calendar date to JD, and on several occasions error messages have been raised when attempting to upload a file. I thought that this was because of some inconsistency in the format, but it turns out that the algorithm I have been using (downloaded from the web) doesn't always return the correct JD!

Does anyone know of a reliable JD algorithm, preferably (though not necessarily) in Visual Basic?

You may contact me on mike@starman.co.uk if you want

Michael Poxon, Norwich, UK

My JD Converter for Excel
PKV's picture
PKV
Offline
Joined: 2010-07-26

Mike,

Here is my JD Excel spreadsheet that I use in my archiving activity.

Kevin Paxson - PKV

JD algorithm
roe's picture
roe
Offline
Joined: 2010-07-25

The autoritative source for all things calculated in astronony is Jean Meeus' Astronomical Algorithms.  From pages 60-61.

"Let Y be the year, M the month number  and D the day of the month (with decimals, if any) of the calendar date.

If M>2, leave Y and M unchanged

If M=1 or M=2, replace Y by Y-1 and M by M+12  (In other words January and February are thought to be the 13th and 14th month of the previous year).

In the Gregorian calendar take

A= INT(Y/100) and B = 2-A+INT(A/4) where INT() implies the integer part of a number (NOT the rounded value).

JD = INT(365.25(Y+4716)) + INT(30.6001(M+1)) + D +B - 1524.5"

Note:  this is for Gregorian calendar dates only (Not Julian Calendar).  See Meeus for more details.

Agreed. Meeus is the place to
David Benn's picture
David Benn
Online
Joined: 2010-07-29

Agreed. Meeus is the place to look. VStar implements the method in Meeus.

Here is Java source and unit test code.

Feel free to ask questions.

Regards,

David

AAVSO 49 Bay State Rd. Cambridge, MA 02138 aavso@aavso.org 617-354-0484