You are here

Download the latest version of the Gemini data reduction packages

Content owned by klabrie

IMPORTANT for Mac OS X Users

A CentOS 7 virtual machine image (OVA file) is now available to facilitate running Astroconda IRAF under MacOS 10.15+, which no longer supports running the necessary 32-bit binaries natively. This comes with Anaconda 2019.10, Gemini IRAF 1.14, DRAGONS 2.1.1 and other packages from Astroconda pre-installed. Users of MacOS 10.14 affected by the Tk bug that causes a desktop session logout when displaying graphics may also want to install this guest distribution as a workaround.

[June 2022 update: A new VM compatible with the M1 chip and set up with Gemini IRAF 1.15 is in final development and is expected to be available within a few weeks.  If you have the current VM installed on an Intel system, you can try to run "conda install iraf.gemini=v1.15 --no-update-deps --no-channel-priority" to update Gemini IRAF.]

Please see instructions at

Since the VM is set for IRAF, it comes with Python 2.7 and the latest version of DRAGONS still compatible with Python 2.7.  We recommend that you do your DRAGONS work natively rather using the VM and use the latest DRAGONS version which at this time is v3.0.

IMPORTANT for Linux Users

The minimum requirements for Anaconda is now CentOS 7 or equivalent.  DRAGONS will seem to install fine, but critical dependencies will not run properly or at all with CentOS 6 systems or below.  32-bit compatibility libraries are required to run Gemini IRAF (as installed via Astroconda).  If they are not already installed with your OS, you can find instructions here: 


Gemini IRAF
  • Stable Version: v1.15
  • Revision note: gemini_v115_rev.txt
  • Version 1.15 includes new support for Flamingos 2 MOS data.
  • IMPORTANT for Flamingos 2 users still using Gemini v1.14. [No MOS support.]  
    • If you are reducing recent (2022A and beyond) Flamingos 2 data, please also install this small patch to Gemini IRAF v1.14 that comes with the conda installation.

Instructions for updating DRAGONS

If you already have DRAGONS installed, it is likely to be in a Python 3.6 environment.  DRAGONS v3.0 requires Python 3.7.  You will need to create a new conda environment.  Set the instruction below for a new installation with conda create.

If you already have a Python 3.7 environement set up, adding DRAGONS v3.0 to the latest version is straightforward.  Replace environment_name with geminiconda, or dragons, or whatever name you used when you first created the environment.

    $ conda activate environment_name
    $ conda install package_name=version

For example (if you are already using Python 3.7):

    $ conda activate dragons
    $ conda install dragons=3.0.3

IMPORTANT:  For DRAGONS v3.0, make sure that you do NOT have "conda-forge" in your list of channels.

Instructions for updating Gemini IRAF

If you already have Gemini IRAF installed and wish to update the package to version 1.15, run the following commands:

    $ conda activate geminiconda
    $ conda install iraf.gemini=1.15 --no-update--deps --no-channel-priority

Instructions for new installation of DRAGONS and Gemini IRAF

WARNING: the use of the bash shell is required by Anaconda.

Install Anaconda

If you already have Anaconda installed, you can skip this step and go to the Install DRAGONS and Gemini IRAF section below. If not, then your first step is to get and install Anaconda. You can download it at:

Choose the version of Python that suits your other Python needs. DRAGONS v3.0 is compatible and has been tested with Python 3.7.  Starting with version 3.0, DRAGONS is no longer compatible with Python 2.   If you need Gemini IRAF, you will need Python 2.7.  If you need both DRAGONS and Gemini IRAF we recommend that you create two different environments, one for DRAGONS, one for Gemini IRAF.

If you have downloaded the graphical anaconda installer, follow the graphical installer instructions. Install in your home directory. It should be the default.

If you have downloaded the command-line installer, type the following in a terminal, replacing the .sh file name to the name of the file you have downloaded. The /bin/bash -l line is not needed if you are already using bash. The command-line installer allows for more customization of the installation. ($ indicates the terminal prompt.)

    $ /bin/bash -l
    $ chmod a+x
    $ ./

To prevent the Anaconda "base" environment from loading automatically, giving you back the control as to when to activate the conda environements, do:

    $ conda config --set auto_activate_base false

Verify Anaconda installation

Make sure that ~/anaconda3/bin/activate is in your PATH by doing:

    $ which activate

The Anaconda installer should have added conda configurations to the ~/.bash_profile for you. If activate is not found, try:

    $ source ~/.bash_profile

If activate is still not found, you might have to add export PATH=~/anaconda3/bin:$PATH to your ~/.bash_profile using your favorite text editor, and run the source command above again.


  • Sometimes the Anaconda installer will install the software in ~/anaconda2 or ~/anaconda3 instead of simply ~/anaconda. Just check in your home directory which one of the three possibilities was used.

  • The code Anaconda adds to the .bash_profile will automatically activate anaconda. To activate or deactivate Anaconda manually:
            $ conda activate
            $ conda deactivate

Set up Anaconda Channels

Remember that Anaconda requires the use of the bash shell. tcsh or csh will not work. If you are using (t)csh, your first step is:

    $ /bin/bash -l

Now that Anaconda is installed, we add the needed astronomy software. We add the Astroconda channel and the Gemini channel. Those channels host the conda astronomy packages. The channels need to be defined only once.

    $ conda config --add channels
    $ conda config --add channels

IMPORTANT:  For DRAGONS v3.0, make sure that you do NOT have "conda-forge" in your list of channels.

Install Gemini IRAF in Python 2 Environment

The next step is to create a virtual environment and install the Gemini IRAF software and its dependencies in it. The name of the environment can be anything you like. Here we use “geminiconda” as the name and we install Python 2.7. IMPORTANT: PyRAF, as distributed with conda, does not work well in Python 3, therefore, to use Gemini IRAF we must install Python 2.7.  (We are testing a version of PyRAF that can work well in Python 3 but it is not yet available.)

    $ conda create -n geminiconda python=2.7 gemini stsci iraf-all pyraf-all

To use this environment, activate it:

    $ conda activate geminiconda

You will need to activate the environment whenever you start a new shell. If you are planning to use it all the time, you might want to add the command to your .bash_profile, after the “conda init” block.

IMPORTANT for Flamingos 2 users still using v1.14.   If you are reducing recent (2022A and beyond) Flamingos 2 data, please also install this small patch to Gemini IRAF v1.14 that you have just installed with conda.  If you can, it is recommended that you update to Gemini IRAF v1.15 instead of installing the patch.

Python 3 and DRAGONS

DRAGONS requires Python 3. It was tested with Python 3.7, specifically. To install:

   $ conda create -n dragons python=3.7 dragons stsci

PyRAF and Gemini IRAF do not work well under Python 3. If you are going to reduce data with Gemini IRAF, eg, spectroscopy data, please install the Python 2 environment (see previous section).

Depending on your needs, it could be a good idea to have multiple environments installed, eg. geminiconda and dragons. They will not interfere with each other and you can switch from one the other by doing conda activate dragons or conda activate geminiconda.

Configuration and Testing

Configure IRAF

If you have installed IRAF and PyRAF and need to use Gemini IRAF, make sure that there is a configured iraf directory in your home directory. If you have used IRAF before it might already be there, it might still be wise to re-run the mkiraf step. To set up a new IRAF directory:

    $ cd ~
    $ mkdir iraf
    $ cd iraf
    $ mkiraf

At the mkiraf step, choose xterm or xgterm for the terminal, and re-initialize the uparm when/if asked.

Your computer might require 32-bit compatibility libraries. See this Astroconda FAQ for details and how to install those libraries on Linux:

Configure DRAGONS

DRAGONS requires a configuration file located in ~/.geminidr/:

    $ cd ~
    $ mkdir .geminidr
    $ cd .geminidr
    $ touch rsys.cfg

Open rsys.cfg with you favorite editor and add these lines:

    standalone = True
    database_dir = ~/.geminidr/

Configure buffers for ds9:

    $ cd ~
    $ cp $CONDA_PREFIX/lib/python3.7/site-packages/gempy/numdisplay/imtoolrc ~/.imtoolrc
    $ vi .bash_profile (or use you favorite editor)
    Add this line to the .bash_profile: 
       export IMTOOLRC=~/.imtoolrc

Test the installation

Test Gemini IRAF
        $ conda activate geminiconda
        $ pyraf
        --> gemini

You should be seeing the Gemini IRAF packages for each instruments.

        $ conda activate dragons
        $ python
        >>> import astrodata
        >>> import gemini_instruments

If the imports are successful, i.e. no errors show up, exit Python (Ctrl-D).

Now test that reduce runs. There may be some delay initially as packages and modules are compiled and loaded.

        $ reduce --help

This will print the reduce help to the screen.

If you have Gemini FITS files available, you can test that the Recipe System is functioning as expected as follow (replace the file name with the name of your file):

        $ reduce N20180106S0700.fits -r prepare

If all is well, you will see something like:

                            --- reduce, v3.0.3 ---
        All submitted files appear valid
        Found 'prepare' as a primitive.
        RECIPE: prepare
        PRIMITIVE: prepare
          PRIMITIVE: validateData
          PRIMITIVE: standardizeStructure
          PRIMITIVE: standardizeHeaders
             PRIMITIVE: standardizeObservatoryHeaders
             Updating keywords that are common to all Gemini data
             PRIMITIVE: standardizeInstrumentHeaders
             Updating keywords that are specific to NIRI
        Wrote N20180106S0700_prepared.fits in output directory

        reduce completed successfully.