[AstroPy] AstroPy Digest, Vol 84, Issue 6

Eric Jeschke eric at naoj.org
Tue Sep 10 22:33:25 EDT 2013


As Perry mentioned, Ginga can do that pretty easily, as well has handling
two-way interaction.

Check out this demo using an ipython
notebook<http://nbviewer.ipython.org/6067409>
.

Here's a snippet of code to draw a point on an ra, dec (assuming you have a
viewer 'v1' open as shown in the demo):

# ra/dec in degrees
ra_deg, dec_deg = (299.64881091007464, 22.821619885325994)

# load an image
from ginga.AstroImage import AstroImage
img = AstroImage()
img.load_file("/path/to/your/fits/image.fits")
v1.set_image(img)

# draw a point there
x, y = img.radectopix(ra_deg, dec_deg)
Point = v1.getDrawClass('point')
v1.add(Point(x, y, radius=10, color='yellow'))

This uses astropy under the hood to do the coordinates.

Regards,
~Eric

On Tue, Sep 10, 2013 at 10:12 AM, <astropy-request at scipy.org> wrote:

> Date: Tue, 10 Sep 2013 15:11:56 -0400
> From: Demitri Muna <demitri.muna at gmail.com>
> Subject: [AstroPy] X marks the spot
> To: "astropy at scipy.org" <astropy at scipy.org>
> Message-ID: <3FDAF0B9-E676-48C0-AAD1-929DEAA862B4 at gmail.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi,
>
> What the current state of the art in Python-based FITS viewers?
>
> If I have a FITS file and a coordinate, does anyone have a template piece
> of code that would load the image, display it, and draw an x on the
> coordinate(s) I provide?
>
> Thanks!
> Demitri
>
> _________________________________________
> Demitri Muna
>
> Department of Astronomy
> Ohio State University
>
> http://scicoder.org/
>
> --
Eric Jeschke          |    eric at naoj.org    | ジェスキ,エリク
Software Engineer     |     808-934-5908    | ソフトウェアエンジニア
Subaru Telescope      |                     | すばる望遠鏡
National Astronomical Observatory of Japan

http://naoj.org/staff/eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20130910/6d72b446/attachment.html>


More information about the AstroPy mailing list