alexrudy / astropyephem

A wrapper for pyephem using Astropy tools
3 stars 0 forks source link

Examples? #1

Open cdeil opened 9 years ago

cdeil commented 9 years ago

Could you add a few examples to the README or to the docs for the main features / classes implemented here? If you don't want to write up stuff by hand, just generating Sphinx API docs and putting them on readthedocs would be great.

I do think this approach is a nice temp solution for missing astropy.coordinates functionality. Even if it becomes superfluous for end users within the next year, it's useful for them now and we can use this for https://github.com/astropy/coordinates-benchmark to check the upcoming Astropy implementation.

alexrudy commented 9 years ago

I'm putting together some examples right now, but the basic idea is that you can use import astropyephem as ephem, then run examples from the PyEphem tutorial such as

>>> u = ephem.Uranus()
>>> u.compute('1781/3/13')
>>> print('%s %s %s' % (u.ra, u.dec, u.mag))

where u.ra and u.dec are astropy Angle objects, and u.mag is a quantity.

I'm adding all of this to the README as we speak, and I'll put together some sphinx documentation too, although as a straight passthrough to ephem, this is not as simple as it might seem (even ephem is mostly written in the python c-api, and so not self-documenting.

cdeil commented 9 years ago

So this is mostly like PyEphem, but using Astropy Angle and SkyCoord as input / output in a few places ... and not a prototype implementation of missing functionality in Astropy using PyEphem in the background?

Thanks! I'll have a look tomorrow ...

Are you using astropy.coordinates.EarthLocation somewhere?

alexrudy commented 9 years ago

@cdeil This is definitely not a prototype implementation, and basically just a wrapper. When I wrote it, satrapy.coordinates.EarthLocation didn't yet exist, so I didn't support it, but it would be easy to add support.

It would also be easy to use this to prototype an Astropy implementation, as it already handles the link to the core PyEphem functions. I just haven't thought enough about the design of such a module to get going with it. I think Eric had some good points on the mailing list.

cdeil commented 9 years ago

OK, I understand ... it's still useful to have for discussing or prototyping API or for testing the upcoming implementation in Astropy.