Purpose:
This package contains C and f95 routines for calculation of the analysis of variance 
(aov) periodograms for ordinary purposes and for planetary transit search and for 
ordinary period search. The software is copyrighted and free for distribution in unmodified
form.

(C) Alex Schwarzenberg-Czerny, 2003, 2005 alex@camk.edu.pl


Methods:
The period search routines 'aov' and 'aovw' are based on the state-of-art
analysis of variance method involving phase folding and binning. Attention was
paid to statistical correctness of the method and to proper handling of incomplete
phase coverage. The method is described in the enclosed manuscript mnras241_153.pdf, 
MNRAS 241, 153, to be quoted in any resulting publications.

Similarly, the transit search routines 'aovtr' and 'aovtrw' are designed for
high sensitivity search of narrow periodic maxima in otherwise constant data. 
This corresponds to search for the planetary transitis in the light curves
expressed in the stellar magnitude units. The routines are based on the new,
state-of-art statistical method described in the enclosed manuscript 0509833.pdf, 
MNRAS in print (astro-ph/0509833). This reference is to be quoted in any resulting 
publications.

Files:
NOTE: because of different conventions in MSWindows and Unix, check
whether line ends are consistent with your system ond use standard
tools for line ends conversion, if necessary.

AlexAov.c (or AlexAov.f90) - contain periodogram routines
and SHOULD NOT be tampered with. These routines are 
copyrighted software free for distribution. 

AlexConst.h (or AlexConst.f90) -contain required definitions
AlexSort.c (or AlexSort.f90) -contain sort routines
AlexTest0.c(.f90) -a test program 
Note, that in some applications it may be wise to define TIME 
as quadruple floating accuracy, if supported by your compiler. 

Compilation: 

Compile/run these files with 
gcc -o aov *.c -lm 
./aov
or 
f95 -o aov *.f90
or similar commands

Usage:

The original test in AlexTest0 is unrealistic and serves merely to demonstrate 
numerical correctness by obtaining identical 
results from both routines for nh=2 bins and ncov=1 coverage. 
Note, that these tests may depend on performance of the sortx routine.
Because of different traetment of +0 and -0 on different hardware/compilers,
it is sometimes possible to obtain different results from the same code on different
machines. The differences are caused by different bin boundaries, and they are within 
statistical uncertainity for any binning method. Still, lines printed on the same 
machine should be as close as rounding error permits.

For any realistic planetary transit search use 'aovtr'/'aovtrw' 
for e.g. nh=30 and ncov=2 to get superior sensitivity compared to
the plain 'aov'. Please quote Schwarzenberg-Czerny & Beaulieu, 2005,
MNRAS in print, (astro-ph/0509833), in any resulting publications. 
Note that in realistic applications it may be wise to remove any low-frequency
trend, e.g. due to differences in calibration and/or zero point of observations.

Note that since v.1.15 periodogram values for 0 frequency provide meaningful test
of variability in time without explicit reference to frequency. In this case
the effective frequency for peak sensitivity is NH/DT, where DT is time span of observations.
The test is also sensitive to lower frequencies.


Update/Status:

(v.1.01) -A nasty bug manifesting intermittently was corrected in sav=aver[0]/nct[0];
C routines testd extensivly on real and simulated data
(v.1.1) -(i)Additional routines provided for analysis of weighted observations.
The calling sequence of all routines was modified to account weights in order 
to preserve consistency with the weight routines. Note that in the original
routines the weight parameter is ignored and may be of size 1. Caution: the new routines
were subject to rudimentary tests only, just checking that for unit weights
both give the same result.
-(ii) the whole package is available both in C and f95. Caution: the new f95 routines
were subject to rudimentary tests only, just checking that C and f95 code yield
results consistent within (low) machine precision.
(v.1.15) -The default sort method is now merge sort (sortx_m), stable against permutation 
of equal elements. This change yields meaningful periodogram values for 0 frequency 
and for other poor phase coverage situations. 
 
