Building Astrometry.net 0.80 on CentOS 7.8

August, 2020

Assumptions

  1. You have a system running CentOS 7.8 for x86-64.
  2. You'll be doing the build as a non-privileged user.
  3. You have the ability to either become root or run sudo for escalated privileges, to install the software system-wide.
  4. This system has been set up as a Development and Creative Workstation, with the “Additional Development”, “Development Tools”, “Graphics Creation Tools” and “Platform Development” add-ons groups installed. You may not need all of this, but this is what I tested.

System Prep

  • Your system should already have the GNU build tools installed, as well as:
    • cairo-1.15.12-4, cairo-devel-1.15.12-4
    • libpng-1.5.13-7, libpng-devel-1.5.13-7
    • libjpeg-turbo-1.2.90-8, libjpeg-turbo-devel-1.2.90-8
    • zlib-1.2.7-18, zlib-devel-1.2.7-18
    • bzip2-libs-1.0.6-13, bzip2-devel-1.0.6-13
    • python-2.7.5-86
    • numpy-1.7.1-13
  • We will need Python 3, which is not installed by default on CentOS 7.
    • sudo yum -y install python3 python3-devel python3-pip
    • sudo pip3 install numpy
    • sudo pip3 install astropy
  • We can get NetPBM through RPM / yum.
    • sudo yum -y install netpbm netpbm-devel netpbm-progs
  • We can get pyfits and cfitsio through RPM / yum from EPEL
    • sudo yum -y install epel-release
    • sudo yum -y install pyfits pyfits-tools cfitsio cfitsio-devel

Building astrometry.net

  • wget http://astrometry.net/downloads/astrometry.net-0.80.tar.gz
  • tar zxvf astrometry.net-0.80.tar.gz
  • cd astrometry.net-0.80/util/
  • Edit 'makefile.netpbm'
    • NETPBM_INC ?= -I/usr/include/netpbm
    • NETPBM_LIB ?= -L/usr/lib64 -lnetpbm
  • cd ..
  • make
  • make py
  • make extra
  • sudo make install

Download the astrometry.net data

  • If you're only doing wide-field work, you may be able to get by with these data files. They add up to ~400 MB.
    • for i in $( seq -w 7 19 ); do wget http://data.astrometry.net/4100/index-41$i.fits; done
  • You may want these more detailed data files as well / instead. They add up to ~10 GB.
    • for i in $( seq -w 0 47 ); do wget http://data.astrometry.net/4200/index-4202-$i.fits; done
    • for i in $( seq -w 0 47 ); do wget http://data.astrometry.net/4200/index-4203-$i.fits; done
    • for i in $( seq -w 0 47 ); do wget http://data.astrometry.net/4200/index-4204-$i.fits; done
    • for i in $( seq -w 0 11 ); do wget http://data.astrometry.net/4200/index-4205-$i.fits; done
    • for i in $( seq -w 0 11 ); do wget http://data.astrometry.net/4200/index-4206-$i.fits; done
    • for i in $( seq -w 0 11 ); do wget http://data.astrometry.net/4200/index-4207-$i.fits; done
    • for i in $( seq -w 8 19 ); do wget http://data.astrometry.net/4200/index-42$i.fits; done
  • Most people won't need these data files. They add up to ~24 GB.
    • for i in $( seq -w 0 47 ); do wget http://data.astrometry.net/4200/index-4200-$i.fits; done
    • for i in $( seq -w 0 47 ); do wget http://data.astrometry.net/4200/index-4201-$i.fits; done
  • Move the index-*.fits data files to /usr/local/astrometry/data.

Testing

  1. export PATH=${PATH}:/usr/local/astrometry/bin
  2. cd demo
  3. solve-field apod2.jpg

Common Error #2

cairoutils.c:728:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM images
*** longjmp causes uninitialized stack frame ***: /usr/local/astrometry/bin/plotxy terminated

When seen while running solve-field, often just before a stack trace, this means that astrometry.net was built without Netpbm support. Make sure you have Netpbm installed and that you have modified makefile.netpbm accurately and with the correct paths to the Netpbm headers and libraries as mentioned above.