Simulation Control Parameters

From RHESSI Wiki

(Difference between revisions)
Jump to: navigation, search
m
m (added category)
Line 166: Line 166:
* [http://sprg.ssl.berkeley.edu/~jimm/hessi/hessi_simulation_control.html  HESSI SIMULATION CONTROL PARAMETERS]
* [http://sprg.ssl.berkeley.edu/~jimm/hessi/hessi_simulation_control.html  HESSI SIMULATION CONTROL PARAMETERS]
* [http://sprg.ssl.berkeley.edu/~jimm/hessi/hessi_simulation_control_old.html Original HESSI SIMULATION Control Parameters]
* [http://sprg.ssl.berkeley.edu/~jimm/hessi/hessi_simulation_control_old.html Original HESSI SIMULATION Control Parameters]
 +
 +
[[Category:Software]]

Revision as of 21:37, 5 November 2008

These are control parameters that can be used as keywords in calls to the image object, or eventlist or lightcurve objects. Note that some of the names have been changed, but that the control parameters defined in the original simulation control document should still work as before.

Contents

Time parameters

sim_ut_ref

sim_ut_ref is the reference time for the simulation, this is usually the start time. Can be in any ANYTIM format. The default is '21-jun-2001 00:00'. E.g., a call like this initializes the object and sets the sim_ut_ref.

IDL> o = hsi_image(sim_ut_ref = '22-may-2003 04:17:20')

sim_time_range

sim_time_range is the time range, in seconds, relative to the reference time sim_ut_ref for the simulation. Note that sim_time_range is not required if a time array is passed in via the sim_photon_times control parameter.. E.g.,

IDL> o -> set, sim_time_range = [0.0, 30.0]

sim_photon_times

sim_photon_times is a time array for the input photon flux. This is needed if sim_photon_flux is a 2d (n_energies, ntimes) or 3d (n_energies, ntimes, n_sources) array, or if sim_spec_pars is a 2 or 3d array. This is defined relative to the reference time that was passed in. E.g.,

IDL> spec_pars = fltarr(6, 31) ;fill with your favorite spectral parameters IDL> photon_times = indgen(31) ;number of times must match IDL> o -> set, sim_spec_pars = spec_pars, sim_photon_times = photon_times

Spectral Parameters

sim_photons_per_coll

sim_photons_per_coll, a floating point number, is used to control the overall flux level of the simulated data. The units are in photons per second per collimator incident on the spacecraft, with a default value of 10000. Originally, sim_photons_per_coll referred to photon counts, after the energy response matrix of the given detector was accounted for, now this number refers to the total photon flux incident before taking the detector response into account. This means that there are fewer counts registered in the new version for the same value of sim_photons_per_coll. This is a scalar. This parameter is ignored if sim_use_spectrum is set. Note that this is the total value of photons per detector, if there are multple sources in the image (see sim_model ) then the counts are divided up between the sources, photons_per_source=sim_photons_per_coll*model.amplitude/total(model.amplitude)

If no control parameters are set, then then simulation will run using sim_photons_per_coll = 1.0e4, as has been the case since the beginning of time. Note also that if a spectral shape is available, from the sim_spec_pars, or sim_photon_flux parameters, then this spectral shape is used to do the simulation. E.g.,

o = obj_new('hsi_eventlist') o -> set, sim_photons_per_coll = 1.0e5

sim_use_spectrum

If sim_use_spectrum is set, then use an input spectrum or spectral model to create the simulations. (As opposed to the original, but still popular, method of specifying sim_photons_per_coll). If this is set, then the spec_model, spec_pars keywords, or the photon_flux and photon_energy keywords must be used. E.g.,

o -> set, /sim_use_spectrum

(Note, if this is set, but no spectrum is passed in via sim_spec_pars or sim_photon_flux, something crazy may happen.) sim_spec_model

sim_spec_model is the spectral model, the default is 'f_bpow', a double power law spectrum. These models are defined for the spectroscopy routines used by the XRAY package. The XRAY package must be part of your local SSW tree. E.g.,

o -> set, sim_spec_model = 'f_vth_bpow' ;the famous thermal + broken PL

sim_spec_pars

sim_spec_pars are spectral parameters for the given model, usually a fltarr[6] or fltarr[8]. As for the case of sim_photon_flux, the spectrum is used if /sim_use_spectrum is set. If /sim_use_spectrum is not set, then only the shape of the spectrum is used. Sim_spec_pars can be an array of (n_pars), (n_pars, ntimes); in which case sim_photon_times must be set, or an array of (n_pars, ntimes, n_sources). The default spectrum is a power law with spectral index of 3, spec_pars=[1, 3, 100, 3, 10, 1.5], with a low energy break at 10 keV. E.g.,

o -> set, sim_spec_model = 'f_vth_bpow' ;the famous thermal + broken PL o -> set, sim_spec_pars = [1.0, 12.0, 1, 3, 100, 3, 10, 1.5]

sim_photon_energy

sim_photon_energy is an array of photon energies for the input photon flux. This is required if sim_photon_flux is used. It will also be used for the case where sim_spec_pars is set. E.g.,

o -> set, sim_photon_energy = 3.0+1.0*indgen(98) ;3 to 100 keV

sim_photon_flux

sim_photon_flux is an array of photon flux in photons/cm^2/sec/keV. If this is set the sim_spec_pars and sim_spec_model keywords are ignored, but the photon_energy parameter must also be used. Note that photon flux arrays can be different for different sources, just pass in the array as (n_energies, n_times, n_sources) or (n_energies, 1, n_sources) if the spectral shape remains constant. As noted, the values in sim_photon_flux can be used to give the shape of the spectrum if the sim_photons_per_coll parameter is set. Sim_photon_flux is the total flux for all sources, unless a photon flux is specified for each source; if there are multple sources in the image (see sim_model ) then the flux is divided up between the sources; flux_per_source=sim_photon_flux*model.amplitude/total(model.amplitude) If a flux is specified for each source, then model.amplitude is not used.

sim_photon_tprofile

sim_photon_tprofile is a time profile that can be used when the shape of the input photon spectrum does not vary with time. E.g., if you want to have emission that keeps the same spectral shape but doubles over a 4 second interval, set

sim_photon_tprofile=[0.5, 1.0],sim_photon_times=[0.0,4.0], /sim_interp_tprofile.

Sim_photon_tprofile must have the same number of elements as sim_photon_times, and if you set sim_photon_tprofile, be sure that sim_photon_flux (or sim_spec_pars) is a 1D array, or an (n_energies, 1, n_sources) array. sim_interp_tprofile

The time profile for the simulation doesn't vary smoothly, there are steps. Sometimes it's convenient to only pass in a time profile with one or two intervals. For these cases, use sim_interp_tprofile to be sure that the count rate varies smoothly relative to the modulation. sim_interp_dt

sim_interp_dt is the time interval for the sim_interp_tprofile option. The default value is 1/128 seconds. Background parameters sim_just_background

If sim_just_background is set, only background counts are produced. No modulation by detector grids. sim_background

sim_background is a factor used to multiply the background spectrum given by HESSI_BACKGROUND. The default is 0, If set to 0 no background is used.

All of the spectral and time profile keywords are applicable to the background case with sim_bkgd_ instead of just sim_ . These are applied to the background spectrum in the same manner as to the photon spectrum except that background spectra are always interpreted as counts spectra and not flux spectra. So these are not integrated over the detector response. The parameters are: sim_bkgd_time_unit, sim_bkgd_ut_ref, sim_bkgd_time_range, sim_use_bkgd_spectrum, sim_bkgd_tprofile, sim_bkgd_photons_per_coll, sim_bkgd_photon_flux, sim_bkgd_photon_energy, sim_bkgd_photon_times, sim_bkgd_spec_model, sim_bkgd_spec_pars, sim_bkgd_interp_tprofile, and sim_bkgd_interp_dt. Detector response parameters You may pass in any srm object control parameter object as well as these.

sim_energy_band

sim_energy_band is the energy band for the simulation, the default is [6.0, 100.0] keV. (Previous versions allowed multiple energy bands, to allow for energy dependences in the grid responses; this is no longer necessary, since the energy of each photon can be passed into the routine hsi_modulate point source directly.)

sim_gain_generation

This is the gain_generation parameter passed into the routines for the detector responses. 1.

sim_gain_time_wanted

This is the gain_time_wanted parameter passed into the detector response routines.

sim_diagonal_srm

Set this to 1 to use a diagonal detector response matrix for the simulation.

sim_atten_state

sim_atten_state is the attenuator state, 0 = no attanuators, 1 = Thin in, thick out (default), 2 = thick in, thin out, 3 = both in. Aspect Solution parameters sim_true_aspect

If sim_true_aspect is set, then the aspect solution used for the simulation will be taken from the actual flight data. Otherwise the aspect solution is simulated. If /sim_true_aspect is set, do not use /aspect_sim in the hsi_image object used to analyse the data. sim_saszero

If sim_saszero is set, the aspect solution is constant, with pointing of [0, 0], and roll_period of 4 seconds.

Image Parameters

sim_model

sim_model can be used to pass in a structure (labelled gaussian_source_str) which specifies a 2d Gaussian source. The Gaussian is specified by its amplitude, x and y standard deviation (in arcseconds), its position relative to the center of the image (in arcseconds), and its tilt angle. The amplitude refers to the total photon flux from the source, not the peak value. The maximum value of amplitude is 1, if you want two sources of equal strength, set both amplitudes to 1.0.

The model also may be of the type {curved_gaussian_source_str}, which has a curvature value in addition to the above parameters. The model can also be given as an array with zeroes everywhere except at the location of point sources. The non zero values should be specified in normalized units, with a maximum of 1.0. The default model is a two-component gaussian source with equal amplitudes, and xy standard deviations of 0.001 arcesc, to simulate point sources.

It is also possible to pass in an image (npix, npix). If npix is odd, then the sim_xyoffset is interpreted to be at pixel [npix/2, npix/2]. If npix is even, then the xy_offset is interpreted to be at pixel [npix/2 - 1, npix/2 - 1]. So, for example, if you want a 1 pixel size source to be located at sim_xyoffset, and pass in a (64,64) image, then use the following:

model = fltarr(64,64) model[31,31] = 1.0

If you pass in a (65,65) image then use:

model = fltarr(65,65) model[32,32] = 1.0

sim_pixel_size

sim_pixel_size is used to set the size of the pixels when using a model image. The default sim_pixel_size is 2.0 arcseconds, which is different from the default imaging pixel_size. sim_xyoffset

sim_xyoffset

A 2 element floating point vector, is used to specify the center of the simulation box. Other Important Parameters sim_a2d_index_mask

sim_a2d_index_mask

is a 27 element byte array that controls which detector data is used in the simulation. A value of 1 indicates the detector will be used, and a value of 0 indicates that it will not. The first 9 elements refer to the front segments of detectors 1-9, the next 9 elements of the array refer to the low energy portion of the rear segments of detectors 1-9, and the last 9 elements refer to the high energy portion of the rear segments for detectors 1-9. sim_srt_filename

sim_srt_filename

denotes the grid response database file to use for simulations. The default is the latest version, $SSW/hessi/dbase/grid_resp/SRT_2*.dat. sim_seed

sim_seed

is the seed value for random number routines, set this to reproduce results.

sim_nbuff

sim_nbuff is the maximum number of photons that are processed at one time, the default value is 5.0e5, which results in a maximum memory usage of aboput 100 Mbytes. A larger value can be used if you have more memory.

Comments to: jimm@ssl.berkeley.edu

Originally created on 28-may-2003, jmm Imported by --Schriste 21:31, 5 November 2008 (UTC)

References

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox