Converting days since 0-01-01 to Julian/Gregorian days - how can IDL recognise 0 AD? [message #89398] |
Tue, 07 October 2014 06:21  |
Jasdeep Anand
Messages: 16 Registered: August 2011
|
Junior Member |
|
|
I have data which has been given timestamps with the units: "days since 0-01-01 00:00", which I'm assuming means since January 1st, 0 AD. I'd like to convert this into a format I can actually use, preferably Julian days so IDL can recognise the date format when plotting.
From what I understand I can't use any of the default IDL programs for this task (JULDAY, GREG2JUL, etc) because of the fact that the year 0 AD doesn't exist (IDL's calendar instead goes straight from -1 to 1 to conserve leap years).
What should I do? I'm unsure of the timestamps used to calculate the data (all I have is the year and month) and I'll be comparing this with data from a separate dataset which does not have this problem. I don't think I can use -1 or 1 in this case as the year because the final Julian day will be wrong. Has anyone encountered this problem at all?
Thanks,
J. Anand
|
|
|
|
Re: Converting days since 0-01-01 to Julian/Gregorian days - how can IDL recognise 0 AD? [message #89445 is a reply to message #89398] |
Fri, 17 October 2014 03:39  |
Valeri Golev
Messages: 1 Registered: October 2014
|
Junior Member |
|
|
07 октомври 2014, вторник, 16:21:47 UTC+3, Jasdeep Anand написа:
> I have data which has been given timestamps with the units: "days since 0-01-01 00:00", which I'm assuming means since January 1st, 0 AD. I'd like to convert this into a format I can actually use, preferably Julian days so IDL can recognise the date format when plotting.
>
>
>
> From what I understand I can't use any of the default IDL programs for this task (JULDAY, GREG2JUL, etc) because of the fact that the year 0 AD doesn't exist (IDL's calendar instead goes straight from -1 to 1 to conserve leap years).
>
>
>
> What should I do? I'm unsure of the timestamps used to calculate the data (all I have is the year and month) and I'll be comparing this with data from a separate dataset which does not have this problem. I don't think I can use -1 or 1 in this case as the year because the final Julian day will be wrong. Has anyone encountered this problem at all?
>
>
>
> Thanks,
>
>
>
> J. Anand
Please, check
IDL> print, JULDAY(1, 1, 1, 0, 0, 0) ; Jan 01, 1 AD
1721423.5
IDL> print, JULDAY(12, 31, -1, 0, 0, 0); Dec 31, 1 BD
1721422.5
As you can see, the difference is exactly one day. It happens because there the year 0 AD in the calendar does not exists by definition!
Don't worry about .5 fraction, it comes from old astronomical tradition (Julian days start at noon).
Cheers,
Valeri
|
|
|