コード例 #1
0
  /**
   * Getting data for a single radar station, with time range.
   *
   * @param sName radar station name
   * @param dateSelect the date time selection information
   * @param cancel _more_
   * @return list of radialDatasetSweep
   * @throws IOException _more_
   */
  public List getData(String sName, DateSelection dateSelect, ucar.nc2.util.CancelTask cancel)
      throws IOException {
    if ((cancel != null) && cancel.isCancel()) {
      return null;
    }
    TDSRadarDatasetInfo dri =
        queryRadarStation(sName, dateSelect.getStartFixedDate(), dateSelect.getEndFixedDate());
    List datasetList = new ArrayList();

    List datasetINVs = dateSelect.apply(dri.getInvList());

    Iterator it = datasetINVs.iterator();
    while (it.hasNext()) {
      InvDatasetInfo ifo = (InvDatasetInfo) it.next();
      InvDataset tdata = ifo.inv;
      ThreddsDataFactory tdFactory = new ThreddsDataFactory();
      ThreddsDataFactory.Result result;
      result = tdFactory.openFeatureDataset(tdata, null);
      datasetList.add(result.featureDataset);
      if ((cancel != null) && cancel.isCancel()) {
        return null;
      }
    }

    return datasetList;
  }
コード例 #2
0
  /**
   * Getting data Iterator for a single radar station.
   *
   * @param stnName radar station name
   * @param start of the time
   * @param end of the time
   * @return dataset list
   * @throws IOException java io exception
   */
  public List getRadarStationDatasets(String stnName, Date start, Date end) throws IOException {

    List datasetList = new ArrayList();

    TDSRadarDatasetInfo dri = queryRadarStation(stnName, start, end);
    List<InvDatasetInfo> iList = dri.getInvList();
    for (InvDatasetInfo iv : iList) {
      InvDataset tdata = iv.inv;
      ThreddsDataFactory tdFactory = new ThreddsDataFactory();
      ThreddsDataFactory.Result result;
      result = tdFactory.openFeatureDataset(tdata, null);
      datasetList.add(result.featureDataset);
    }

    return datasetList;
  }
コード例 #3
0
  /**
   * Getting dataset for a single radar station.
   *
   * @param stnName radar station name
   * @param absTime is absolute time
   * @return RadialDatasetSweep object
   * @throws IOException java io exception
   */
  public RadialDatasetSweep getRadarDataset(String stnName, Date absTime) throws IOException {
    // absTime is a member of  datasetsDateURI
    // long start = System.currentTimeMillis();
    InvDataset invdata = queryRadarStation(stnName, absTime);
    // double took =  0.001* (System.currentTimeMillis() - start);
    //    System.out.println("it took1 =" + took);
    if (invdata == null) {
      throw new IOException("Invalid time selected: " + absTime.toString() + "\n");
    }

    ThreddsDataFactory tdFactory = new ThreddsDataFactory();
    ThreddsDataFactory.Result result;
    // start = System.currentTimeMillis();
    result = tdFactory.openFeatureDataset(invdata, null);
    // took =  0.001* (System.currentTimeMillis() - start);
    //    System.out.println("it took2 =" + took);
    return (RadialDatasetSweep) result.featureDataset;
  }