PRIMUS software installation at LCO

From NYU CCPP Wiki

This guide will help you set up the PRIMUS IDL tools on the LCO Mac computers. Note that many of the same steps are needed to run it on your machine locally (except the installation of IDL).

Setting up the tools:

1. Hopefully you have tarballs of the following packages with you

a. IDLUTILS
b. IDLSPEC2D
c. KCORRECT
d. primus
e. IDL_6.3 with 64 bit support for mac

Don't assume you can download any of these - the internet connection is slow and just checking out the PRIMUS CVS archive will take a while. Also, the current mismatch between the IDL used down there and the processors (32 bit IDL on 64 bit processors) means you must take your own version of IDL with you until we can get this fixed.

2. Setup IDL

  • Unpackage
mkdir ~/idltools
cd ~/idltools
tar xvzf /Volumes/CAPRICA/obstrans/idl.6.3.tar.gz
  • Edit near the beginning of your .cshrc.local file
setenv IDL_DIR /Users/rcool/soft/idl_6.3
source $IDL_DIR/bin/idl_setup
setenv PATH $IDL_DIR/bin/:$PATH
setenv IDL_PATH $IDL_DIR/lib/
  • Edit the file $IDL_DIR/bin/idl_setup
change
setenv IDL_DIR /Applications/rsi/rsi/idl_6.3	
to
#setenv IDL_DIR /Applications/rsi/rsi/idl_6.3
  • Source your .tcshrc file and start idl. You should make sure it is labeled as:
IDL Version 6.3, Mac OS X (darwin i386 m32)

3. Setup IDLUTILS

  • Unpackage
tar xvzf /Volumes/CAPRICA/obstrans/idlutils.tar.gz 
  • Add the following lines to your .tcshrc file
#IDLUTILS Initializations
setenv IDLUTILS_DIR $HOME/idltools/idlutils/cvs
setenv PATH $IDLUTILS_DIR/bin:$PATH
setenv IDL_PATH +$IDLUTILS_DIR/goddard/pro:$IDL_PATH
setenv IDL_PATH +$IDLUTILS_DIR/pro:$IDL_PATH
setenv IDL_PATH +$IDLUTILS_DIR/goddard/pro:$IDL_PATH
  • Source your .tcshrc file and then
cd $IDLUTILS_DIR/src/
$IDLUTILS_DIR/bin/evilmake clean 
$IDLUTILS_DIR/bin/evilmake all

Beware that older versions of IDL have an evilmake command that uses the incorrect gcc flags and thus will not work if you notices an -arch ppc command then you are using an obsolete version of evilmake

  • Start IDL and test to see if things are working
IDL > test = findgen(100,100)
IDL > help, djs_avsigclip(test)

If this doesn't work there is a major problem (though working doesn't mean everything is ok, just means that nothing obvious has failed)


4. Setup IDLSPEC2d This is similar to idlutils in installation.

  • Add to your .tcshrc
#IDLSPEC2D Initializations
setenv IDLSPEC2D_DIR $HOME/idltools/idlspec2d/cvs
setenv PATH $IDLSPEC2D_DIR/bin:$PATH
setenv IDL_PATH +$IDLSPEC2D_DIR/pro:$IDL_PATH
  • After sourcing your .cshrc file, open idl and compile plotspec or extract_row and be sure that idl sees these properly.
  • Compile the c code
cd $IDLSPEC2D_DIR/src
evilmake clean
evilmake all

Install kcorrect

I am not 100% sure if the quicklook uses any code from kcorrect (I don't think it does) but I will cover it here for completelness. You will need this for the full reductions.

  • Update your .tcshrc
setenv KCORRECT_DIR $HOME/products/Darwin/kcorrect/cvs
setenv LD_LIBRARY_PATH $KCORRECT_DIR/lib
setenv PATH $KCORRECT_DIR/bin:$PATH
setenv IDL_PATH +$KCORRECT_DIR/pro:$IDL_PATH
  • Source your .cshrc and try to compile (.r) kcorrect inside idl to ensure the paths are set properly.
  • Compile the c code.
cd $KCORRECT_DIR
evilmake 

Here, I did evilmake instead of kevilmake as the kevilmake I have doesn't know about intel macs - this likely has changed and you can probably use kevilmake as instructed on the kcorrect website.

Install primus

  • update your .tcshrc
#This points to your cvs archive
setenv PRIMUS_DIR /home/rcool/primus
#This points to the rawdata directory
setenv PRIMUS_RAWDATA /saguaro/rcool/primus/rawdata
#This points to the reduced data
setenv PRIMUS_REDUX /saguaro/rcool/primus/redux/
#This points to ancillary information (not needed for quicklook)
setenv PRIMUS_DATA /saguaro/rcool/primus
setenv IDL_PATH +$PRIMUS_DIR/pro:$IDL_PATH
  • check that some of the primus code compiles in idl (such as primus_quicklook)
  • Compile the c-code (likely not needed for quicklook)
cd $PRIMUS_DIR/src
evilmake

For reference, a copy of my .tcshrc file is found here:

Running quicklook

To run the quicklook reductions, you need the

  • _slits_ fits file for each mask you will want to reduce. These need to

be in the $PRIMUS_DIR/masks/ directory (or linked to there)

  • You need to update the $PRIMUS_DIR/masks/slit_tags.dat file for each of

the new surveys you are doing

Once you have the raw data copies to a separate computer (than it is taken on), you can go to the rawdata directory for the night and the quicklook reductions is quite simple.

IDL> primus_quicklook, 'ccd0123'

will perform all the needed procedures and extract the image. The outputs will go to $PRIMUS_REDUX/9999/utXXXXXX and the qaplots will be in a qaplots subdirectory of this directory.