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

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


    super.tearDown();
  }

  // Polynomial fit test using delta Cephei data.
  public void testDegree2() {
    TSPolynomialFitter fitter = new TSPolynomialFitter(obs);
    fitter.setDegree(2);
    try {
      fitter.execute();

      List<ValidObservation> fitObs = fitter.getFit();
      assertEquals(polyfit_degree2.length, fitObs.size());

      for (int i = 0; i < fitObs.size(); i++) {
        ValidObservation ob = fitObs.get(i);

        assertEquals(String.format("%1.4f", polyfit_degree2[i][0]),
            String.format("%1.4f", ob.getJD()));

        assertEquals(String.format("%1.4f", polyfit_degree2[i][1]),
            String.format("%1.4f", ob.getMag()));
      }

      List<ValidObservation> residualObs = fitter.getResiduals();
      assertEquals(polyfit_residuals_degree2.length, residualObs.size());

      for (int i = 0; i < residualObs.size(); i++) {
        ValidObservation ob = residualObs.get(i);
View Full Code Here


  @Override
  public IModel getModel(List<ValidObservation> obs) {
    IModel model = null;

    IPolynomialFitter polynomialFitter = new TSPolynomialFitter(obs);

    int minDegree = polynomialFitter.getMinDegree();
    int maxDegree = polynomialFitter.getMaxDegree();

    PolynomialDegreeDialog dialog = new PolynomialDegreeDialog(minDegree,
        maxDegree);

    if (!dialog.isCancelled()) {
      polynomialFitter.setDegree(dialog.getDegree());
      model = polynomialFitter;
    }

    return model;
  }
View Full Code Here

TOP

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

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.