public String getFileTypeDescription() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeDescription(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
public String getFileTypeId() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeId(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
public String getFileTypeDescription() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeDescription(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
dataset.close( ncfile);
/** * Read a section of the local Variable. * * @param mainv aggregated Variable * @param cancelTask let user cancel * @param section reletive to the local Variable * @return the complete Array for mainv * @throws IOException on I/O error * @throws InvalidRangeException on section error */ protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (debugRead) { Section want = new Section(section); System.out.printf("Agg.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } return v.read(section); } finally { close( ncd); } }
/** * Read a section of the local Variable. * * @param mainv aggregated Variable * @param cancelTask let user cancel * @param section reletive to the local Variable * @return the complete Array for mainv * @throws IOException on I/O error * @throws InvalidRangeException on section error */ protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (debugRead) { Section want = new Section(section); System.out.printf("Agg.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } return v.read(section); } finally { close( ncd); } }
/** * Read a section of the local Variable. * * @param mainv aggregated Variable * @param cancelTask let user cancel * @param section reletive to the local Variable * @return the complete Array for mainv * @throws IOException on I/O error * @throws InvalidRangeException on section error */ protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (debugRead) { Section want = new Section(section); System.out.printf("Agg.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } return v.read(section); } finally { close( ncd); } }
public String getFileTypeId() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeId(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
public String getFileTypeId() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeId(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
public String getFileTypeDescription() { // LOOK - should cache ?? Dataset ds = null; NetcdfFile ncfile = null; try { ds = getTypicalDataset(); ncfile = ds.acquireFile(null); return ncfile.getFileTypeDescription(); } catch (Exception e) { logger.error("failed to open "+ds); } finally { if (ds != null) try { ds.close(ncfile); } catch (IOException e) { logger.error("failed to close "+ds); } } return "N/A"; }
protected Array read(Variable mainv, CancelTask cancelTask) throws IOException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if ((mainv == null) || (v == null)) System.out.println("HEY (mainv == null)"); if (debugRead) System.out.printf("Agg.read %s from %s in %s%n", mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); return v.read(); } finally { close( ncd); } }
protected Array read(Variable mainv, CancelTask cancelTask) throws IOException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (debugRead) System.out.printf("Agg.read %s from %s in %s%n", mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); return v.read(); } finally { close( ncd); } }
protected Array read(Variable mainv, CancelTask cancelTask) throws IOException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (debugRead) System.out.printf("Agg.read %s from %s in %s%n", mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); return v.read(); } finally { close( ncd); } }
@Override public Array reallyRead(Variable mainV, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); Variable proxyV = findVariable(ncfile, mainV); if ((cancelTask != null) && cancelTask.isCancel()) return null; return proxyV.read(section); } finally { dataset.close( ncfile); } } }
@Override protected void buildNetcdfDataset(CancelTask cancelTask) throws IOException { // each Dataset just gets "transfered" into the resulting NetcdfDataset List<Dataset> nestedDatasets = getDatasets(); for (Dataset vnested : nestedDatasets) { // LOOK could just open the file, not use acquire. NetcdfFile ncfile = vnested.acquireFile(cancelTask); DatasetConstructor.transferDataset(ncfile, ncDataset, null); setDatasetAcquireProxy(vnested, ncDataset); vnested.close( ncfile); // close it because we use DatasetProxyReader to acquire } ncDataset.finish(); }
@Override public Array reallyRead(Variable mainV, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); Variable proxyV = findVariable(ncfile, mainV); if ((cancelTask != null) && cancelTask.isCancel()) return null; return proxyV.read(section); } finally { dataset.close( ncfile); } } }
@Override public Array reallyRead(Variable mainV, CancelTask cancelTask) throws IOException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable proxyV = findVariable(ncfile, mainV); return proxyV.read(); } finally { dataset.close( ncfile); } }
public Array reallyRead(Variable mainV, CancelTask cancelTask) throws IOException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable proxyV = findVariable(ncfile, mainV); return proxyV.read(); } finally { dataset.close( ncfile); } }
public Array reallyRead(Variable mainV, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); Variable proxyV = findVariable(ncfile, mainV); if ((cancelTask != null) && cancelTask.isCancel()) return null; return proxyV.read(section); } finally { dataset.close( ncfile); } } }
@Override public Array reallyRead(Variable mainV, CancelTask cancelTask) throws IOException { NetcdfFile ncfile = null; try { ncfile = dataset.acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable proxyV = findVariable(ncfile, mainV); return proxyV.read(); } finally { dataset.close( ncfile); } }