[AstroPy] Using astropy.time for 'deep time'?

wbpython wbpython at gmail.com
Wed Apr 23 19:34:56 EDT 2014


Some of the confusion is clearly between my keyboard and chair ;^)

I'm trying to switch to the astropy module, away from some of my own module which I've been using for about 10 years but which does not support some of the other time-systems.

I think the one that threw me the most was

>>> jdorigin = time.Time(0.0,0.0,format='jd')
which returns an error
ERROR: ScaleValueError: No scale value supplied but it is required for class TimeJD [astropy.time.core]

But which scale value, as I don't think any of the ones listed were technically defined at JD=0?
It seems to work for any of the defined systems.
>>> jdorigin = time.Time(0.0,0.0,format='jd',scale='utc')
>>> jdorigin.isot

Once I understood this, things became a little clearer.
It appears I can do *really* old dates by defining everything in Julian Days

>>> earthbirth = time.Time(-4.5e9*365,0.0,format='jd',scale='tai') 
but some things aren't supported:
>>> earthbirth.iso
ERROR: ValueError: eraD2dtf: unacceptable date [unknown]

It's a little kludgy for deep time use, but I do need something reliable with 128-bit precision.  I could probably write a wrapper that gives more convenient I/O options, unless there is an existing better option.

Thanks for your attention,
Tom


More information about the AstroPy mailing list