Change page style: 

Download the latest version of the Gemini IRAF package


Overview

Gemini IRAF
DRAGONS
  • Stable Version: v2.1.0
  • Initial public release.

Installation instructions for 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:

      https://www.anaconda.com/distribution/#download-section

Choose the version of Python that suits your other Python needs. DRAGONS is compatible with both Python 2.7 and 3.6. We recommend that you install the Python 3 version of Anaconda, the specific Python version can be adjusted later.

If you have downloaded the graphical 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 Anaconda3-2019.03-MacOSX-x86_64.sh
    $ ./Anaconda3-2019.03-MacOSX-x86_64.sh
     

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.

Notes
 

  • 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
            
        

Install DRAGONS and Gemini IRAF

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 softare. 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 http://ssb.stsci.edu/astroconda
    $ conda config --add channels http://astroconda.gemini.edu/public
    

The next step is to create a virtual environment and install the DRAGONS 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 does not work well in Python 3, therefore, to use Gemini IRAF we must install Python 2.7.

    
    $ 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.

Python 3 and DRAGONS

DRAGONS is fully compatible with Python 3. It was tested with Python 3.6, specifically. If you are not planning to use Gemini IRAF and PyRAF, you can install an IRAF-free version of DRAGONS that will use Python 3. Create the environment as follow:

    
    $ conda create -n dragons python=3.6 gemini stsci
    

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


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: http://astroconda.readthedocs.io/en/latest/faq.html#why-is-iraf-32-bit-instead-of-64-bit

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:

    
    [calibs]
    standalone = True
    database_dir = ~/.geminidr/
    

Test the installation

Test Gemini IRAF

        $ conda activate geminiconda
        $ pyraf
        --> gemini

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


Test DRAGONS

        $ conda activate dragons  (or geminiconda)
        $ 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, v2.0.8 ---
        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.
        
        

Gemini Observatory Participants