/** * 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 InvDataset invdata = queryRadarStation(stnName, absTime); if (invdata == null) { throw new IOException("Invalid time selected: " + absTime.toString() + "\n"); } ThreddsDataFactory tdFactory = new ThreddsDataFactory(); ThreddsDataFactory.Result result; result = tdFactory.openFeatureDataset(invdata, null); return (RadialDatasetSweep) result.featureDataset; }
/** * Getting URI for a single radar station. * * @param stnName radar station name * @param absTime is absolute time * @return URI * @throws IOException java io exception */ public URI getRadarDatasetURI(String stnName, Date absTime) throws IOException { // absTime is a member of datasetsDateURI InvDataset invdata = queryRadarStation(stnName, absTime); /* List dsets = idata.getDatasets(); int siz = dsets.size(); if(siz != 1) return null; InvDataset invdata = (InvDataset)dsets.get(0); */ List acess = invdata.getAccess(); InvAccess ia = (InvAccess) acess.get(0); URI ui = ia.getStandardUri(); if (ui == null) { throw new IOException("Invalid time selected: " + absTime.toString() + "\n"); } return ui; }