Downloading and Reading Level 1 Data Files

TECHNICAL NOTE: The examples in this section may rely on the user having a valid SSWIDL installation (as shown in this section) with the most recent SOT software tree installed (as shown in this section).

Each SOT-SP Level 1 dataset is categorized by a ScanID, which takes the form of a string representing the date and time of the beginning of the scan. Once the ScanID of a SOT-SP scan is known, the sotsp_getdata.pro routine can be used to download the Level 1 files, i.e., the calibrated polarization spectra. The source code for sotsp_getdata.pro can be found at this link.

As an example, after first defining the ScanID in a variable

scanid='20140316_002851'  ;  164"x123" fast map of AR12002

the SSWIDL commands in the following code block show how to determine the URLs of the files containins the spectra of a scan of AR12002:

sotsp_getdata,scanid,level=1,urls=urls,/no_get  ;  URLs for the level 1 spectra

On output, the variable specified via the urls keyword will contain a list of URLs corresponding to the Level 1 spectra for this scan. The /no_get keyword skips the download step.

IDL> print,urls
http://www.lmsal.com/solarsoft/hinode/level1hao/2014/03/16/SP3D/20140316_002851/SP3D20140316_002851.8C.fits
http://www.lmsal.com/solarsoft/hinode/level1hao/2014/03/16/SP3D/20140316_002851/SP3D20140316_002855.8C.fits
http://www.lmsal.com/solarsoft/hinode/level1hao/2014/03/16/SP3D/20140316_002851/SP3D20140316_002859.6C.fits
http://www.lmsal.com/solarsoft/hinode/level1hao/2014/03/16/SP3D/20140316_002851/SP3D20140316_002903.4C.fits
http://www.lmsal.com/solarsoft/hinode/level1hao/2014/03/16/SP3D/20140316_002851/SP3D20140316_002907.2C.fits
[...]

To actually download the spectra for this scan, simply remove the /no_get switch, as shown in the code block following this paragraph. In general, because of the data volume, the sotsp_getdata.pro routine will take some time to complete. For this particular ScanID, sotsp_getdata.pro will create a 20140316_002851 directory into which 180 MB of data (506 files of the form SP3D20140316_??????.??.fits) will be downloaded. The date and time at which each spectrum was observed is embedded in the filename.

sotsp_getdata,scanid,level=1,urls=urls  ;  downloads the level 1 spectra
flist=file_search(scanid+'/SP3D*.fits')  ;  gets names of all level 1 files

If successful, the flist variable will contain the list of local SOT-SP Level 1 data files for this scan.

IDL> print,flist
20140316_002851/SP3D20140316_002851.8C.fits
20140316_002851/SP3D20140316_002855.8C.fits
20140316_002851/SP3D20140316_002859.6C.fits
20140316_002851/SP3D20140316_002903.4C.fits
20140316_002851/SP3D20140316_002907.2C.fits
[...]

Using the mreadfits/pro procedure to read in the whole list of scans as follows,

mreadfits,flist,index,data

one will end up with the calibrated Stokes \(I\), \(Q\), \(U\), and \(V\) spectra for all 506 files in a single 112×384×2,024-element array.

IDL> help,index,data
INDEX           STRUCT    = ->  Array[2024]
DATA            INT       = Array[112, 384, 2024]

SOT Level 1 image of
AR12002 (Stokes I)

In the data array, the first dimension correspons to wavelength, the second dimension corresponds to the \(y\) position along the slit, and the third dimension contains the four Stokes variables for each of the 506 slit positions (4×506=2,024).

The following code block will display an image of Stokes \(I\) near the line center at 6301.5 Å. After first determining the index nearest to 6301.5 Å in wavelength space, an image of Stokes \(I\) is extracted from the 112×384×2,024-element array and transposed so that the \(x\) direction is indexed first in the image. The final command plots the image shown at right.

nwave=(size(data,/dim))[0]  ;  number of wavelength points in the spectra
wavelength=index[0].crval1+index[0].cdelt1*(findgen(nwave)-index[0].crpix1+1)
minval=min(abs(wavelength-6301.5),minpix)  ;  line center wavelength index
imlinecent=transpose(reform(data(minpix,*,0:-1:4)))  ;  line center image
tv,bytscl(imlinecent)