Astrometry.net - bradfordbenson/ASTR21200_2025 GitHub Wiki

Input an image of the sky, and astrometry.net will tell you exactly what part of the sky it is showing. If given an input FITS image, it will return a FITS image with the correct astrometric header, so that pixel coordinates are mapped to (R.A., Dec.) coordinates.

Running solve-field

The executable for astrometry.net is called solve-field. Full instructions are available at http://astrometry.net/doc/readme.html. You should first set up your own temporary directory for the temporary files that solve-field will write, e.g. /astrolab//. Its default is to write to /tmp which fills up rather quickly!

To solve the astrometry of a field with approximate knowledge of the center coordinates, run

solve-field --ra [raguess] --dec [decguess] --radius [searchrad] [filename] -m /astrolab/<semester>/<username>

and replacing [raguess] etc. with your estimates of the center position (in decimal degrees). The search radius is specified in degrees.

Looping over many files using bash

Bash makes it easy to execute the same operation on many files. For example, let's assume you have a text file images.dat which lists all the images on which you want to astrometry.net on. The following script will do precisely that:

#! /bin/bash -u`

filename=$1

while read file
do
   solve-field [arguments] ${file}  # complete this line with your call to solve-field
done < ${filename}

Note that this script takes an argument, in this case the name of your input file. I.e. you would call it as

./script.sh images.dat

If the files you want to operate on have a distinctive name, for example image_1.fits, image_2.fits, ... , you can let bash find them for you:

#! /bin/bash -u

for file in $(ls -1 image_*.fits)
do
   solve-field [arguments] ${file}  # complete this line with your call to solve-field
done
⚠️ **GitHub.com Fallback** ⚠️