[AstroPy] Converting ndarrays of year, month, days to JD?

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Fri Feb 20 07:16:12 EST 2015


On Fri, Feb 20, 2015 at 6:44 AM, Aldcroft, Thomas <
aldcroft at head.cfa.harvard.edu> wrote:

> Hi Mario,
>
> Your best bet (right now) is probably to use the ERFA library directly.
> This is bundled in astropy.time.  You can get an example of this here:
>
>   https://github.com/astropy/astropy/blob/v1.0/astropy/time/core.py#L1427
>
> Note that this example uses the name erfa_time.dtf_jd as an alias to the
> actual routine name dtf2d.  See [1] for some words about the aliasing,
> but the short version is you should probably use dtf2d to be safe.
>
> An even better option would be to implement this as a new astropy Time
> format.  I've opened an issue to provide some detail:
>
>   https://github.com/astropy/astropy/issues/3527
>

Just another note that you can implement this format class locally (within
your codebase) and it gets automatically registered as a Time Format on
import.  In this way you can put in a patch to astropy but also use the new
format in your code (with astropy 1.0) before the next astropy release.


>
>
> Cheers,
> Tom
>
> On Thu, Feb 19, 2015 at 5:56 PM, Mario Juric <mjuric at lsst.org> wrote:
>
>> Hi everyone,
>>         Is there an efficient way to go from three ndarrays of year,
>> month, day
>> values to julian date? I.e., an equivalent of:
>>
>>         jd  = ymd_to_jd(yy, mm, dd)
>>
>> , where all variables are (potentially large) ndarrays?
>>
>> Cheers,
>> --
>> Mario Juric,
>> UW Astronomy Faculty | UW eScience | LSST DM Project Scientist
>> Web : http://research.majuric.org      Phone : +1 609 933 1033
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150220/2ae75195/attachment.html>


More information about the AstroPy mailing list