@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; List<Object> vals = new ArrayList<Object>(); for (String gattName : gattNames) { Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); vals.add(att.getValue(0)); } Formatter f = new Formatter(); f.format(format, vals.toArray()); String result = f.toString(); Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) allData.setObject(i, result); putData(dset.getId(), allData); return allData; }
for (Dataset dataset : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) dataset; if (dod.getId() == null) logger.warn("id is null"); out.print(" <netcdf id='" + dod.getId() + "' "); out.print("ncoords='" + dod.getNcoords(null) + "' >\n"); Array data = pv.getData(dod.getId()); if (data != null) { out.print(" <cache varName='" + pv.varName + "' >");
for (Dataset dataset : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) dataset; if (dod.getId() == null) logger.warn("id is null"); out.print(" <netcdf id='" + dod.getId() + "' "); out.print("ncoords='" + dod.getNcoords(null) + "' >\n"); Array data = pv.getData(dod.getId()); if (data != null) { out.print(" <cache varName='" + pv.varName + "' >");
for (Dataset dataset : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) dataset; if (dod.getId() == null) logger.warn("id is null"); out.print(" <netcdf id='" + dod.getId() + "' "); out.print("ncoords='" + dod.getNcoords(null) + "' >\n"); Array data = pv.getData(dod.getId()); if (data != null) { out.print(" <cache varName='" + pv.varName + "' >");
@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); data = att.getValues(); if (dtype == null) dtype = DataType.getType(data); if (dset.ncoord == 1) // LOOK ?? putData(dset.getId(), data); else { // duplicate the value to each of the coordinates Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) Array.arraycopy(data, 0, allData, i, 1); // LOOK generalize to vectors ?? putData(dset.getId(), allData); data = allData; } return data; }
@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); data = att.getValues(); if (dtype == null) dtype = DataType.getType(data.getElementType()); if (dset.ncoord == 1) // LOOK ?? putData(dset.getId(), data); else { // duplicate the value to each of the coordinates Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) Array.arraycopy(data, 0, allData, i, 1); // LOOK generalize to vectors ?? putData(dset.getId(), allData); data = allData; } return data; }
@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); data = att.getValues(); if (dtype == null) dtype = DataType.getType(data.getElementType()); if (dset.ncoord == 1) // LOOK ?? putData(dset.getId(), data); else { // duplicate the value to each of the coordinates Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) Array.arraycopy(data, 0, allData, i, 1); // LOOK generalize to vectors ?? putData(dset.getId(), allData); data = allData; } return data; }
@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; List<Object> vals = new ArrayList<Object>(); for (String gattName : gattNames) { Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); vals.add(att.getValue(0)); } Formatter f = new Formatter(); f.format(format, vals.toArray()); String result = f.toString(); Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) allData.setObject(i, result); putData(dset.getId(), allData); return allData; }
@Override protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; List<Object> vals = new ArrayList<>(); for (String gattName : gattNames) { Attribute att = ncfile.findGlobalAttribute(gattName); if (att == null) throw new IllegalArgumentException("Unknown attribute name= " + gattName); vals.add(att.getValue(0)); } Formatter f = new Formatter(); f.format(format, vals.toArray()); String result = f.toString(); Array allData = Array.factory(dtype, new int[]{dset.ncoord}); for (int i = 0; i < dset.ncoord; i++) allData.setObject(i, result); putData(dset.getId(), allData); return allData; }
protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { invocation++; Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; Variable v = ncfile.findVariable(varName); data = v.read(); putData(dset.getId(), data); if (debugCache) System.out.println("caching " + varName + " complete data"); return data; } }
protected Array read(DatasetOuterDimension dset) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; // ?? NetcdfFile ncfile = null; try { ncfile = dset.acquireFile(null); return read(dset, ncfile); } finally { if (ncfile != null) ncfile.close(); } }
protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { invocation++; Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; Variable v = ncfile.findVariable(varName); data = v.read(); putData(dset.getId(), data); if (debugCache) System.out.println("caching " + varName + " complete data"); return data; } }
protected Array read(DatasetOuterDimension dset) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; // ?? NetcdfFile ncfile = null; try { ncfile = dset.acquireFile(null); return read(dset, ncfile); } finally { if (ncfile != null) ncfile.close(); } }
protected Array read(DatasetOuterDimension dset, NetcdfFile ncfile) throws IOException { invocation++; Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; Variable v = ncfile.findVariable(varName); data = v.read(); putData(dset.getId(), data); if (debugCache) System.out.println("caching " + varName + " complete data"); return data; } }
protected Array read(DatasetOuterDimension dset) throws IOException { Array data = getData(dset.getId()); if (data != null) return data; if (type == Type.joinNew) return null; // ?? NetcdfFile ncfile = null; try { ncfile = dset.acquireFile(null); return read(dset, ncfile); } finally { if (ncfile != null) ncfile.close(); } }