Class TSDcDft
java.lang.Object
org.aavso.tools.vstar.util.TSBase
org.aavso.tools.vstar.util.period.dcdft.TSDcDft
- All Implemented Interfaces:
IAlgorithm,IInteruptible,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):
- Ferraz-Mello, S., 1981, Estimation of Periods from Unequally Spaced Observations, Astron. Journal 86, 619 (http://adsabs.harvard.edu/abs/1981AJ.....86..619F)
- 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)
- http://www.aavso.org/aavso/meetings/spring03present/templeton.shtml
-
Field Summary
Fields inherited from class org.aavso.tools.vstar.util.TSBase
damp, damp2, dangcut, dave, dcoef, dfouramp2, dfpow, dfre, dgamplitude, dgnu, dgper, dgpower, dlamp, dlamplitude, dllamp, dlnu, dlper, dlpower, dmat, dpower, dsig, dt0, dtave, dtscale, dtsig, dtvar, dtzero, dvar, dvec, dweight, ff, hifre, interrupted, ma, magspan, MAX_TOP_HITS, mb, mhigh, mlow, nbias, nbrake, ndigt, ndim, ndim2, nfre, nj, nlolim, npoly, numact, numraw, nuplim, obias, obs, tlolim, tmark, tresolv, tuplim, tuplimit, tvec, wvec, xvec -
Constructor Summary
ConstructorsConstructorDescriptionTSDcDft(List<ValidObservation> observations) ConstructorTSDcDft(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.TSDcDft(List<ValidObservation> observations, DcDftAnalysisType analysisType) Constructor The analysis type is specified. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidA translation of the Fortran TS CLEANest algorithm.protected voiddcdft()protected voidvoidvoidexecute()Perform a "standard scan" or "frequency range" based DC DFT, a date compensated discrete Fourier transform.protected voidfft(double ff) Compute a FFT.protected voiddouble[]doubledoubledoubledoubledouble[]getMags()Get the refine-by-frequency algorithm name.doubleReturn the result of the period analysis.Return the "top hits" from the period analysis.double[]voidSignals that a task has been interrupted.voidmultiPeriodicFit(List<Harmonic> harmonics, PeriodAnalysisDerivedMultiPeriodicModel model) Create a multi-periodic fit to the data from a list of periods.protected voidRefine the period analysis in some way that makes sense for the algorithm, e.g.protected org.aavso.tools.vstar.util.period.dcdft.TSDcDft.ResolutionResultresolve(double ddr, double ddp) voidsetHiFreqValue(double hiFreqValue) voidsetHiPeriodValue(double hiPeriodValue) voidsetLoFreqValue(double loFreqValue) voidsetLoPeriodValue(double loPeriodValue) voidsetResolutionValue(double resolutionValue) protected voidprotected voidtablit()
-
Constructor Details
-
TSDcDft
Constructor- Parameters:
observations- The observations over which to perform a period analysis.
-
TSDcDft
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:IInteruptibleSignals that a task has been interrupted.- Specified by:
interruptin interfaceIInteruptible
-
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
Description copied from interface:IPeriodAnalysisAlgorithmReturn the result of the period analysis.- Specified by:
getResultSeriesin interfaceIPeriodAnalysisAlgorithm- 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:
getTopHitsin interfaceIPeriodAnalysisAlgorithm
-
execute
Perform a "standard scan" or "frequency range" based DC DFT, a date compensated discrete Fourier transform.- Specified by:
executein interfaceIAlgorithm- 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:IPeriodAnalysisAlgorithmRefine 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:
refineByFrequencyin interfaceIPeriodAnalysisAlgorithm- Parameters:
freqs- A list of frequencies on which to refine the results.- Returns:
- the new top-hits created by this refinement.
- Throws:
AlgorithmErrorInterruptedException
-
getRefineByFrequencyName
Description copied from interface:IPeriodAnalysisAlgorithmGet the refine-by-frequency algorithm name.- Specified by:
getRefineByFrequencyNamein interfaceIPeriodAnalysisAlgorithm- Returns:
- The name of the refine-by-frequency algorithm, or null if none.
-
dcdftCommon
protected void dcdftCommon() -
determineDefaultParameters
public void determineDefaultParameters() -
dcdft
- Throws:
InterruptedException
-
standard_scan
- Throws:
InterruptedException
-
frequency_range
- Throws:
InterruptedException
-
period_range
- Throws:
InterruptedException
-
fft
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:
AlgorithmErrorInterruptedException
-
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:
multiPeriodicFitin interfaceIPeriodAnalysisAlgorithm- 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()
-