comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Converting days since 0-01-01 to Julian/Gregorian days - how can IDL recognise 0 AD?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Converting days since 0-01-01 to Julian/Gregorian days - how can IDL recognise 0 AD? [message #89398] Tue, 07 October 2014 06:21 Go to next message
Jasdeep Anand is currently offline  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 #89401 is a reply to message #89398] Tue, 07 October 2014 10:29 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 10/7/14, 7:21 AM, Jasdeep Anand wrote:
> 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
>

This is what CF conventions say about "year 0":


http://cfconventions.org/Data/cf-conventions/cf-conventions- 1.7/build/ch07s04.html

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
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 Go to previous message
Valeri Golev is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Read ASCII time format question!!
Next Topic: non-rectangular array subset

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:34:21 PDT 2025

Total time taken to generate the page: 0.00501 seconds