Package org.aavso.tools.vstar.data

Examples of org.aavso.tools.vstar.data.ValidObservation


    List<ValidObservation> obs = commonValidTest(lines.toString(), "\t");

    assertTrue(obs.size() == 2);

    // A few checks.
    ValidObservation ob0 = obs.get(0);
    assertEquals(2454531.66261, ob0.getDateInfo().getJulianDay());
    assertEquals(SeriesType.Johnson_V, ob0.getBand());
    assertEquals("W UMA", ob0.getName());
  }
View Full Code Here


    List<ValidObservation> obs = commonValidTest(lines.toString(), ",");

    assertTrue(obs.size() == 2);

    // A few checks.
    ValidObservation ob0 = obs.get(0);
    assertEquals(2454531.66261, ob0.getDateInfo().getJulianDay());
    assertEquals(SeriesType.Johnson_V, ob0.getBand());
    assertEquals("W UMA", ob0.getName());
  }
View Full Code Here

      String delimiter) {
    List<ValidObservation> obs = commonValidTest(line, delimiter);

    assertTrue(obs.size() == 1);

    ValidObservation ob = obs.get(0);
    assertEquals(2450001.5, ob.getDateInfo().getJulianDay());
    assertEquals(10.0, ob.getMagnitude().getMagValue());
    assertFalse(ob.getMagnitude().isUncertain());
    assertFalse(ob.getMagnitude().isFainterThan());

    return ob;
  }
View Full Code Here

  public TSPolynomialFitterTest(String name) {
    super(name);
    obs = new ArrayList<ValidObservation>();
    for (double[] jd_mag_pair : jd_and_mag) {
      ValidObservation ob = new ValidObservation();
      ob.setDateInfo(new DateInfo(jd_mag_pair[0]));
      ob.setMagnitude(new Magnitude(jd_mag_pair[1], 0));
      obs.add(ob);
    }
  }
View Full Code Here

      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);

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

        assertEquals(String.format("%1.4f",
            polyfit_residuals_degree2[i][1]), String.format(
            "%1.4f", ob.getMag()));
      }
    } catch (AlgorithmError e) {
      fail();
    }
  }
View Full Code Here

    assertTrue(mags.length == jds.length);
   
    List<ValidObservation> observations = new ArrayList<ValidObservation>();
   
    for (int i=0;i < mags.length;i++) {
      ValidObservation obs = new ValidObservation();
      obs.setMagnitude(new Magnitude(mags[i], MagnitudeModifier.NO_DELTA,
          false));
      obs.setDateInfo(new DateInfo(jds[i]));
      observations.add(obs);
    }

    return observations;
  }
View Full Code Here

  public void testMeanObservationSample3() {
    Bin bin = DescStats.createMeanObservationForRange(
        this.observations3, JDTimeElementEntity.instance, 0,
        mags3.length - 1);

    ValidObservation observation = bin.getMeanObservation();

    double magMean = observation.getMagnitude().getMagValue();
    String magMeanStr = String.format("%1.1f", magMean);
    assertEquals("4.0", magMeanStr);

    double magStdErr = observation.getMagnitude().getUncertainty();
    String magStdErrStr = String.format("%1.3f", magStdErr);
    assertEquals("0.038", magStdErrStr);
  }
View Full Code Here

  // magnitude values and bogus JD values.
  private List<ValidObservation> populateObservations(double[] mags) {
    double jd = 0;
    List<ValidObservation> observations = new ArrayList<ValidObservation>();
    for (double mag : mags) {
      ValidObservation obs = new ValidObservation();
      obs.setMagnitude(new Magnitude(mag, MagnitudeModifier.NO_DELTA,
          false));
      obs.setDateInfo(new DateInfo(jd));
      observations.add(obs);
      jd += 0.5;
    }

    return observations;
View Full Code Here

    assert times.length == mags.length;

    List<ValidObservation> observations = new ArrayList<ValidObservation>();

    for (int i = 0; i < times.length; i++) {
      ValidObservation obs = new ValidObservation();
      obs.setMagnitude(new Magnitude(mags[i], MagnitudeModifier.NO_DELTA,
          false));
      obs.setDateInfo(new DateInfo(times[i]));
      observations.add(obs);
    }

    return observations;
  }
View Full Code Here

  public DataTestBase(String name, double[][] jdAndMagPairs) {
    super(name);
    this.obs = new ArrayList<ValidObservation>();
    for (double[] jdAndMag : jdAndMagPairs) {
      ValidObservation ob = new ValidObservation();
      ob.setDateInfo(new DateInfo(jdAndMag[0]));
      ob.setMagnitude(new Magnitude(jdAndMag[1], 0));
      obs.add(ob);
    }
  }
View Full Code Here

TOP

Related Classes of org.aavso.tools.vstar.data.ValidObservation

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.