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

  1. install GDL

     apt install gnudatalanguage
    
  2. add to ~/.bashrc
    export GDL_STARTUP=~/.gdl/gdl-startup.pro
    
  3. Download IDL Astronomy Library and extract

    mkdir -p ~/IDLtoolbox/astrolib
    
    tar xf astron.dir.tar.gz -C ~/IDLtoolbox/astrolib
    
  4. create~/.gdl/gdl-startup.pro

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

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

Check Astrolib installation

  1. reopen Terminal

     gdl
    
  2. In GDL:

     print,!PATH
    

    and IDLtoolbox directories should be listed.

IDL / GDL Astrolib vs. Python 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

python pymap3d/azel2radec.py

revealing less than 2% difference

Example: GDL GNUDataLanguage reading .fits

  1. Download NASA example FITS file and extract

     tar xf w0bs0102t_c0h.fit.gz
    
  2. from gdl

     FITS_READ, 'w0bs0102t_c0h.fit', data, header
    
     TVSCL,data
    

    showing an image from Hubble Space Telescope.

  3. show FITS headers

     PRINT,header
    

Leave a Comment