The current version of the pipeline for DCT is here:

https://github.com/igrins/plp/tree/domeflat

An example pipeline recipe is here: 20161011.recipes

From Ian Avilez @ Lowell Observatory:

IGRINS data reduction procedure: IEA Oct 10 2016

## Procedures will take place in the directory ../plp-domeflat/ unless otherwise stated ##


1) Make sure that the raw data from the night of observing is in the “indata” directory. You can make a directory named “indata” if there is not one already, just make sure it is in the parent directory called “plp-domeflat”.

Inside this directory, you can create a directory that has the date of the observation, and put the raw data inside there. For this example we will be using the directory name “20160926”, which we will use in a few different places.


2) CD to the “plp-domeflat” directory and type:

$ ur_setup


3) Set up the data by typing:

$ UTDATE=20160926

where the actual date is the date of your directory containing your raw data.


4) Create the recipe file:

$ python igr_pipe.py prepare-recipe-logs $UTDATE

this will create a temporary recipe file which you will then need to go and edit. It can be found at /plp-domeflat/recipe_logs/ and will have the extension “.tmp”

NOTE: if you get an error saying something to the effect of (got 13 columns instead of 12), look at the IGRINS logs in the directory where the in data is stored for that night’s observation, and check the rows. There might be columns right after the target names that have magnitudes in them (something like V 8.). Duplicate each of the files and then delete those magnitude values and verify that without them, there are only 12 columns.


5) Edit the recipe file:

A) Make sure every observation has an A paired with a B and vice versa. If this is not the case, comment out the files that have a multiple, so that the pipeline skips problematic files.

For example, lets say we have a target that has the nods A B B A A A B B A, with the file numbers 10 11 12 13 14 15 16 17 18. Every A nod has a corresponding B, except we have an extra A nod in the middle. Check the log sheet to see which extra A is bad, for this case we will say it is the middle-most “A”.

Copy the line to the next one and delete the middle A and the file number (14) of that particular nod. In the copied line, delete all the file numbers and nods EXCEPT the A and the 14. Comment out this line with a ‘#’, so that the data is still visible, but the pipeline will ignore that particular line.

For this example, we would then have two lines, looking like:

Name, TAR, 1, 1, 10.000000, STELLAR_AB, 10 11 12 13 15 16 17 18, A B B A A B B A
#Name, TAR, 1, 1, 10.000000, STELLAR_AB, 14, A

B) Next, copy one of the lines of data down to use as a SKY frame if one isn’t already there. You can copy any of the lines, and just change the NAME, TAR, and STELLAR_AB to SKY.

For example, copy the line we used up above:

Name, TAR, 1, 1, 10.000000, STELLAR_AB, 10 11 12 13 15 16 17 18, A B B A A B B A

and change it to:

SKY, SKY, 1, 1, 10.000000, SKY, 10 11 12 13 15 16 17 18, A B B A A B B A

C) Finally, if the recipe file that was created has two lines that are labeled as FLAT, combine them into one, keeping the sequence of image numbers as well as the order of the “OFF” and “ON” frame types.

For example, we have these two lines:

FLAT_OFF, FLAT, 1, 1, 300.000000, FLAT, 12 13 14 15 16, OFF OFF OFF OFF OFF
FLAT_ON, FLAT, 1, 1, 300.000000, FLAT, 17 18 19 20 21, ON ON ON ON ON

Combine them to make:

FLAT, FLAT, 1, 1, 300.000000, FLAT, 12 13 14 15 16 17 18 19 20 21, OFF OFF OFF OFF OFF ON ON ON ON ON

******* IMPORTANT: ONCE YOU ARE DONE EDITING THE RECIPE FILE, CHANGE THE EXTENSION ******* TO .RECIPES (BASICALLY DELETE THE .TMP EXTENSION), OTHERWISE THE PIPELINE WILL NOT ******* FIND THE FILE.


6) Now that your recipe file is done, you can run the pipeline!

Copy and paste the following (without the #’s) into the terminal window, while in the plp-domeflat directory and wait (this may take some time):


###########################################################################################

for RECIPE in flat register-sky sky-wvlsol a0v-ab stellar-ab extended-ab extended-onoff stellar-onoff tell-wvsol divide-a0v
do python igr_pipe.py $RECIPE $UTDATE
rc=$?
if [ $rc != "0" ]; then
exit $rc
fi
done

###########################################################################################

This reduces the data and puts the (almost) finished product in a directory called /outdata/UTDATE (where UTDATE is the date you inserted at the beginning).


7) Now we will create an interactive html page

In the plp-domeflat directory, type:


python igr_pipe.py plot-spec $UTDATE -m —-html-output


once that finishes, type:


python igr_pipe.py publish-html $UTDATE


this creates a directory found at /plp-domeflat/html/UTDATE and contains a file called “index.html” double click on this file to view the html in a browser window.


8) Create a new directory somewhere where you want to have the reduced data stored. Say we call it “data”, you will then make directories for each object you observed. So for our example our directory structure would be something like:

/data/2016/wr140_sep26/


A) Copy three files from the following directory into the target directory you just set up:

/plp-domeflat/outdata/UTDATE/

where UTDATE is the date of observation. You will need to grab the three files titled SDCH_UTDATE_####.sn.fits, SDCH_UTDATE_####.spec.fits, and SDCH_UTDATE_####.variance.fits, where UTDATE is the date of observation, and the #### is the number of the FIRST file of your object. You can get this number from the log sheet or the recipe file.

B) Copy the file titled SKY_SDCH_UTDATE_####.wvlsolv_v1.fits into the target directory you set up. This file will be found in:

/plp-domeflat/calib/primary/UTDATE/ where UTDATE is the date of your observation.

******* NOTE: the #### for this step will not necessarily match the #### from step A).

C) Repeat steps A) and B) for the same files/directories but for the files that start with SDCK instead of SDCH.


##########################################################################################

For the next steps, make sure that the code IGRINS_ASCII.PRO and IGRINS_DATA_SPLIT.PRO are in your IDL Path.

##########################################################################################


9) To convert the IGRINS reduction files into ascii, cd to your target directory:

data/2016/wr140_sep26/

A) Start IDL and type:

IDL> igrins_ascii,AAAA,BBBB,’H’,’UTDATE’

Where UTDATE is the date of your observation, and AAAA is the #### from step 8-A, and BBBB is the #### from step 8-B. MAKE SURE TO TRIM OFF ANY LEADING ZEROS, i.e. if the #### from step 8-A was ‘0016’, then AAAA will be ’16’.

When the code prompts you for a prefix, use the target name, i.e. ‘wr140’

B) Do the same thing using ‘K’ in the IDL code.

This creates large ascii files named TAR_UTDATE_H_####.txt, where TAR is the name of the target, UTDATE is the date of observation, and #### is the number of the first file in step 8-A.


10) To break up this ascii file into individual orders, copy the file igrins_data_template.save (found in the plp-domeflat) into the target directory, and then start IDL. Type in:

IDL > restore,’igrins_data_template.save’

IDL > igrins_data_split,’TAR_UTDATE_H_####.txt’,template

This will split up both the H and K orders automatically, so there is no need to run it again for K.

This will create a subdirectory which will include each of the individual orders with the naming convention:

TAR_UTDATE_BAND_####.ORDER.txt

Where TAR is the object, UTDATE is the date of observation, BAND is either H or K, and #### is the file number from step 8-A, and ORDER is the order number.

There should be 27 H-band orders and 25 K-band orders, both starting with ‘0’.

The H-Band order 10 is the one that most closely overlaps with NIRSPEC order 49.

  • No labels