NAME:
	fourpdm
 PURPOSE: (one line)
	Period search by Fourier fit dispersion minimization ($\chi^2$ based).
 DESCRIPTION:
	This routine is based on computing the Theta statistic for period searching
	in time-series data using the technique described by Stellingwerf,
	ApJ, 224, pp. 953-960 (1978).

  Instead of looking to minimize the per-bin scatter, this version
    attempts a fourier series fit to the data phased with each trial
    period.  The chisq of the fit is used instead of theta.
    Be careful to avoid using a series order that is too high.

 CATEGORY:
  Photometry
 CALLING SEQUENCE:
	fourpdm,t,x,sigx0,freq1,freq2,dfreq,freq,period,chisq
 INPUTS:
	t     - independent variable (usually time)
	x0    - dependent variable (usually magnitude or intensity)
	sigx0 - Uncertainty on x.
	freq1 - Lower limit to frequency to compute statistic  (units=[1/t])
	freq2 - Upper limit to frequency to compute statistic  (units=[1/t])
             if freq2