[AstroPy] Setting and Rising time in Astropy 1.0

Erik Tollerud erik.tollerud at gmail.com
Tue Mar 24 14:25:33 EDT 2015


While it's not a "one-liner" to do this with Astropy, you can do this in a
straightforward way using the new functionality surrounding AltAz that is
in Astropy v1.0. To see an example of how this works, take a look at
http://docs.astropy.org/en/latest/coordinates/observing-example.html
that example does many other things, but the key piece for this question is
the second-to-last code sample on that page.  You'll note it ends with a
line that sets "m33altazs", which is an array SkyCoord that contains the
AltAz coordinates for M33. To find a pretty good set (or rise) time, you
can just do something like this:
np.interp(0, m33altazs.alt.deg, delta_midnight)
to get the rise time.

This might not give quite the same answer is the Meeus approach because it
at least in principal might include things like light deflection, but also
has interpolation error as I've phrased it here. That's probably not too
critical for most cases, though, because *realistic* rise/set times depend
in detail on atmospheric conditions and the associated refraction.

It would certainly make sense to write a function that will do exactly this
(and transit time too) using the Astropy coordinates API... we welcome pull
requests or issues to this effect! (I think this might be part of one of
the possible Google Summer of Code projects, but none of that is finalized
yet.)


I'm planning to show a more targeted example of just this in an astropy
tutorial I'm working on that showcases some of the new coordinates features.



On Fri, Mar 13, 2015 at 5:08 AM, Akshat Singhal <akshat.singhal014 at gmail.com
> wrote:

> Hi All,
>
> How can one calculate setting and rising time of star ( with given RA-Dec)
> from
>  a location at given time?
> That is from a given location and time of an observer , how to compute when
> will an object (say Sun or star with known coordinates) will rise or set
> at horizon.
>
> Any insight to it will be very helpful.
>
> Thanks and regards,
> Akshat SInghal
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>


-- 
Erik T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150324/5da9d70d/attachment.html>


More information about the AstroPy mailing list