Sky plot images

195 views
Skip to first unread message

Pierre-Alain Dumas

unread,
Jun 10, 2014, 9:03:48 AM6/10/14
to
Hi,

I'm an amateur astronomer working on a personal software project to assist me in my observation nights. I just discovered astronomy.net and I find it very interesting. 

I noticed that on nova.astronomy.net, on a result page, there are 3 or more small images that show the constellations and stars around the solved position at different zoom levels. I find these images very useful to get an idea of where the camera is pointing without loading the coordinates in a stellarium software. Can these images be generated from the command-line version of astrometry? If not, is the tool that generates them available in any way?

Thanks,

Pierre-Alain

Dustin Lang

unread,
Jun 10, 2014, 9:42:02 AM6/10/14
to astro...@googlegroups.com
Hi,

All the code for the nova.astrometry.net site is publicly available -- http://trac.astrometry.net/browser/trunk/src/astrometry/net/ -- though hardly documented at all :)

The code that produces those plots is in views/image.py , function onthesky_image, which calls views/onthesky.py functions plot_aitoff_wcs_outline() and plot_wcs_outline().  It should be straightforward for a python coder to script up the views/onthesky.py functions -- eg, it could be as simple as:

[run solve-field as usual...]

python -c "from astrometry.net.views.onthesky import *; plot_aitoff_wcs_outline('my.wcs', 'my.png')"

One catch is that you have to "make py" when you build the Astrometry.net code, so that the "plotstuff" module gets built.

Sorry for the sketchy instructions, but please feel free to give it a shot and let us know how it goes.  I'd be happy to help further.

cheers,
--dustin

Pierre-Alain Dumas

unread,
Jun 10, 2014, 9:59:51 AM6/10/14
to astro...@googlegroups.com
Thanks for the quick reply. I'll give that a try.

Pierre-Alain

Pierre-Alain Dumas

unread,
Jun 12, 2014, 8:36:10 AM6/12/14
to astro...@googlegroups.com
A little followup on my attempt to generate the sky images. After fiddling around with the imports and hard-coding some values in onthesky.pl (mostly some constants from the settings package which doesn't seem to exist), I managed to go past the import errors with this script that I put in astrometry.util:

<begin script>
#! /usr/bin/env python

import os
import sys

# from util/addpath.py
if __name__ == '__main__':
    mydir = sys.path[0]
    andir = os.path.dirname(mydir)
    rootdir = os.path.dirname(andir)
    sys.path.insert(1, rootdir)


from astrometry.net.views.onthesky import *; 

plot_aitoff_wcs_outline('/home/pi/solve1/IMG_6491.wcs', '/home/pi/solve1/my.png')
<end script>

When I run it, I get the following error:

pi@raspberrypi /usr/local/astrometry/lib/python/astrometry/util $ ./generate_skyplot.py 
anwcs.c:919:anwcs_wcslib_from_string: Wcslib support was not compiled in
anwcs.c:1562:anwcs_create_hammer_aitoff: Failed to convert parse Hammer-Aitoff header string with wcslib
Segmentation fault

Any idea of what maybe missing? I am no Python expert by the way.

Thanks,

Pierre-Alain

Dustin Lang

unread,
Jun 12, 2014, 10:29:05 AM6/12/14
to astro...@googlegroups.com

For the Hammer-Aitoff projection (full-sky) we use WCSlib to do the WCS transformations, so wcslib support has to be compiled in to the astrometry.net code.  Get wcslib from
  http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/intro.html

Note that the non-Hammer-Aitoff projections don't require WCSlib.

cheers,
--dustin

Pierre-Alain Dumas

unread,
Jun 17, 2014, 1:16:28 PM6/17/14
to astro...@googlegroups.com
Thanks Dustin, by installing WCSlib I can now generate most of the images. At higher zoom levels however, it seems I need some extra catalogs? For example this call:

plot_wcs_outline(WCS_FILE, SOLVE_FOLDER+'zoom3.png',width=0.36, grid=0.1, zoom=False, hd=True, hd_labels=True, tycho2=True)

fails with the following:

Traceback (most recent call last):
  File "./generate_skyplot.py", line 34, in <module>
    hd=True, hd_labels=True, tycho2=True)
  File "/usr/local/astrometry/lib/python/astrometry/net/views/onthesky.py", line 80, in plot_wcs_outline
    kd = tree_open(TYCHO2_KD)
  File "/usr/local/astrometry/lib/python/astrometry/libkd/spherematch.py", line 349, in tree_open
    return spherematch_c.kdtree_open(fn, treename)
TypeError: must be string, not None

Originally, there was an error about a missing hd.fits that I fixed by downloading the file from trac.astrometry.net. Now, I suspect this error is because the tycho2 catalog is not there. I looked for the file tycho2.kd once again in trac.astronomy.net but couldn't find it. Is that file generated by some tools?

Dustin Lang

unread,
Jun 17, 2014, 4:31:07 PM6/17/14
to astro...@googlegroups.com
I just put a link to it at:

http://data.astrometry.net/tycho2.kd

cheers,
--dustin
Reply all
Reply to author
Forward
0 new messages