|
|
|
Rebinning Functions
- sitar_lbin_cpd( f, psda, psdb, cpd, dff, [noisea, noiseb, &rev] );
Logarithmically rebin two Power Spectral Densities (and, optionally, their associated Poisson,
noise levels) and the associated Cross Power Spectral Density
Run as: isis> (af_lo,af_hi,apsda,apsdb,acpd,nf,[anoisea,anoiseb]) =
sitar_lbin_cpd(f,psda,psdb,cpd,dff,[noisea,noiseb,&rev]);
Variables in [] are optional, but are order specific.
Variables omitted take on default values.
Inputs:
-
f : Array of Fourier frequencies
-
psda/b : Arrays of PSD values
-
cpd : Array of Cross Power Spectral Density
-
dff : Delta f/f value for logarithmic bin spacing
Optional Inputs:
-
noisea/b : Array (*or single value*) of
Poisson noise levels
-
rev : If declared (i.e., `isis> variable rev;') and input,
returns the reverse indices for the binning
Outputs:
-
af_lo/af_hi : Lower/Upper bounds of Fourier frequency bins
-
apsda/b : Rebinned Power Spectral Density values
-
acpd : Rebinned Cross Power Spectral Density
-
nf : Number of frequencies going into the bin
Optional Outputs:
-
anoisea/b : Rebinned noise level (array, even for single value input)
- sitar_lbin_psd( f, psd, dff, [noise, &rev] );
Logarithmically rebin a Power Spectral Density (and, optionally, its associated Poisson noise)
Run as: isis> (af_lo,af_hi,apsd,nf,[anoise]) = sitar_lbin_psd(f,psd,dff,[noise, &rev]);
Variables in [] are optional, but are order specific.
Variables omitted take on default values.
Inputs:
-
f : Array of Fourier frequencies
-
psd : Array of PSD values
-
dff : Delta f/f value for logarithmic bin spacing
Optional Inputs:
-
noise : Array (*or single value*) of
Poisson noise levels
-
rev : If declared (i.e., `isis> variable rev;') and input,
returns the reverse indices for the binning
Outputs:
-
af_lo/af_hi : Lower/Upper Bounds of Fourier frequency bins
-
apsd : Rebinned Power Spectral Density values
-
nf : Number of frequencies going into the bin
Optional Outputs:
-
anoise : Rebinned noise level (array, even for single value input)
- sitar_rebin_rate( t, dt, rate [, err] [; tstart=#, tstop=#, minbin=#, user_bin=array, weight] )
Rebin a rate lightcurve (i.e., good time intervals,
effective areas, etc., assumed applied) to a new time grid.
Run as: isis> lc = sitar_rebin_rate(t, dt, rate, err; tstart=#, tstop=#, minbin=#,weight);
Variables in [] are optional (or are optional qualifiers, after the semi-colon).
Omitted variables take on default values.
Inputs:
-
t : Discrete times at which rates are measured
-
dt : Width of evenly spaced time bins
-
rate : (Presumed GTI & Exposure Corrected) rates
Optional Input:
Optional Qualifier Inputs:
-
tstart : Beginning of first time bin
(Defaults to time of first event -1)
-
tstop : End of last time bin
(Defaults to time of last event+1)
-
minbin : Minimum required events per bin, else the
bin is set to 0, or ignored. Default=1.
-
user_bin_lo : Lower time bounds for a user defined binning grid
-
user_bin_hi : Upper time bounds for a user defined binning grid
Overrides dt, tstart, and tstop inputs
-
delgap : If set, delete empty bins from the lightcurve,
otherwise, set them to 0 (default)
-
weight : If set and err input, the mean is weighted by
the error. I.e., mean = (\sum rate/err^2)/(\sum 1/err^2),
and the output variance becomes
(\sum (mean-rate/err^2)^2)/(\sum 1/err^2)^2
Outputs:
-
lc.rate : Mean rate of resulting rebinning
-
lc.bin_lo : Lower time bounds of rebinned lightcurve
-
lc.bin_hi : Upper time bounds of rebinned lightcurve
-
lc.num : Number of events going into a bin
-
lc.var : Variance of the rate in a time bin. ** Only
calculated where lc.num >= 2 **, otherwise
set to zero.
Optional Outputs:
-
lc.err : Rate errors combined in quadrature, i.e., it's
sqrt{\sum{err^2}}/N, where N is the number of points in a
given bin. Only calculate if err is input [otherwise, just
use sqrt(lc.var)].
|