

Epoch Folding Functions
The epoch folding function implements the Lstatistic, as described by
Davies (1990, MNRAS, vol. 244, pp. 9395).
 sitar_epfold_rate( t, rate [, pstart, pstop] [; nphs=#, nsrch=#, loggrid, prds=array] )
Epoch fold a rate lightcurve for a range of trial periods, and return the statistical
value of the period.
Run as: isis> fold = sitar_epfold_rate(t,rate,pstart,pstop;nphs=#,nsrch=#,prds=array);
Variables in [] are optional (qualifiers after the semicolon).
Omitted variables take on default values.
Inputs:

t : Times at which rates are measured

rate : Lightcurve rate

pstart : Starting value of periods to search

pstop : Stopping value of periods to search
(Semi)Optional Inputs (required if qualifier prds=array not set):

pstart : Starting value of periods to search

pstop : Stopping value of periods to search
Optional Qualifier Inputs:

nphs : Number of phase bins in folded lightcurve
Default = 20, minimum = 2 (unless prds is set)

nsrch : abs(nsrch) = number of periods to search.

loggrid : If input, the period search grid is logarithmic.

prds : Alternative array of periods to search
Outputs:

fold.prds : Array of trial periods

fold.lstat : Array of Lstatistic for trial period

fold.lsig : Array of log10 of *single trial* significance levels.
Note: This requires use of the GNU Scientific Library package from the SLang Modules Packages.
Otherwise, the array defaults to a value of 1.

fold.nphs : Array of number of phases (<= nphs) at a given period that had data.
