astropy/astropy — pull request #55 by wkerzendorf (2011-11-07 21:07:04+00:00)
Title: AstroTime implementation first draft

Hello Guys,

With all the suggestions onboard I have started to do the astrotime implementation.
So here's what works:

from astropy import astrotime
import datetime
mytime = astrotime.AstroTime.from_date_gregorian(datetime.datetime(2005, 25, 8, 12, 0, 0))
mytime.to_jd()
some number comes out.

I have looked at SOFA and other Astronomical Almanac and used their algorithm - to make sure they are right.
I have also added tests to the astrotime directory and they check out with pytest.

There's also somethings awry with the documentation, but that's because I'm new to sphinx.

Ah very important: I've thought about what Tom A. and I think Prasanth mentioned: Speed. Yes I completely agree that our current implementation of an object is not optimized for speed and thought about other implementations. I think a solution for this problem is to say: Please use np.float64 MJD as a standard if you need the speed and use this function to convert when speed and memory footprint is not crucial!. I think we should put this in the documentation.

What do you guys think?

Cheers
Wolfgang

P.S.: I have also given you my whole astropy, because I don't know how to mark specific files for pull-requests.
Please advise!