Package org.aavso.tools.vstar.util.model

Examples of org.aavso.tools.vstar.util.model.PeriodAnalysisDerivedMultiPeriodicModel


      List<Harmonic> harmonics,
      List<PeriodFitParameters> expectedParamsList,
      double[][] expectedModelData, double[][] expectedResidualData) {

    // Create a multi-periodic fit model based upon the specified periods.
    PeriodAnalysisDerivedMultiPeriodicModel model = new PeriodAnalysisDerivedMultiPeriodicModel(
        harmonics, algorithm);
    try {
      try {
        algorithm.multiPeriodicFit(harmonics, model);
      } catch (InterruptedException e) {
        // We should never end up here in the course of this unit test
        // since there's no user in the loop to cause an interruption.
        fail();
      }

      // Check the model parameters.
      assertEquals(expectedParamsList.size(), model.getParameters()
          .size());

      for (int i = 0; i < expectedParamsList.size(); i++) {
        assertTrue(expectedParamsList.get(i).equals(
            model.getParameters().get(i)));
      }

      // Check the model and residual data.
      checkData(expectedModelData, model.getFit());
      checkData(expectedResidualData, model.getResiduals());
    } catch (AlgorithmError e) {
      fail();
    }
  }
View Full Code Here


        if (!dialog.isCancelled()) {
          List<Harmonic> harmonics = dialog.getHarmonics();
          if (!harmonics.isEmpty()) {
            try {
              PeriodAnalysisDerivedMultiPeriodicModel model = new PeriodAnalysisDerivedMultiPeriodicModel(
                  harmonics, algorithm);

              Mediator.getInstance().performModellingOperation(
                  model);
            } catch (Exception ex) {
View Full Code Here

  public IModel getModel(List<ValidObservation> obs) {
    IntegerField numPeriodField = new IntegerField("Number of Periods", 0, null, 1);
    MultiEntryComponentDialog numPeriodsDialog = new MultiEntryComponentDialog(
        "Period Count", numPeriodField);
   
    PeriodAnalysisDerivedMultiPeriodicModel model = null;
     
    if (!numPeriodsDialog.isCancelled()) {
      int numPeriods = numPeriodField.getValue();

      List<Double> userSelectedFreqs = new ArrayList<Double>();
      for (int i = 0; i < numPeriods; i++) {
        userSelectedFreqs.add(1.0);
      }

      Map<Double, List<Harmonic>> freqToHarmonicsMap = new HashMap<Double, List<Harmonic>>();

      HarmonicInputDialog dialog = new HarmonicInputDialog(
          DocumentManager.findActiveWindow(), userSelectedFreqs,
          freqToHarmonicsMap);

      if (!dialog.isCancelled()) {
        List<Harmonic> harmonics = dialog.getHarmonics();
        if (!harmonics.isEmpty()) {
          IPeriodAnalysisAlgorithm algorithm = new TSDcDft(obs);
          model = new PeriodAnalysisDerivedMultiPeriodicModel(
              harmonics, algorithm);

        } else {
          MessageBox.showErrorDialog("Fourier Model Creator",
              "Period list error");
View Full Code Here

TOP

Related Classes of org.aavso.tools.vstar.util.model.PeriodAnalysisDerivedMultiPeriodicModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.