public void setStations( List<StationFeature> nstations) { stations = new ArrayList<>(); stationHash = new HashMap<>(); for (StationFeature s : nstations) addStation(s); }
public void setStations( List<Station> nstations) { stations = new ArrayList<Station>(); stationHash = new HashMap<String, Station>(); for (Station s : nstations) addStation(s); }
public void setStations( List<StationFeature> nstations) { stations = new ArrayList<>(); stationHash = new HashMap<>(); for (StationFeature s : nstations) addStation(s); }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); for (BufrCdmIndexProto.Station s : index.stations) stationHelper.addStation(new BufrStation(s)); return stationHelper; }
protected CompositeStationCollection(String name, TimedCollection dataCollection, List<Station> stns, List<VariableSimpleIF> dataVariables) throws IOException { super(name); this.dataCollection = dataCollection; TimedCollection.Dataset td = dataCollection.getPrototype(); if (td == null) throw new RuntimeException("No datasets in the collection"); if ((stns != null) && (stns.size() > 0)) { stationHelper = new StationHelper(); for (Station s : stns) stationHelper.addStation(new CompositeStationFeature(s, null, this.dataCollection)); } this.dataVariables = dataVariables; }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); for (StationFeature stationFeat : this.stationFeats) { stationHelper.addStation(new CompositeStationFeature( stationFeat, timeUnit, altUnits, stationFeat.getFeatureData(), from.dataCollection)); } return stationHelper; } }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); for (StationFeature stationFeat : this.stationFeats) { stationHelper.addStation(new CompositeStationFeature( stationFeat, timeUnit, altUnits, stationFeat.getFeatureData(), from.dataCollection)); } return stationHelper; } }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper helper = new StationHelper(); String name = String.format("GridPointAt[%s]", latLonPoint.toString(3)); name = StringUtil2.replace(name.trim(), ' ', "_"); helper.addStation(new MyStationFeature(name, name, null, latLonPoint.getLatitude(), latLonPoint.getLongitude(), 0.0, dateUnit, null, -1)); return helper; }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); StationProfileIterator iter = new StationProfileIterator(); while (iter.hasNext()) { stationHelper.addStation(iter.next()); } return stationHelper; }
@Override protected StationHelper createStationHelper() throws IOException { TimedCollection.Dataset td = dataCollection.getPrototype(); if (td == null) throw new RuntimeException("No datasets in the collection"); Formatter errlog = new Formatter(); try (FeatureDatasetPoint openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog)) { if (openDataset == null) throw new IllegalStateException("Cant open FeatureDatasetPoint " + td.getLocation()); StationHelper stationHelper = new StationHelper(); List<DsgFeatureCollection> fcList = openDataset.getPointFeatureCollectionList(); StationTimeSeriesCollectionImpl openCollection = (StationTimeSeriesCollectionImpl) fcList.get(0); List<StationFeature> stns = openCollection.getStationFeatures(); for (StationFeature stnFeature : stns) { stationHelper.addStation(new CompositeStationFeature(stnFeature, timeUnit, altUnits, stnFeature.getFeatureData(), this.dataCollection)); } dataVariables = openDataset.getDataVariables(); globalAttributes = openDataset.getGlobalAttributes(); return stationHelper; } }
@Override protected void initStationHelper() { TimedCollection.Dataset td = dataCollection.getPrototype(); if (td == null) throw new RuntimeException("No datasets in the collection"); Formatter errlog = new Formatter(); FeatureDatasetPoint openDataset = null; try { openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog); List<FeatureCollection> fcList = openDataset.getPointFeatureCollectionList(); StationTimeSeriesCollectionImpl openCollection = (StationTimeSeriesCollectionImpl) fcList.get(0); List<Station> stns = openCollection.getStations(); stationHelper = new StationHelper(); for (Station s : stns) stationHelper.addStation(new CompositeStationFeature(s, null, this.dataCollection)); dataVariables = openDataset.getDataVariables(); } catch (Exception ioe) { throw new RuntimeException(td.getLocation(), ioe); } finally { try { if (openDataset != null) openDataset.close(); } catch (Throwable t) { } } }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); try (StructureDataIterator siter = ft.getStationDataIterator()) { while (siter.hasNext()) { StructureData stationData = siter.next(); StationTimeSeriesFeature stfs = makeStation(stationData, siter.getCurrentRecno()); if (stfs != null) { stationHelper.addStation(stfs); } } } return stationHelper; }
protected void initStationHelper() { try { stationHelper = new StationHelper(); StructureDataIterator siter = ft.getStationDataIterator(-1); try { while (siter.hasNext()) { StructureData stationData = siter.next(); Station s = makeStation(stationData, siter.getCurrentRecno()); if (s != null) stationHelper.addStation(s); } } finally { siter.finish(); } } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override protected void initStationHelper() { try { stationHelper = new StationHelper(); StructureDataIterator siter = ft.getStationDataIterator(-1); try { while (siter.hasNext()) { StructureData stationData = siter.next(); Station s = makeStation(stationData, siter.getCurrentRecno()); if (s != null) stationHelper.addStation(s); } } finally { siter.finish(); } } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override protected StationHelper createStationHelper() throws IOException { TimedCollection.Dataset td = dataCollection.getPrototype(); if (td == null) throw new RuntimeException("No datasets in the collection"); Formatter errlog = new Formatter(); try (FeatureDatasetPoint openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open( FeatureType.STATION, td.getLocation(), null, errlog)) { StationHelper stationHelper = new StationHelper(); List<FeatureCollection> fcList = openDataset.getPointFeatureCollectionList(); StationTimeSeriesCollectionImpl openCollection = (StationTimeSeriesCollectionImpl) fcList.get(0); List<Station> stns = openCollection.getStations(); for (Station s : stns) { StationTimeSeriesFeature stnFeature = openCollection.getStationFeature(s); stationHelper.addStation(new CompositeStationFeature(s, timeUnit, altUnits, stnFeature.getFeatureData(), this.dataCollection)); } dataVariables = openDataset.getDataVariables(); globalAttributes = openDataset.getGlobalAttributes(); return stationHelper; } }
/** * initialize the stationHelper. */ @Override protected StationHelper createStationHelper() throws IOException { // read in all the stations with the "stations" query StationHelper stationHelper = new StationHelper(); try (InputStream in = CdmRemote.sendQuery(uri, "req=stations")) { PointStream.MessageType mtype = PointStream.readMagic(in); if (mtype != PointStream.MessageType.StationList) { throw new RuntimeException("Station Request: bad response"); } int len = NcStream.readVInt(in); byte[] b = new byte[len]; NcStream.readFully(in, b); PointStreamProto.StationList stationsp = PointStreamProto.StationList.parseFrom(b); for (ucar.nc2.ft.point.remote.PointStreamProto.Station sp : stationsp.getStationsList()) { // Station s = new StationImpl(sp.getId(), sp.getDesc(), sp.getWmoId(), sp.getLat(), sp.getLon(), sp.getAlt()); stationHelper.addStation(new RemoteStationFeatureImpl(null, null)); // LOOK WRONG } return stationHelper; } }
/** * initialize the stationHelper. */ @Override protected StationHelper createStationHelper() throws IOException { // read in all the stations with the "stations" query StationHelper stationHelper = new StationHelper(); try (InputStream in = CdmRemote.sendQuery(null, uri, "req=stations")) { PointStream.MessageType mtype = PointStream.readMagic(in); if (mtype != PointStream.MessageType.StationList) { throw new RuntimeException("Station Request: bad response"); } int len = NcStream.readVInt(in); byte[] b = new byte[len]; NcStream.readFully(in, b); PointStreamProto.StationList stationsp = PointStreamProto.StationList.parseFrom(b); for (ucar.nc2.ft.point.remote.PointStreamProto.Station sp : stationsp.getStationsList()) { // Station s = new StationImpl(sp.getId(), sp.getDesc(), sp.getWmoId(), sp.getLat(), sp.getLon(), sp.getAlt()); stationHelper.addStation(new StationFeatureStream(null, null)); // LOOK WRONG } return stationHelper; } }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); StructureDataIterator siter = ft.getStationDataIterator(-1); try { while (siter.hasNext()) { StructureData stationData = siter.next(); StationTimeSeriesFeature s = makeStation(stationData, siter.getCurrentRecno()); if (s != null) { stationHelper.addStation(s); } } } finally { siter.finish(); } return stationHelper; }
@Override protected StationHelper createStationHelper() throws IOException { StationHelper stationHelper = new StationHelper(); StructureDataIterator siter = ft.getStationDataIterator(-1); try { while (siter.hasNext()) { StructureData stationData = siter.next(); StationFeature s = makeStation(stationData, siter.getCurrentRecno()); if (s != null) stationHelper.addStation(s); } } finally { siter.finish(); } return stationHelper; }
for (ucar.nc2.ft.point.remote.PointStreamProto.Station sp : stationsp.getStationsList()) { Station s = new StationImpl(sp.getId(), sp.getDesc(), sp.getWmoId(), sp.getLat(), sp.getLon(), sp.getAlt()); stationHelper.addStation(new RemoteStationFeatureImpl(s, null));