How do I bypass the usage of masks during extraction with SMART?
Posted by z-Vandana Desai on 01 December 2008 03:43 PM
To do it you need to make your own extraction mask. The simplest way to do this is to write an IDL routine which makes a 128X128 array, sets the array elements to the values you want them to be and then writes out to a file. Mask files can be either ".fits" (binary) or ".txt" (ASCII) and for the SMART files we continue the file types used by SSC. Do NOT replace ".fits" file with a ".txt" or vice versa. SMART will crash if you try.|
For example, suppose you want to change a bad pixel mask. In any of the SMART "bpm" files there is a 128X128 array where the elements corresponding to good pixels in the detector array are set to "1" and bad pixels are set to "0". During extraction the data array is multiplied by the bpm array. The good data points are unchanged, the bad ones set to zero.
If you do not want any data array pixels set to zero simply set all elements in the multiplying array to "1".
Add a header to your file by copying the one from the corresponding SMART supplied file and edit the comments to make it clear that this is a special file you have made yourself. SMART expects file headers and will crash without them.
Having made your file, give it a name that fits in with the SMART calibration file naming convention. This is described in detail here
So for a new (long low for example) bpm file, the name would be something like "irs_ll_bpm_b1.fits".
The string "irs_ll_bpm" is what allows SMART to find the file. The "_b1" (or similar) is the version number. Do NOT give any file you make the same name/number as an existing file. Further all desingantions beginning "_v", "_s" and "_e" are reserved for future SMART and/or SSC file releases. Pick something completely different, like "_b" (for Ben).
Once you have made your file add it to SMART by putting it in the directory :
Where "IRS_Calibration" is the top of the calibration files directory tree in your installation of SMART and "type" is the directory for the type of file you are adding. (For bpm the directory for this is "mask".)
DO NOT UNDER ANY CIRCUMSTANCES CHANGE, RE-NAME, MOVE, DELETE OR OVERWRITE ANY EXISTING SMART CALIBRATION FILE.
If you do this SMART will crash.
Once you have added the file to the calibration directory tree invoke SMART. Go to the SMART Calibration selection window. Description is available here .
From the Project Manager window click "Calibration" and "Setup". On the list of "SubDirs" pick the directory to which you have just added the new calibraion file. For a bpm file this will be "mask". Scroll down to the relevant module and mask type (EG. "ll_bpm") and click on the file displayed. Assuming you have added the new file with the right name and directory it will then appear on the drop down list of selectable calibration files for that type. Select it as default. It will display as the selected file. Then click on "Exit with this". The Calibration window will disappear and the default will be set to the new file you have added.
You can then run extractions using the file you have made. It may be best to run a few test extractions to check. At any time you can switch back to the original SMART supplied ones by returning to the Calibration Selection window and clicking on "Exit with SYS". This will re-set your defaults back to the SMART supplied original.