java.lang.Object
org.aavso.tools.vstar.util.TSBase
org.aavso.tools.vstar.util.period.dcdft.TSDcDft
All Implemented Interfaces:
IAlgorithm, IInteruptible, IPeriodAnalysisAlgorithm

public class TSDcDft extends TSBase implements IPeriodAnalysisAlgorithm
This class computes a Date Compensated Discrete Fourier Transform over an observation list. This is a Java translation of Fortran code from ts1201.f by M. Templeton, which in turn is based upon BASIC code by G. Foster, AAVSO. References (supplied by M. Templeton):
  1. Ferraz-Mello, S., 1981, Estimation of Periods from Unequally Spaced Observations, Astron. Journal 86, 619 (http://adsabs.harvard.edu/abs/1981AJ.....86..619F)
  2. Foster, G., 1995, Time Series Analysis by Projection. II. Tensor Methods for Time Series Analysis, Astron. Journal 111, 555 (http://adsabs.harvard.edu/abs/1996AJ....111..555F)
  3. http://www.aavso.org/aavso/meetings/spring03present/templeton.shtml
  • Constructor Details

    • TSDcDft

      public TSDcDft(List<ValidObservation> observations)
      Constructor
      Parameters:
      observations - The observations over which to perform a period analysis.
    • TSDcDft

      public TSDcDft(List<ValidObservation> observations, DcDftAnalysisType analysisType)
      Constructor The analysis type is specified.
      Parameters:
      observations - The observations over which to perform a period analysis.
      analysisType - The type of analysis to be carried out: standard scan, frequency range, period range.
    • TSDcDft

      public TSDcDft(List<ValidObservation> observations, double loFreq, double hiFreq, double resolution)
      Constructor As per last constructor except that we override the parameter values and request a frequency range analysis type.
      Parameters:
      observations - The observations over which to perform a period analysis.
      loFreq - The low frequency value for the range to be scanned.
      hiFreq - The high frequency value for the range to be scanned.
      resolution - The resolution with which to scan over the range.
  • Method Details

    • interrupt

      public void interrupt()
      Description copied from interface: IInteruptible
      Signals that a task has been interrupted.
      Specified by:
      interrupt in interface IInteruptible
    • getLoFreqValue

      public double getLoFreqValue()
      Returns:
      the loFreqValue
    • setLoFreqValue

      public void setLoFreqValue(double loFreqValue)
      Parameters:
      loFreqValue - the loFreqValue to set
    • getHiFreqValue

      public double getHiFreqValue()
      Returns:
      the hiFreqValue
    • setHiFreqValue

      public void setHiFreqValue(double hiFreqValue)
      Parameters:
      hiFreqValue - the hiFreqValue to set
    • getLoPeriodValue

      public double getLoPeriodValue()
      Returns:
      the loPeriodValue
    • setLoPeriodValue

      public void setLoPeriodValue(double loPeriodValue)
      Parameters:
      loPeriodValue - the loPeriodValue to set
    • getHiPeriodValue

      public double getHiPeriodValue()
      Returns:
      the hiPeriodValue
    • setHiPeriodValue

      public void setHiPeriodValue(double hiPeriodValue)
      Parameters:
      hiPeriodValue - the hiPeriodValue to set
    • getResolutionValue

      public double getResolutionValue()
      Returns:
      the resolutionValue
    • setResolutionValue

      public void setResolutionValue(double resolutionValue)
      Parameters:
      resolutionValue - the resolutionValue to set
    • getAdjustedJDs

      public double[] getAdjustedJDs()
      Returns:
      the adjusted time vector.
    • getMags

      public double[] getMags()
      Returns:
      the magnitude vector.
    • getWeights

      public double[] getWeights()
      Returns:
      the weight vector.
    • getResultSeries

      public Map<PeriodAnalysisCoordinateType,List<Double>> getResultSeries()
      Description copied from interface: IPeriodAnalysisAlgorithm
      Return the result of the period analysis.
      Specified by:
      getResultSeries in interface IPeriodAnalysisAlgorithm
      Returns:
      the resultSeries
    • getTopHits

      Return the "top hits" from the period analysis. It is a precondition that results have been generated, i.e. the execute() method has been invoked.
      Specified by:
      getTopHits in interface IPeriodAnalysisAlgorithm
    • execute

      public void execute() throws AlgorithmError
      Perform a "standard scan" or "frequency range" based DC DFT, a date compensated discrete Fourier transform.
      Specified by:
      execute in interface IAlgorithm
      Throws:
      AlgorithmError - in case of an algorithm error.
    • refineByFrequency

      public List<PeriodAnalysisDataPoint> refineByFrequency(List<Double> freqs, List<Double> variablePeriods, List<Double> lockedPeriods) throws AlgorithmError, InterruptedException
      Description copied from interface: IPeriodAnalysisAlgorithm

      Refine the period analysis in some way that makes sense for the algorithm, e.g. for DC DFT, CLEANest.

      Note: This method is provisional. There are all kinds of meanings that could be applied to "refine", e.g. multi-period analysis (such as CLEANest).

      Specified by:
      refineByFrequency in interface IPeriodAnalysisAlgorithm
      Parameters:
      freqs - A list of frequencies on which to refine the results.
      Returns:
      the new top-hits created by this refinement.
      Throws:
      AlgorithmError
      InterruptedException
    • getRefineByFrequencyName

      public String getRefineByFrequencyName()
      Description copied from interface: IPeriodAnalysisAlgorithm
      Get the refine-by-frequency algorithm name.
      Specified by:
      getRefineByFrequencyName in interface IPeriodAnalysisAlgorithm
      Returns:
      The name of the refine-by-frequency algorithm, or null if none.
    • dcdftCommon

      protected void dcdftCommon()
    • determineDefaultParameters

      public void determineDefaultParameters()
    • dcdft

      protected void dcdft() throws InterruptedException
      Throws:
      InterruptedException
    • standard_scan

      protected void standard_scan() throws InterruptedException
      Throws:
      InterruptedException
    • frequency_range

      protected void frequency_range() throws InterruptedException
      Throws:
      InterruptedException
    • period_range

      protected void period_range() throws InterruptedException
      Throws:
      InterruptedException
    • fft

      protected void fft(double ff) throws InterruptedException
      Compute a FFT.
      Parameters:
      ff - The frequency.
      Throws:
      InterruptedException
    • cleanest

      protected void cleanest(List<Double> freqs, List<Double> variablePeriods, List<Double> lockedPeriods) throws AlgorithmError, InterruptedException
      A translation of the Fortran TS CLEANest algorithm.
      Parameters:
      freqs - The user-specified frequencies to be included.
      varPeriods - The variable periods to be included. May be null or empty.
      lockedPeriods - The locked periods to be included. May be null or empty.
      Throws:
      AlgorithmError
      InterruptedException
    • multiPeriodicFit

      public void multiPeriodicFit(List<Harmonic> harmonics, PeriodAnalysisDerivedMultiPeriodicModel model) throws InterruptedException
      Create a multi-periodic fit to the data from a list of periods.
      Specified by:
      multiPeriodicFit in interface IPeriodAnalysisAlgorithm
      Parameters:
      harmonics - The harmonics to be used to create the fit.
      model - A multi-period fit class that takes place in the context of a period analysis. Data members in this parameter are populated as a result of invoking this method.
      Throws:
      InterruptedException
    • resolve

      protected org.aavso.tools.vstar.util.period.dcdft.TSDcDft.ResolutionResult resolve(double ddr, double ddp)
    • tablit

      protected void tablit()