[Previous]
[Next]
PROJECT:
HESSI
NAME:
LIGHTCURVE CLASS DEFINITION
PURPOSE:
Provides access to HESSI Lightcurves. This class is based
(i.e, extends) the spectrogram class.
CATEGORY:
Lightcurve (hessi/idl/util)
CONSTRUCTION:
obj = Obj_New( 'hsi_lightcurve' )
obj = HSI_Lightcurve()
CONTROL PARAMETERS DEFINED IN THIS CLASS:
ltc_energy_band: energy band for each light curve, in
kev. Default: [3, 15000]
ltc_time_range: the time range of the light curve. It is a
2-element vector. If the time_range is larger
than 1e6, then it is considered to be an anytim
time (see anytim()). If it is less than 1e6, it
is considered to be seconds relative to either
obs_time_interval (if this is set), otherwise
it is relative to the start of the file
(file_time_range[0]) or to the start of the
simulation (sim_ut_ref + sim_time_range[0]).
ltc_time_resolution: resolution of the time bins in
seconds. Default: 0.1 sec
see hsi_lightcurve_control__define
Control parameters from hsi_spectrogram_control__define are
also inherited by this class.
INFO PARAMETERS DEFINED IN THIS CLASS:
no info prameters yet.
METHODS DEFINED IN THIS CLASS
INIT: usual stuff
Control2Binning: given the lightcurve control parameters,
construct the structure "binning" that is
eventually passed to hsi_eventlist2spectrogra
Process_Hook_Pre: the hook called by hsi_spectrogram::process
prior the spectrogram is processed. This
sets the correct values of the contorl
parameter binning according to the ltc_xxx
control parameters
GetAxis: allows getting x and y axes. Keywords: XAXIS, YAXIS,
XTITLE, YTITLE )
GetData: Gets the primary data. Keyword: THIS_SUM
CLASS RELATIONSHIPS
HSI_Spectrogram, Framework: parent class
HSI_Eventlist: source class
KEYWORDS:
EXAMPLES:
Start by creating an instance of the class:
o = HSI_Lightcurve()
Then:
o->Plot, OBS_TIME_INTERVAL = ['2000/09/01 12:00', '2000/09/01
18:00'], LTC_TIME_RESOLUTION = 1
will plot an integrated light curve for that time interval
with a 1 sec. resolution
ltc = o->GetData( TIME_RANGE=[0,60], LTC_ENERGY_BAND = [3,100,500,
1000, 15000] )
will return a 2-d array with time in the first dimension,
energy bands in the second dimension. The time range of the
lightcurve corresponds to the first 60 seconds in the file
ltc = o->GetData( SUM_FLAG = 0 )
will return the same as above, but for each individual a2d set in
a2d_index_mask for each a2d and for each energy band
defined in ltc_energy_band.
Retrieving the axes of the lightcurve spectrogram
To Return the values of the time axis of the lightcurve array
as a 1xN array of the edges of the bins referenced to 1-jan-1979
UT = o->GetAxis( /UT )
To Return the values of the edges of the energy axis as a 1xN array in keV
Energy = o->GetAxis( /ENERGY )
To retrieve either at the midpoints: e.g. Energy_midpoints = o->GetAxis(/mean,/ENERGY)
The call to GETAXIS takes the same keywords as found in get_edges()
ltc = o->GetData( THIS_DET = [1,2] )
returns in ltc the lightcurves for detectors # 1 and 2 only.
ltc = o->GetData( THIS_SEG = [1,10] )
returns in ltc the lightcurves for segments # 1 and 10 only
ltc = o->GetData( THIS_A2D_INDEX = [1, 10, 13, 14, 26] )
returns in ltc the lightcurves for a2d indices 1,10,13,14,26
ltc = o->GetData( /COINCIDENCE )
returns a 4-dim array where the 4th dimension contains the
anti-coincident lightcurve (index #0) and the coincident
lightcurve (index #1)
ltc =o->GetData( /COINCID, OTHER_A2D_INDEX =
[0,0,0,1,1,1,1,bytarr(27-7) ] )
returns a 4-dim array where the 4th dim has 5 indices, the
first is the anti-coincident lighcturve, the second is the
coincident lightcurve with a2d # 3, the third with a2d #4, etc.
CALLS: ***
HSI_EVENTLIST, HSI_LIGHTCURVE::GETAXIS, HSI_LIGHTCURVE::GETDATA
HSI_LIGHTCURVE::INIT, HSI_LIGHTCURVE::PROCESS_HOOK_POST, HSI_LIGHTCURVE::SET
HSI_LIGHTCURVE_CONTROL, HSI_LIGHTCURVE__DEFINE, SINCE_VERSION [1]
SINCE_VERSION [2], hsi_is_obj_nested, prstr [1], prstr [2]
SEE ALSO:
http://hessi.ssl.berkeley.edu/software/reference.html#hsi_lightcurve
HSI_LIGHTCURVE_CONTROL__DEFINE [1], HSI_LIGHTCURVE_CONTROL__DEFINE [2]
HSI_SPECTRUM__DEFINE, hsi_lightcurve_info__define
hsi_spectrogram__define [1], hsi_spectrogram__define [2]
hsi_spectrogram__define [3]
HISTORY:
Dev for release 6, use hsi_spectrum instead of hsi_spectrogram
Dev for release 5.1: use of the abstract class hsi_spectrogram
Dev. for Release 4, December 1999
A Csillaghy, csillag@ssl.berkeley.edu
1-apr-02, ras, added UT and ENERGY keywords for getaxis
17-may-02, ras, in Group, used long64 on time bin
in control2binning
10-Jun-02, Kim. In Getdata, if not hsi_use_sim, using hsi_eventlist_packet, and no file, then error
25-Jul-2002, Kim. Call heap_gc (if >= 5.5) in getdata method to prevent memory leaks
24-Oct-2002, Kim. Added @hsi_insert_catch in getdata, and commented out some extra checks
for when no files are available - catch will handle it now.
ras, 11-oct-02, c2b_param saves control parameters relevant
to control2binning
ras, 19-nov-02, remove nasty side effects of c2b_param
setting of multiply-named parameters done in set
ltc_time_range has same type as time_range to avoid nasty
continuation of need_update
17-mar-2006, ras, remove control2binning in favor of hsi_spectrum
[Previous]
[Next]
PURPOSE:
Returns the -2*log(probablility) vector of a modulation profile
f_model (the SkyVector) given the observed profile f_obs.
Designed for the low-photon limit where fobs is mostly 0's
and 1's. Normalized to the maximum when fobs=fix(fmodel).
TOTAL( probSkyVector ) is
0.5 * chisquared
if abs(fobs-f_model) << fmodel
Webster Cash, ApJ 228, 939, 1979
INPUTS:
f_obs = structure containing INTEGER vectors of counts per interval
f_model = structure of modeled counts per s. Same size as f_obs.
f_model must be all positive, but f_obs can have many zeroes.
OPTIONAL INPUTS:
If epsilon is set, its (scalar) value will be used to redefine
all zeroes of f_obs. This is to improve the behavior of
reconstruction algorithms which fail at zeroes of f_obs.
OUTPUT:
A measure of the probability p that f_model and f_obs are
equal. To be meaningful, f_obs should be all integers and
and f_model > 0. But f_obs can be "near" integral if you like.
In the limit where abs(f_model-f_obs) << f_model
p = -0.5*chi^2 where
chi^2 = sum {(f_model-f_obs)^2/f_model)}
REVISION HISTORY:
NO checks for total(fobs)=total(fmodel) are made now (8.4.98)
Replaced alog(factorial(x)) with lngamma(x+1) (9.4.98)
Added option to
WARNING:
Using this program for large count rates is inefficient and
possibly inaccurate. Better to use 0.5*chisq.
[Previous]
[Next]
PROJECT:
HESSI
NAME:
Livetime_parameter_structure = HSI_LIVETIME_PARAMS()
PURPOSE:
This function returns livetime_params structure used to
simulate the HESSI livetime, csa rate, and oversize rate.
CATEGORY:
HESSI, UTIL
CALLING SEQUENCE:
CALLS:
none
INPUTS:
OPTIONAL INPUTS:
none
OUTPUTS:
OPTIONAL KEYWORD OUTPUTS:
KEYWORDS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Version 1, richard.schwartz@gsfc.nasa.gov
25-jan-1999.
[Previous]
[Next]
NAME:
local_max
CALLING SEQUENCE:
maxs = local_max(array,max_pts,range=range)
PURPOSE:
To find local maxima for a given array. For our purposes,
the range of a given maximum must be specified, i.e., if
there is a point within + or - range of greater than the
given point, then it isn't considered a local maximum.
INPUT:
array = an array
OUTPUT:
maxs = the values of array at the local maximum point.
max_pts = the subscripts of the maxima
KEYWORDS:
range = the range of the maximum, the given point is a
maximum from max_pt-range to max_pt+range. Default
is 10 pts.
CALLS: ***
local_min, temp_split_flare
CALLED BY:
local_min, temp_split_flare
HISTORY:
15-FEB-94, JMM
[Previous]
[Next]
NAME:
local_min
CALLING SEQUENCE:
mins = local_min(array,min_pts,range=range)
PURPOSE:
To find local minima for a given array. For our purposes,
the range of a given minimum must be specified, i.e., if
there is a point within + or - range of greater than the
given point, then it isn't considered a local minimum.
INPUT:
array = an array
OUTPUT:
mins = the values of array at the local minimum point.
min_pts = the subscripts of the minima
KEYWORDS:
range = the range of the minimum, the given point is a
minimum from min_pt-range to min_pt+range. Default
is 10 pts.
CALLS: ***
local_max, temp_split_flare
CALLED BY:
local_max, temp_split_flare
HISTORY:
15-FEB-94, JMM