Hinode/XRT IDL Object Tutorial

Paul Higgins (ARG/TCD, SSL/UCB), Peter Gallagher (ARG/TCD)

Last updated: August 2, 2007





IDL objects in SolarSoft allow one to easily and efficiently analyze extensive data sets with a few simple commands. An object is a dynamic data consruct, which includes a number of methods (functions and procedures) to operate. Objects use the -> operator to call their methods. The object is merely a means to dynamically manage data and settings. The object's methods do all of the work.


This IDL object may be used to download, read into IDL, plot, print out or make a movie of HINODE XRT image data. Like other objects, the XRT object uses sockets to retrieve data. The object has been tested on IDL version 6.3.


Getting Started


If you do not already have the Hinode/XRT branch in your SolarSoft tree, you must first run the following:

IDL> ssw_upgrade, /xrt, /spawn, /loud

Sample IDL Session


Start by creating the XRT object.

IDL> xrt = obj_new( 'xrt' )

List a day's worth of files.

IDL> flist = xrt -> list( timerange = [ '2-jun-2007 00:00', '2-jun-2007 07:00' ] )
IDL> help, flist

< Expression > STRING = Array[3]

Copy the files to the local directory. This can take some time as each file is approximately 8MB.

IDL> xrt -> copy, filelist = flist

Read the files into the XRT object.

IDL> xrt -> read, filelist = flist

Plot the first file in the series. (Figure 1.)

IDL> xrt -> plot, filelist = flist[0]




Figure 1: Simply ploting the data.



Use PLOTMAN to plot the file. (Figure 2.)

IDL> xrt -> plotman, filelist = flist[0]




Figure 2: Using the Plot Manager tool.



Create a movie of the files listed. (Figure 3.)

IDL> xrt -> movie, filelist = flist[0]




Figure 3: Creating a movie of the data.



Clean up the object and reallocate all memory.

IDL> obj_destroy, xrt

An alternative sample session could be as follows:
Initiate a new XRT object.

IDL> xrt = obj_new( 'xrt' )

Set the time.

IDL> xrt -> set, time = '2-Jun-2007 16:00'

This will find the XRT image taken closest to the set time.

Now get the data.

IDL> image = xrt -> getdata()

The XRT object searches the remote archive and downloads the data using IDL sockets.
The data can then be plotted:

IDL> xrt -> plot ;(Figure 4.)

or IDL> xrt -> plot, xrange = [ -400, 0 ], yrange = [ -400, 0 ] ;(Figure 5.)

or IDL> xrt -> plot, center = [ -200, 200 ], fov = 7 ;(Figure 6.)


.....

Figure 4: Simple plot.
.....

Figure 5: Zoom to a specific region.


Figure 6: Change the viewing angle and recenter.


Now check control parameters:
IDL> print, xrt -> get( /time )

or IDL> print, xrt -> get( /center )

or IDL> print, xrt -> get( /obs )

Contouring and plotting multiple images in the same window are also built into the XRT object.

IDL> xrt -> plot, timerange=['2-jun-07'], fov=20, center=[-200,50] ;(Figure 7.)




Figure 7: Changing the view angle and centering.



IDL> xrt -> multiplot, timerange=['2-jun-07 00:00','2-jun-07 11:00'], fov=20, center=[-200,50] ;(Figure 8.)




Figure 8: Plotting multiple data sets.




IDL> xrt -> plot, /latest
IDL> xrt -> plot, levels=100,/over ;(Figure 9.)




Figure 9: Contour the data.



Method Specifics


List


Description: Returns a list of full-path file names from the specified time range.
Syntax: IDL> flist = xrt -> list( timerange=timerange )
Keywords: timerange

timerange: A string array of one or two elements, using the syntax, 'day-month-year', which specifies the time stamps of the desired data files.

Copy


Description: Copies the listed files to the local directory.
Syntax: IDL> xrt -> copy, filelist=filelist
Keywords: filelist

filelist: A string array contaning the full-path file names of the desired data files.

Read


Description: Loads the specified files into the XRT object.
Syntax: IDL> xrt -> read, filelist=filelist
Keywords: filelist, timerange

Plot


Description: Plots the desired data file.
Syntax: IDL> xrt -> plot, filelist=filelist
Keywords: filelist, timerange, (any plot_map keyword), /latest

plot_map keywords: xrange, yrange, contour, overlay, smooth_width, border, fov, grid_spacing, center, tail, log_scale, notitle, title, lcolor, window, noaxes, nolabels, xsize, ysize, new, levels, missing, dmin, dmax, top, quiet, square_scale, trans, positive_only, negative_only, dimensions, offset, bottom, ctyle, cthick, date_only, nodate, last_scale, composite, interlace, average, ncolors, drange, limb_plot, roll, rcenter, truncate, duration, bthick, bcolor, drotate, multi, noerase, clabel, margin, status, xshift, yshift
/latest: Plots XRT's latest available data.

Latest


Description: Reads the latest available data into the XRT object.
Syntax: IDL> xrt -> latest
Keywords: N/A

Plotman


Description: Calls the PLOTMAN object to plot the desired data.
Syntax: IDL> xrt -> plotman, filelist=filelist
Keywords: Same as PLOT.

Movie


Description: Calls the XMOVIE widget, and animates the desired data files.
Syntax: IDL> xrt -> movie, filelist=filelist
Keywords: filelist,timerange.

Set


Description: Sets the specified object property.
Syntax: IDL> xrt -> set, timerange=timerange
Keywords: timerange, (any plot_map keyword).

Get


Description: Retrieves the specified object property.
Syntax: IDL> property = xrt -> get( /timerange )
Keywords: /timerange, /obs, /ut, /header, /(any plot_map keyword).

/obs: Returns the FITS file id string.
/ut: Returns the FITS file's time stamp string.
/header: Returns a string array containing the entire FITS header.

Getdata


Description: Retrieves an array containing all of the data contained in the XRT object.
Syntax: IDL> data = xrt -> getdata( filelist=filelist )
Keywords: timerange, filelist.

Getmap


Description: Retrieves an array of all of the data contained in the XRT object in the form of MAP structures.
Syntax: IDL> maparray = xrt -> getmap( headers, filenames, filelist=filelist )
Outputs: headers, filenames
Keywords: timerange, filelist.

headers: An array of all of the headers of the data contained in the XRT object.
filenames: An array of the file names of all of the data contained in the XRT object.

RestorePlot


Description: Restore plots to default settings.
Syntax: IDL> xrt -> restoreplot

Multiplot


Description: Plots multiple images in a single window.
Syntax: IDL> xrt -> multiplot, timerange=timerange
Keywords: pmulti, same as plot.

pmulti: An array with the same form as that which would be specified for !P.multi=[position,columns,rows].





Contact:
Peter Gallagher
Email: peter.gallagher {at} tcd {dot} ie

Paul Higgins
Email: era_azrael {at} msn {dot} com