Using visibility objects in the RHESSI software Last update: 2007-07-06 4:35 PM
This memo assumes that you have an understanding of the command-line level of the IDL RHESSI software.
1. A first example: images using visibilites
To make images on the basis of visibilities, you just have to specify one of the two visibility-based imaging algorithms available, mem_njit or vis_fwdfit. Thus
o = hsi_image()
; set the observing time interval
o->set, im_time_int = '2002/02/20 ' + ['11:05', '11:15']
o->set, energy_band = [10,20]
o->set, image_alg = 'njit'
o->plot
will plot an image of the 20th February 2002 flare using the MEM NJIT image algorithm.
o->set, image_alg = 'vis_fwdfit'
o->plot
will plot an image of the same flare using the visibility forward fit agorithm.
In the background, these two algorithms turn off the annular sector engine, switch on the visibility engine, create visibilities from the telemetry data and apply one of the two visibility algorithms to generate the image.
These methods can also be applied to create image cubes:
o = hsi_image( im_time_int = '2002/02/20 ' + ['11:06', '11:08', '11:10'], $
energy_band = [6,12,25], image_alg = 'vis_fwdfit', pixel_size = 1 )
o->panel_display
2. Visibility files
Visibilities can be stored in files. This has the advantage of not having to get back to the telemetry data for generating new images based on the same time/energy intervals. Thus you can generate and store a bag of visibility for a whole set of time and energy intervals, and use them in (visibiility) imaging algorithms. Furthermore, the visibilities can be later edited to remove undesired effects.
To store the visibilities in a file, set the vis_out parameter to a file name
o->set, vis_out = 'yourvisfile.fits'
now the file will be written as soon as a new getdata() command is issued (thus reprocessing the whole bag of visibilities).
To use the visibility file, use it with the parameter vis_filename instead of specifying the image parameters:
o = hsi_image( vis_file = 'yourvisfile.fits' )
o->set, image_alg = 'njit'
o->panel_display
You need to set the imaging algorithm you want to use. You can set any imaging algorithm. However, if you set an algorithm that is not visibility-based, the image generator will swicth to the annular sector method and access the telemetry packets.
An alternative way to write visibility files is to retrieve the visibility object and generate the file using the write command:
oo = o->get( class = 'hsi_visibility', /object_reference )
oo->write, vis_out = 'yourvisfile.fits'
also creates a file containing the visibilities.
Note that the visibility FITS file stores also the values of the control and info parameters. Although these parameters would not be necessary to generate images, they are needed by the software for consistency. Aa a side effect,the software can reuse these values to generate images using other algorithms (getting back to the telemetry files).
The visibility object can be used independently of the imaging software.
oo = hsi_visibility( )
The visibility object can also be accessed from the image object, as has been shown earlier.
Parameters accepted by this objects are all those of the calibrated event list and below, plus those specific to the visibility object.
oo->set, vis_time_int = '20-feb-02 11:' + ['06:00', '06:21', '06:31']
oo->set, im_energy_binning=[6,12, 25]
Note that here vis_time_int is used to specify time intervals instead of im_time_int with the imaging software.
Visibility bags can be retrieved by individual time intervals and energy intervals
vis1 = oo->getdata( tb_index = 0, eb_index = 0 )
help, vis1, /str
** Structure <85a090c>, 11 tags, length=64, data length=64, refs=2:
ISC INT 3
HARM INT 1
ERANGE FLOAT Array[2]
TRANGE DOUBLE Array[2]
U FLOAT 0.0424057
V FLOAT 0.00205242
OBSVIS COMPLEX ( 2817.70, 739.822)
TOTFLUX FLOAT 6687.36
SIGAMP FLOAT 521.994
CHI2 FLOAT 1.11308
XYOFFSET FLOAT Array[2]
IDL>
plot, vis1.u, vis1.v, psym = 2, color = bytscl( vis1.totflux )
Note that this will generate visibilities for both energy intervals ([6,12] and [12, 25]), but it will pass back in vis1 only those associated with the first energy interval.
vis2= oo->getdata( tb_index = 0, eb_index = 1 )
The line above will now execute very fast because the visibilities for the second energy interval are already generated.
vis3= oo->getdata( tb_index = 1, eb_index = 0 )
The line above will take now more time to execute as it will generate all visibilities for the second time interval.
You can also get all visibilities at the same time, in a single bag. For this you need to change the mode used to get them:
o->set, vis_get_mode = 1
all_vis = o->getdata()
In the former example, vis_get_mode was set to 0 (the default). To get all visibilities for a specific time interval, use vis_get_mode = 2:
o->set, vis_get_mode = 2
all_vis = o->getdata( tb_index = 1)
To get all visibilities for a specific energy interval, use vis_get_mode = 3:
o->set, vis_get_mode = 3
all_vis = o->getdata( eb_index = 1)
To keep outliers, set vis_edit to a nonzero value:
o->set, vis_edit = 1
The default is to remove outliers.
To combine visibilities, set vis_combine to a nonzero value:
o->set, vis_combine = 1
---
André Csillaghy andre.csillaghy@fhnw.ch