AstrometryMeasuring the positions and motions of celestial objects
FITS images taken with a modern telescopes usually come with WCS in them. However, for older telescopes and cameras, such as the CTIO 1.3m, do not take images with WCS in the FITS file. This presents certain problems when conducting research, especially in transient objects, since we are unable to pinpoint which dot in the image is the object we’re trying to study. Thankfully, the great people at http://astrometry.net/ has come up with an “astrometry engine” to process WCS-less images and return them with WCS.
Technically, you can upload your images in one-by-one or by bulk in a tarball at http://nova.astrometry.net/upload. This should work for many images without any problem. For the CTIO 1.3m ANDICAM images, however, there are some conflicting elements in the FITS header that prevents the astrometry engine from working properly. For us, we going to delete those conflicting stuff in the header and then astrometer the images through Python.
Get your API key
Download the astrometry.net executable Python file
As the code goes through a pretty long for-loop, it’ll be easier and more organised for us to run the Python code directly through Terminal instead. We begin by downloading the source code for the online upload by astrometry.net here (click on “raw” and right click to download as “client.py” in your astronomy folder).
Save the header fix script
After which, we’re going to run the following Python script to (1) delete certain header elements and (2) astrometer the images through nova.astrometry.net. Take note of the part of the code where it defines the input folder (glob.glob), output folder, and the part where you have to put in your own API key. Save the file as whatever you want in where your client.py file is.
Running the script through Python 2
The code from astrometry.net requires you to run Python in Python 2 environment. You won’t be able to run the code in Python 3 as there are libraries that the script requires but don’t exist in Python 3 (notably urllib2). There are ways around this, but we can make things easier and install Python 2 via conda and run the script in Python 2 instead.
Create a Python 2.7 environment by going to Terminal with the command:
Once the installation is complete, you can activate the environment with the command:
Next, just run the script on Terminal and you should be receiving all your images with WCS shortly.