-
Notifications
You must be signed in to change notification settings - Fork 0
DRM Reduction of SpeX Data
Leigh Fletcher edited this page Jan 19, 2022
·
7 revisions
This guide will explain how to reduce SpeX GuideDog (i.e., imaging) data using DRM. Data may have already been substantially processes, so that there is no need to do the ABAB subtraction, the flat and dark corrections, and the despiking. If you find a file of the form jc****.gz, then this is ready for the cylindrical mapping step 11. If only raw data w****.gz files are present, then proceed with steps 1-10.
- Type 'idl drm_new' on the command line, Data Reduction Manager (DRM) will appear.
- Note that
drm_newcode is a beta version that has sliders on the bottom and top to allow you to adjust the brightness of the image. - Choose 'Get Files' to type the path to open the required directory.
- E.g., /data/nemesis/GBdata/spex2/[date]/rawimg/[wavelength]/jupiter) (in place of [date], you will see the year, month and the day of data, for example: 09sep2,09aug; in place of [wavelength] you will see 2.23, 2.12,1,64 etc.
- working filenames start with 'w'-working and include:
- jup, numbers,'a', or 'b'-background,.fits, and .gz).
- "Select Working File' will appear.
- Make sure that 'a' and 'b' files are ordered in 'abab' pattern. (They are located in the 'Files' area. 'a' file is the first, 'b' is the second, third the 'a', then 'b' , etc .... ).
- Press 'All Files' then 'OK'
- If they aren not selected in 'abab' order in the 'Selection' area, then don't press 'All Files', instead select one by one, at first 'a' and the background file 'b', then the next 'a', 'b', etc.
- Press 'OK'
- 'DRM' will open the block of working filenames in the 'Files:' area.(On the left).
- You can also bring to this area the files you needed for 'division by flat' and 'co-adding' steps. (Filenames include:'flat' or 'badpixelmask'. Get their path names from step 4 or 6).
- Press the 'Select' button.
- If 'Files' from the left has only 'w' files you need to choose 'Select' then 'Select All'.
- If 'Files' from the left has also other file blocks that you currently don’t need, click the first needed file, choose "Select", then "Block'. (If you click other than the first a file, the 'abab' order might be changed).
- Now you can deselect unneeded files from the 'Selection list' by clicking on the filenames.
- Press the 'Edit'-> 'Expression'-> "ABAB Format subtraction"-> OK
- Press 'Select' -> 'Select Updated".
- In the 'Selections' area you will see only a files.
For students: quick-look results to track the locations of features can skip this step.
- The flat files are in
/data/nemesis/spex2/calibdirectory, or more recent versions might be found in/date/images/wavelength/skydirectory for the same date as your observations. - Use the most recent flat file for all different blocks of images, or test a range of different potential flats for that particular filter.
- If you didn't get the flat file yet, press 'Get' button to get it now.
- Make sure you have only working a files in the 'Selection area'.
- Press 'Edit'-> 'Expression'-> 'Divide all selected by image zero'.
- You will see the expression ' _x(i)==_x(i)/_x(0);/loop '
- Always check if the flat file, that you use, is x(0). It might have different then '0" number. (It depends on the order you get that flat file) If it is not '0', change the number '0' from the expression " _x(i)==_x(i)/_x(0);/loop " into the the number associated with the flat filename (from the left). For example x(6) or x(4), etc..
- Press 'OK'.
- Part of the problem is often coming up with contemporaneous flat-field files. Trustworthy ones (taken in daylight) are often unavailable near opposition (only nighttime observing).
- You may perform this step twice
- Choose 'Select' -> 'Select Updated'
- Choose 'Browse' -> 'Browse All Selected'
- This will show the selected images. Do this before and after diepiking to compare the results.
- Choose 'Edit'-> 'Expression'-> 'Despike all selected images-> OK
For students: application of the bad-pixel mask can sometimes be confusing. For quick-look results, you can skip this step and go to step 7.
- The 'bad pixel mask ' file is in '/data/nemesis/spex2/calib' directory. If you didn't get it yet, get it now. Choose the most recent for that particular wavelength, or test with a variety of files if you don’t get decent results.
- To make sure you co_add only 'good' images, press
- 'Select' -> 'Select Updated' -> 'Browse' -> 'Browse All Selected".
- If you see any bad image click on the filename in the 'Selections:' area. Bad file's name will disappear from the list.
- Another criterion for selecting images to coadd is the printout of the Sobel criterion, a measure of image sharpness, whenever images are browsed. But one’s eye is always the ultimate judge.
- If you can't see the all a files from the 'Browse All Selected' step, open and check double clicking on the file's name in 'Files:' area.
- Before co_adding, make sure in "selections:' area you see only a files.
- You need to make the 'bad pixel mask ' file primary file.
- To make it primary:
- Select 'bad pixel mask file' on 'Files:' list.
- The bad_pixel_mask filename will appear in 'Selections:' list.
- Now click on it. Make sure it is deselected now from the 'Selection:' list.
- Bad pixel mask filename will disappear from 'Selections:' list.
- On the bottom of the WINDOW you will see "Primary file: [ bad_ pixel_ mask file_name ].
- Press 'Program'-> 'Coadd without bad pixel' -> 'OK'
- 'Settings' will appear.
- Say ‘Yes’ to ‘Use Primary as Bad Pixel Mask.’ If no bad-pixel mask has been selected in step 6, then no need to click this.
- Say 'No' to 'Use -OLDRA and -OLDDEC for initial offsets'.
- ( 'Astro Correlate' is OK for 'Choose Alignment Method'.)
- Press 'Done'.
- Sometimes the resulting coadd will appear negative. If this is the case, go to Edit -> Expression and type "-_a(0" and hit enter, it should be flipped to be positive.
- Save the coadded image in the same directory.
- The new filename will start with 'jcf' which stands for jupiter_coadded_fitlimb, after 'jcf' will be the first filename's numbers from the data set and the the last filename's numbers from the data set, with the extention 'gz'. For example:
- For the files (wjup0012.gz, wjup0013.gz, wjup0014.gz), the coadded file name will be 'jcf012014.gz'
- To deal with dark areas invisible for the eye image, press 'Tools' -> 'Image Scaling' and change the 'current MAX' and 'current MIN' to find the optimal values.
- You can't save the result from 'image scaling', instead :
- Type ' a < NUMBER ' as an expression (find an appropriate NUMBER from the 'image Scaling').
- To find the input field for the expressions, go to the 'Edit'-> 'Expression' . Press OK. Save your work using 'Save as'.
- On the image menu bar select 'Program'->'Despike'-> 'No Mask'.
- Save the result using 'Save as'.
- You may repeat this step several times to get a better result,
- Don't forget to save it after each good result.
- On the image menu bar select 'Edit'->Flip and Save this step.
- You will see the image got rotated.
- SAVE your work with 'Save as' to overwrite the file.
- On the image menu bar choose
- 'Program' -> Geometry ->'Fit Limb' .
- The 'Geometry Buttons' will appear. To fit it properly use the buttons: arrows (<-, ->), 'Limb Bigger', 'Limb Smaller', Change the 'CCW' from '0.00000' to 1.80000' and change the 'Plate Scale' to '0.115696' using the 'Limb Smaller', 'Limb Bigger' buttons.
- Press 'Done_No Optimize'.
- Check the header:
- Press the 'Header' Button on the image menu. (The 'Header' is located on the left from the image.)
- Check and correct 'CCW' and 'PLATE_SC' values. (CCW =1.80000, Plate_sc = 0.115696).
- If you made changes you should Press 'Update' Button. ('Update' button is located on the bottom of the image.)
- SAVE your updated image using 'Save as'.
- Within the image Tool window press
- 'Programs' ->'Cylindrical Map' ->'Cylmap of Image Tool'.
- The 'Settings' Will appear.
- From 'Choose a resolution:' option, select '2x - 1.0 degree res.'
- From 'Choose an output option:' select 'Cylmap and mu and mu0' on
- Press 'Done'.
- To save this step you need to press the 'File' ->'Save Cylmap' (on the bottom of the image). Don't Save this step using 'Save as'
You now have a geometry-fitted and cylindrically mapped version of the data for further processing.