GDL setup with Astronomy library (open-source IDL replacement)

prereq

apt install gnudatalanguage

edit your .bashrc, adding the line:

export GDL_STARTUP=~/.gdl/gdl-startup.pro

Download/setup IDL Astronomy Library:

wget http://idlastro.gsfc.nasa.gov/ftp/astron.dir.tar.gz

mkdir -p ~/IDLtoolbox/astrolib

tar xf astron.dir.tar.gz -C ~/IDLtoolbox/astrolib

finally let’s edit the gdl-startup.pro

mkdir -p ~/.gdl
nano ~/.gdl/gdl-startup.pro

and paste in the line

!PATH=!PATH+':'+Expand_Path('+~/IDLtoolbox/astrolib/')

which keeps the current paths and adds all the Astronomy library subdirectories.

Check Astrolib installation

reopen Terminal and type gdl

then type

print,!PATH

and you should see your IDLtoolbox directories listed.

IDL / GDL Astrolib compared with Python Astropy

GDL> hor2eq, ten(37,54,41), ten(264,55,06), 2466879.7083333d, ra, dec,  /verb, obs='kpno', pres=781.0, temp=273.0

cd pymap3d
python azel2radec.py

less than 2% difference

Example of using GDL GNUDataLanguage to read a FITS file

wget http://fits.gsfc.nasa.gov/nrao_data/samples/hst/w0bs0102t_c0h.fit.gz

tar xf w0bs0102t_c0h.fit.gz

now start gdl and type

FITS_READ, 'w0bs0102t_c0h.fit', data, header

TVSCL,data

and you will see an image from Hubble.

You can also type

PRINT,header

to see the FITS headers.