Exercise 2: SDFITS Manipulation

SDFITS is the single dish FITS file format that is used at the Greenbank telescope, and our data will come in this form. For documentation on SDFITS, you can look here;

, or . We will explore one such file that is an observation of the Coma cluster radio relic.

Start IDL by typing ‘idl’ in the prompt (skip the quotes). Read the SDFITS file by typing:

> array=mrdfits(‘COMA_lband01.raw.acs.fits’,1,header)

MRDFITS will read the SDFITS file into an array of structures called ‘array’, and the header information into a string variable called header. The ‘1’ is there to tell MRDFITS to read the first data table in the file; there is only one in this case.

To look at the structures in more detail, you can use the help command;

>help, arr[0],/structure

It will show you the first structure in the array in three columns. The first column lists the names of the elements in the structure, like DATA or TCAL etc. The second column tells you what data type it is, like DOUBLE or FLOAT, and the third column tells you the value that the element currently has. If the element is also an array, it will say ‘Array[n]’, when n is the number of elements in the array.

1: The spectral data is stored in the DATA element. To plot the first spectrum, try

>plot, array[0].data

2: This plots the spectrum with no frequency information. Write a function (look it up in your book how to do this) that will take as an input one of these structures and will output a frequency axis for that spectrum. You can call it ‘get_freq’, for example, and it should work like;

>freq=get_freq(array[0])

You can then plot the spectrum like this;

>plot, freq, array[0].data

3: There is a separate text file, ‘COMA_lband01.raw.acs.index’, that tells you a lot of the information that is in the fits file. It has one row for each integration, and tells you where in the sky the telescope was pointing during that integration (Longitude & Latitude columns), what polarization it is (XX, YY etc., under the POL column), what the integration time was (Exposure column), and so on. The column IFNUM refers to the two different frequencies we are using, each one having its own separate spectrum. Your task is this: Write a function that will take whatever scan you like (under the SCAN column), any polarization you like, and any IFNUM you like, and make a two dimensional image of all the spectra. You will notice in the index file that there are two entries for each polarization that have the same position on the sky; one has an ‘F’ under the SIG column and the other has a ‘T’. This is a peculiarity of the observing setup that we used, so I want you to average these two spectra before you put them into the image. The x-axis of should be the frequency axis, and the y-axis should be time (you can label them later when you plot the image).

4. Now that you have this function, write a GUI that will allow you to select which polarization and scan you want, and display it as an image (correctly labeled). This should take a little time, so see me if you need help. Good luck!