Package org.aavso.tools.vstar.input

Examples of org.aavso.tools.vstar.input.AbstractObservationRetriever


    InputStream in = new ByteArrayInputStream(content.toString().getBytes());
    List<InputStream> streams = new ArrayList<InputStream>();
    streams.add(in);
    source.setInputInfo(streams, inputName);

    AbstractObservationRetriever retriever = source
        .getObservationRetriever();
    try {
      retriever.retrieveObservations();
    } catch (Exception e) {
      fail();
    }

    List<ValidObservation> obs = retriever.getValidObservations();
    assertEquals(numObs, obs.size());

    return obs;
  }
View Full Code Here


  // Valid tests.

  public void testEtaAql() throws FileNotFoundException {
    File file = new File("plugin/test/data/eta_aql_asas.txt");

    AbstractObservationRetriever retriever = commonTest(file,
        "eta_aql_asas.txt", 792, 1);

    assertTrue(retriever.isHeliocentric());
   
    Map<SeriesType, List<ValidObservation>> seriesMap = retriever
        .getValidObservationCategoryMap();
   
    List<ValidObservation> asas1Obs = seriesMap.get(SeriesType
        .getSeriesFromDescription("ASAS-1"));
    assertEquals(1, asas1Obs.size());
View Full Code Here

    InputStream in = new FileInputStream(file);
    List<InputStream> streams = new ArrayList<InputStream>();
    streams.add(in);
    source.setInputInfo(streams, inputName);

    AbstractObservationRetriever retriever = source
        .getObservationRetriever();
    try {
      retriever.retrieveObservations();
      assertEquals(numObs, retriever.getValidObservations().size());
    } catch (Exception e) {
      fail();
    }

    return retriever;
View Full Code Here

      ObservationSourceAnalyser analyser = new ObservationSourceAnalyser(
          new LineNumberReader(new StringReader(str)), "Some String");
      analyser.analyse();

      AbstractObservationRetriever simpleTextFormatReader = new TextFormatObservationReader(
          new LineNumberReader(new StringReader(str)), analyser);

      simpleTextFormatReader.retrieveObservations();

      List<ValidObservation> obs = simpleTextFormatReader
          .getValidObservations();

      assertEquals(1, obs.size());

      assertEquals(8.0, obs.get(0).getMagnitude().getMagValue());
View Full Code Here

    try {
      ObservationSourceAnalyser analyser = new ObservationSourceAnalyser(
          new LineNumberReader(new StringReader(str)), "Some String");
      analyser.analyse();

      AbstractObservationRetriever simpleTextFormatReader = new TextFormatObservationReader(
          new LineNumberReader(new StringReader(str)), analyser);

      simpleTextFormatReader.retrieveObservations();
      obs = simpleTextFormatReader.getValidObservations();
    } catch (Exception e) {
      fail(e.getMessage());
    }

    return obs;
View Full Code Here

      List<InputStream> streams = new ArrayList<InputStream>();
      streams.add(inputURL.openStream());
      obSourcePlugin.setInputInfo(streams, inputURL.getPath());

      // Retrieve the observations.
      AbstractObservationRetriever retriever = obSourcePlugin
          .getObservationRetriever();

      ValidObservation.reset();

      retriever.retrieveObservations();

      if (retriever.getValidObservations().isEmpty()) {
        throw new ObservationReadError(
            "No observations for the specified period or error in observation source.");
      }

      // Create plots, tables.
      NewStarType type = NewStarType.NEW_STAR_FROM_ARBITRARY_SOURCE;
      mediator.createNewStarObservationArtefacts(type, retriever
          .getStarInfo(), 0, isAdditive);

    } catch (InterruptedException e) {
      ValidObservation.restore();
View Full Code Here

        obSourcePlugin.setInputInfo(null, null);
        break;
      }

      // Retrieve the observations.
      AbstractObservationRetriever retriever = obSourcePlugin
          .getObservationRetriever();

      ValidObservation.reset();

      retriever.retrieveObservations();

      if (retriever.getValidObservations().isEmpty()) {
        throw new ObservationReadError(
            "No observations for the specified period or error in observation source.");
      }

      // Create plots, tables.
      NewStarType type = NewStarType.NEW_STAR_FROM_ARBITRARY_SOURCE;
      mediator.createNewStarObservationArtefacts(type, retriever
          .getStarInfo(), 0, obSourcePlugin.isAdditive());

    } catch (InterruptedException e) {
      ValidObservation.restore();
View Full Code Here

      List<InputStream> streams = new ArrayList<InputStream>();
      streams.add(new FileInputStream(inputFile));
      obSourcePlugin.setInputInfo(streams, inputFile.getName());

      // Retrieve the observations.
      AbstractObservationRetriever retriever = obSourcePlugin
          .getObservationRetriever();

      ValidObservation.reset();

      retriever.retrieveObservations();

      if (retriever.getValidObservations().isEmpty()) {
        throw new ObservationReadError(
            "No observations for the specified period or error in observation source.");
      }

      // Create plots, tables.
      NewStarType type = NewStarType.NEW_STAR_FROM_ARBITRARY_SOURCE;
      mediator.createNewStarObservationArtefacts(type, retriever
          .getStarInfo(), 0, isAdditive);

    } catch (InterruptedException e) {
      ValidObservation.restore();
View Full Code Here

TOP

Related Classes of org.aavso.tools.vstar.input.AbstractObservationRetriever

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.