To all RHESSI sswidl software users:

A large number of new routines were placed in the atest directory on Sept 10.
These routines address three of the changes I promised to make at the Glasgow
meeting.  The first is for decimation; the second is for pileup; and the third
is to actively use the flare position, xyoffset, both for imaging and
spectroscopy.  With these modules the software now includes first-order
corrections for all effects for RHESSI observations of solar flare X-rays.

The hessi GUI has been modified to include buttons for the main features
described below.

If you find that these routines cannot be used successfully and you need to use
the previous versions of these routines without these corrections you'll need to
remove the atest directory from your path when you enter sswidl.  The atest
directory was cleared of all other routines before this upload.  Remove atest
from your path with this command:

IDL> remove_path, 'atest'


These routines by default will correct for front segment decimation in  the
spectrum, lightcurve, and image objects. Narrower energy bins through the
decimation energies (typically 10-30 keV) work better. By default
DECIMATION_CORRECT is enabled. Set it to 0 to disable. Changes to this parameter
cause reprocessing of the spectrogram classes on calls to getdata(). The
decimation correction factors are applied to the livetimes as a function of
energy channel, time bin, and detector/segment.  Decimation doesn't work with
channel binning at this time.  One of the results of this is the expansion of
the livetime to have the same number of bins as the spectrum.

One control parameter, DECIM_APAR, determines the spectrum used for
interpolation over energy bands when the decimation energy falls in between
edges. Specifically it is a vector with the parameters used in f_vth_bpow to
construct a spectral shape of a typical photon spectrum.  You shouldn't need to
change it because the dominant effect is the shape of the low energy cutoffs
from the attenuators or detector windows and blankets. I've added an info
parameter, DECIM_TABLE. It's a structure that gives you details about the
decimation correction times, channel, weight, energy, and fractional correction
at the energy bin where the weighting crosses from the decimation value back to


Pileup corrections are implemented for spectrum and lightcurve only at this
time. By default, PILEUP_CORRECT is disabled. Set it to 1 to enable. Works on
all frontside spectra with livetime counter values less than PILEUP_THRESHOLD
(0.95). Changing PILEUP_CORRECT will only cause reprocessing of the pileup
correction not the whole spectrogram. Same holds for PILEUP_THRESHOLD,
PILEUP_MODAMP (9 number array of typical values), PILEUP_TWEAK (1.0).  This is
the version of pileup correction that we have used since last December in the
analysis of the 23 July 2002 event.  The pileup correction algorithm uses
convolution and so is computationally intensive and slow at this time.  It
should be used only when you want higher quality spectral fits using SPEX. The
pileup correction algorithm is not sufficient to allow high quality analysis
during the one minute count rate peaks that occur as the attenuator is blinked


XYOFFSET is now automatically retrieved by default from the flarelist for the
image object (really in calib_eventlist).  For users of the RHESSI GUI that was
always the default behavior (although the positions were not in the flarelist
until recently), but not for command line implementations.  XYOFFSET can still
be set from the GUI and CLI (command line interface), and once that's done for
an object the flarelist won't be consulted.  Set USE_FLARE_XYOFFSET to 1 to
restore the original behavior.  XYOFFSET is used in two places.  The first is
familiar as the center of the imaging Field of View.  The other use is new and
is used to construct the best grid response as a function of energy.  XYOFFSET
is needed to determine OFFAX_POSITION within the response constructor,
hessi_build_srm. Offax_position now is propagated to the srm builder. This is
the average distance from the flare to the imaging axis. For this the software
needs to determine the xyoffset, ie. the flare position on the Sun from either
the flarelist or from user input.  Examine USED_XYOFFSET or XYOFFSET to see the
value used after the object processes on getdata(). For spectrum and lightcurve
objects, use obj->getxyoffset() to see the value that will be used.  For image
objects, use obj -> get(/xyoffset)  to see the value that will be used.
OFFAX_POSITION is used by the SRM builder, hessi_build_srm, and it needs
xyoffset and a minimal aspect solution. For the moment, it runs the aspect
solution software (object) over the time range of interest. In the future I hope
we can take better advantage of the summary database since only a minimal aspect
solution is needed for this value.

NB:  once you set XYOFFSET directly (in the GUI or from the command line via
obj->set,xyoffset=[x,y]) the USE_FLARE_XYOFFSET  flag is turned off and will
stay off until you turn it on again.  Even if you start working on a different
flare time interval.


There had been a restriction on narrow bins (<2.1 keV) above 2.75 MeV.  That
restriction is no longer necessary and has been removed.

There is a new version of because a keyword in hsi_psf__define
has been changed from /SUM to /SUM_PSF.  Sam K should take note that this is now
the baseline version.

The eventlist packet buffer size has been changed so that it is now uniformly
5000 packets.  This value is in should you need to
lower it back to 1000 packets.  Because we allow accumulations over an unlimited
number of events, we have to cycle through groups of packets that are held in
memory along with their extracted eventlists.  For cpu's with larger memories
(we guessed the approximate size based on os type and number of cpu's), we had
buffers of 5000 packets (about 1,250,000 events) and buffers of 1000 packets for
smaller memories.  Because of the datagap problem, I had to take care of more
issues than I would have liked at the buffer boundaries, some apparently aren't
done correctly because differences have been noted between machines with
different packet sizes. It's on my list to track these things down.  A bigger
packet size reduces the numbers of these boundaries and should be better.  I don
't recommend increasing this value beyond 5000 for now.



DECIMATION_CORRECT  - (control) Default is 1.  Switch to enable decimation
DECIM_APAR - (control) Defines spectrum used for interpolation over energy bands
when necessary
DECIM_TABLE - (info) Structure with various information about the decimation
PILEUP_CORRECT - (control) Default is 0.Switch to enable pileup correction.
PILEUP_THRESHOLD - (control) Default is .95. If livetime counter is less than
this, pileup correction will be done.
PILEUP_MODAMP - (control) Correction factor for pileup (for experts)
PILEUP_TWEAK - (control)  Default is 1. Controls intensity of pileup correction.
USE_FLARE_XYOFFSET - (control) Default is 1.  Switch to control whether xyoffset
is retrieved from the flare list.  If you set XYOFFSET manually, this switch is
set to 0.
USED_XYOFFSET -  value of xyoffset used in last getdata() for calib_eventlist
as run by image.
OFFAX_POSITION - (control) Distance from flare to imaging axis. Set internally.


getxyoffset to see the value of XYOFFSET that will be used.  This is a method
for the spectrum, spectrogram and binned_eventlist objects.

As always, please let us know if you encounter problems.

Richard and Kim