This tutorial is intended for HESSI users who want to use the CLEAN method in the IDL SSW environment to reconstruct HESSI images. For basic information on image processing see tutorial written by Chris Johns-Krull ( http://hessi.ssl.berkeley.edu/~cmj/hessi/doc.html). Please, study first Chris Johns-Krull's tutorial.
How HSI_CLEAN works, can be be most easily explained by running the program.
Adapting terms from radio astronomy, we call the backprojection map the 'DIRTY MAP'. The dirty map is the map we want to clean.
let's set the image algorithm to HSI_CLEAN:
HSI_CLEAN has serval input parameters. the default values can be seen with
once image_algorithm has set, the clean parameters can be seen with
if image_algorithm was never set to 'clean',
the clean parameters are not set, i.e. there are -1
information about the clean parameters can also be found at
http://hesperia.gsfc.nasa.gov/ssw/hessi/doc/hsi_params_clean.htm
to save the clean parameters for a possible later use:
we will run HSI_CLEAN first for only one iteration (so that we can
see what is going on) with a relatively large gain of 0.3.
OK, now let's run HSI_CLEAN.
REMARK: if no keyword is changed, getdata will not run again. to force to rerun
the calculation use cleaned_map = o -> getdata(/force)
Since the SHOW_MAPS keyword is set, a window opens showing the progress of
clean (your simulation looks different, and the default parameters have too. sorry for that).
some more information about the displayed maps:
The dirty map, residual map (top), component map (top), and cleaned map are all shown with the same
scaling, whereas the residual map and component map shown in the bottom panels are each
scaled from minimum to maximum.
images are in polar coordinates
the units of the cleaned map are photons/subcollimator/pixel. so we can sum over the flare
area and get photons/subcollimator.
on the right, some information about the clean process are plotted. from top to bottom:
let's run some more iterations. We can set the keyword 'MORE_ITER'
to tell HSI_CLEAN to continue cleaning (so it starts with iteration 2, since iteration 1 is
already done). Additionally, we increase the number of
iterations, NITER, to 50:
HSI_CLEAN was now running for 7 iterations (could be different in
the simulation you are running). it stoped because the extremum in
the residual map is NEGATIVE, i.e. the residual map contains bigger negative
values ('noise') than positive values (signal). So it makes sense to stop
cleaning. However, we can still see that there is some remaining flux left.
the flare source can be still seen in the residual map.
we can now help clean by tell it where we expect the source to be. we are doing
that by defining so-called 'CLEAN BOXES' or 'CLEAN WINDOWS'.
if one knows the coordinates (arcseconds from solar center, o->plot,
makes a lot of the current images including the axis in arcsec from solar center), one can set clean boxes the following way
(if we want to run clean again from iteration 1, we additionally have to set back the
keyword MORE_ITER):
Or, much more convenient, one can set the keyword MARK_BOX. HSI_CLEAN then displays the
dirty map and a hopefully selfexplaining menu. an unlimited number
of clean boxes can be selected by coursor:
Clean was now running for 17 iterations. the residual map does not show
any remining flux within the clean boxes. we can even see that their
are larger maxima outside the clean boxes indicating that we have
maybe even cleaned a little bit too much.
the residual map gives us a measure for the quality of the
component map. it gives us error estimates to the component map.
the clean components for each iteration (pixel number (1dimensional), x-coordinate, y-coordinate, maximum)
for each iteration are saved in
play around with the following parameters:
o->set,sim_photon=5000.
the default value was 1000. HSI_CLEAN gives much nicer results for images with more photons. o->set,det_index_mask=[0,0,0,0,0,1,0,0,0]
if you use small grids only, change the pixel size too. psf = o ->GetData( CLASS_NAME = 'HSI_PSF', /SUM, xy_pixel=xy )
where xy is the 1 dimensional pixel coordinate, e.g. center pixel in 65*67 image
is 33*65+32=2177 (PSF is in polar coordinates). PSF at different location in the images are slightly
different. most of the calculation time in HSI_CLEAN is used to calcuated PSFs.
IDL> o -> set,image_algorithm='clean'
IDL> help, hsi_clean_parameters(),/str
IDL> o->print, /clean, /control
IDL> cp_flare1 = o->get( /clean, /control )
In the beginning, the following three input parameters are of main interested:
We can set these parameters with
IDL> o -> set,clean_niter=1
IDL> o -> set,clean_frac=0.3
IDL> o -> set,clean_show_maps=1
REMARK: print,o->get(/clean_niter) will show the value in
clean_niter. however, if image_alg is not set to 'clean'
the clean paramters cannot be seen. once clean was called,
it will work.
1. ITERATION
run HSI_CLEAN
IDL> cleaned_map = o -> getdata()
alternatively to using o->set, the input parameters
can also be given with cleaned_map = o -> getdata(image_alg='clean',clean_iter=33, ....) etc.
MORE ITERATIONS
IDL> o -> set,clean_more_iter=1
IDL> o -> set,clean_niter=50
IDL> cleaned_map = o -> getdata()
CLEAN WINDOWS
At the moment, only rectangular clean windows can be set (March 2001).
Clean windows can be set directly or by clicking with the mouse.
IDL> nbox=2
IDL> cb=fltarr(4,nbox)
IDL> cb(*,0)=[584.,183.,599.,199.]
IDL> cb(*,1)=[595.,195.,606.,207.]
IDL> o -> set,clean_box=cb
IDL> o -> set,clean_more_iter=0
IDL> cleaned_map = o -> getdata()
IDL> o -> set,clean_mark_box=1
IDL> o -> set,clean_more_iter=0
IDL> cleaned_map = o -> getdata()
HOW TO ACCESS THE DIFFERENT MAPS
all results of HSI_CLEAN (residual map, clean components, etc) can
be accessed with
IDL> help, o -> get(class_name='hsi_clean',/info),/str
all the maps are in polar coordinates.
IDL> print,o->get(class_name='hsi_clean',/info,/clean_components)
PLAY AROUND
QUESTIONS/COMMENTS/ETC. to Säm Krucker, krucker@ssl.berkeley.edu, 510 643 3101