Rough, Mountain-Top, Data Analysis for SHARP

Directory structure

On puuoo and kilauea, you should set-up directories in the sharp account under ~/sharp/Runs/YYYYMMM/ with subdirectories like process, data, and calibs. See previous runs for examples.

Pointing

If the calculated FWHM is very high, or gives you FAZOs and FZAOs that look worse than where you are already pointed, see the SHARP Observing Instructions, which tell you how to give initial guesses for the position of the peak.

Integ'ing

In any previous run directory (~sharp/Runs/YYYYMMM/process/object/) you will find the file dointeg for converting raw SHARC data files into FITS IQU image files. Copy this to your new current directory. You then need to edit the scan numbers (use your favorite text editor; emacs, vi, and pico are available on puuoo and kiluea) to match your current data and add/remove the comment character (#) if necessary.

Run the script on the command line:

[prompt]$ source dointeg

This will output files NNNNN_int.fits.

Note added by Giles: Alternatively, the script dointeg is now in ~sharp/bin, so you can just call it from the command line. The syntax is dointeg NNNNN, where NNNNN is the file number. You have to call it from the directory ~sharp/Runs/YYYYMMM/process/SOURCENAME, where SOURCENAME is the subdirectory of process that corresponds to your source.

Combining Files: sharp_combine and docombine

Nicholas has written a python script that runs sharpcombine - it is called docombine. It is used as follows:

[prompt]$ docombine *_int.fits

This will combine all of the _int files in the current directory. There are number of optional arguments to control instrumental polarization, map size, etc. You can learn about the arguments and their default values by typing:

[prompt]$ docombine -h

In the remainder of this section, we give some obsolete notes on older incarnations of docombine.

The standard way to combine files is now explained in the next section, where everything is combined into a single script. The stuff in this section on combining files is somewhat obsolete.

First we need to set-up a list of files which will be combined. The easiest way to do this is:

[prompt]$ ls *_int.fits > list

where list is the ascii file where you want to save the list of integ'ed file names.

Next copy the script docombine from a previous object directory, just like you did the script dointeg above. This script can be edited by any text editor. Type sharp_combine alone at the UNIX prompt to see what options you might want to modify in the script.

Run the combine script: [prompt]$ docombine list > tmp.out
where list is the list of files you created above. The output on the screen will be more readable if you use the output re-direct to tmp.out as shown above, but it is not necessary.

The script will output the combined IQU image file to combine.fits. Move this to another file if you don't want to overwrite it the next time you run the script. Depending on the script version you copied over it may also automatically display the output file using ds9 or fv.

Integ/Combine/Polsharp in a single script

Nicholas has written a new python script called doall. It combines dointeg, docombine, and dovector (described in the next section). It is used as follows

[prompt]$ doall XXXXX-YYYYY

where XXXXX and YYYYY are starting and ending file numbers. To learn more, you can type:

[prompt]$ doall -h

In the remainder of this section, we give some obsolete notes on older incarnations of doall.

John put together a script called doall which can be found in ~sharp/bin/. Giles' version of this script is called doall2 and it also resides in bin. It works pretty well and generally only the map size (-l flag) or the scale of the vectors (set as an environment variable, or perhaps even from the command line; I forget) should need to be modified. These two are standard sharpcombine and polsharp flags. There should be no need to copy the doall or doall2 scripts to your working directory but you may do so if you want to edit some of the default directory paths or sharp_combine options or polsharp5 options (see below).

The way that the doall and doall2 scripts work is that at the prompt you type:

[prompt]$ doall NNNNN or [prompt]$ doall2 NNNNN

where NNNNN is the newest 5-digit scan number. This will process the single scan using sharpinteg_2, create a list of files to be combined (this will comprise all the *_int.fits files in the current directory), and run sharp_combine using this list. As before the default output is called combine.fits.

Note that doall and doall2 also run the IDL code polsharp5 (see below) and put the output in the file named idl.ps.

More details on polsharp5 are given in the next section.

Plotting polarization vectors with Polsharp

Nicholas has written a script called dovector.

[prompt]$ dovector combine.fits

This assumes that your output file from sharpcombine is called combine.fits

This will create an output file called polsharp.txt and open a new window with polarization vectors plotted. You can get help via

[prompt]$ dovector -h

This will allow you to learn about options for changing the name of the output file, setting sigma cuts, plotting Nyquist vs. independent vectors, etc.

In the remainder of this section, we give some obsolete notes on older incarnations of vector plotting utilities

Start IDL by typing: [prompt]$ idl

At the IDL prompt, for the novice I first recommend:

IDL> polsharp5, 'combine.fits', /vec, sig2=2, color=2, skipv=2

Type polsharp5 alone at the IDL prompt for help and description of these options and others.


Updated 2012 and 2010 (GN); 2009 (MK).
For further help contact John Vaillancourt
Go back to SHARP collaborators page.
Go back to SHARP Home page.