GDL setup with Astronomy library open-source IDL replacement

To setup the IDL/GDL Astronomy library on Linux:

  1. install GDL

    apt install gnudatalanguage
  2. add to ~/.bashrc

    export GDL_STARTUP=~/.gdl/
  3. Download IDL Astronomy Library and extract

    mkdir ~/astrolib
    tar xf astron.dir.tar.gz -C ~/astrolib
  4. create~/.gdl/


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


  1. reopen Terminal and type

  2. In GDL:


and ~/astrolib should be included in the printout.


Astrolib vs. AstroPy

The comparison is with my Astropy-based coordinate conversion library.

  • GDL

    hor2eq, ten(37,54,41), ten(264,55,06), 2466879.7083333d, ra, dec,  /verb, obs='kpno', pres=781.0, temp=273.0
  • Python shows less than 2% difference.

    python pymap3d/

reading .fits

  1. Download NASA example FITS file and extract

    tar xf
  2. from gdl show an image from Hubble Space Telescope.

    FITS_READ, '', data, header
  3. show FITS headers