@Override public boolean isChunked(Variable v) { return v.isUnlimited(); // must chunk }
@Override public boolean isChunked(Variable v) { int n = v.getRank(); return n >= 2 || v.isUnlimited(); }
@Override public boolean isChunked(Variable v) { if (v.isUnlimited()) return true; long size = v.getSize() * v.getElementSize(); return size >= DEFAULT_CHUNKSIZE; }
@Override public boolean isChunked(Variable v) { if (v.isUnlimited()) return true; // if (getChunkAttribute(v) != null) return true; long size = v.getSize() * v.getElementSize(); return (size > minVariableSize); }
@Override public boolean isChunked(Variable v) { if (v.isUnlimited()) return true; if (getChunkAttribute(v) != null) return true; long size = v.getSize() * v.getElementSize(); return (size > minVariableSize); }
private void compareVariableData(Variable var1, Variable var2, boolean showCompare, boolean justOne) throws IOException { Array data1 = var1.read(); Array data2 = var2.read(); if (showCompare) f.format(" compareArrays %s unlimited=%s size=%d%n", var1.getNameAndDimensions(), var1.isUnlimited(), data1.getSize()); compareData(var1.getFullName(), data1, data2, justOne); if (showCompare) f.format(" ok%n"); }
private void compareVariableData(Variable var1, Variable var2, boolean showCompare, boolean justOne) throws IOException { Array data1 = var1.read(); Array data2 = var2.read(); if (showCompare) f.format(" compareArrays %s unlimited=%s size=%d%n", var1.getNameAndDimensions(), var1.isUnlimited(), data1.getSize()); compareData(var1.getFullName(), data1, data2, justOne); if (showCompare) f.format(" ok%n"); }
private boolean compareVariableData(Variable var1, Variable var2, boolean showCompare, boolean justOne) throws IOException { Array data1 = var1.read(); Array data2 = var2.read(); if (showCompare) f.format(" compareArrays %s unlimited=%s size=%d%n", var1.getNameAndDimensions(), var1.isUnlimited(), data1.getSize()); boolean ok = compareData(var1.getFullName(), data1, data2, justOne); if (showCompare) f.format(" ok=%s%n", ok); return ok; }
@Override public boolean isChunked(Variable v) { if (v.isUnlimited()) return true; // if (getChunkAttribute(v) != null) return true; int n = v.getRank(); return n >= 2 && v.getSize() * v.getElementSize() > getMinVariableSize(); }
protected void fillNonRecordVariables() throws IOException { // run through each variable for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) continue; try { writeData(v, v.getShapeAsSection(), makeConstantArray(v)); } catch (InvalidRangeException e) { e.printStackTrace(); // shouldnt happen } } }
@Override public boolean isChunked(Variable v) { if (v.isUnlimited()) return true; if (getChunkAttribute(v) != null) return true; int n = v.getRank(); return n >= 2 && v.getSize() * v.getElementSize() > getMinVariableSize(); }
protected void fillNonRecordVariables() throws IOException { // run through each variable for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) continue; try { writeData(v, v.getShapeAsSection(), makeConstantArray(v)); } catch (InvalidRangeException e) { e.printStackTrace(); // shouldnt happen } } }
protected void fillNonRecordVariables() throws IOException { // run through each variable for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) continue; try { writeData(v, v.getShapeAsSection(), makeConstantArray(v)); } catch (InvalidRangeException e) { e.printStackTrace(); // shouldnt happen } } }
@Override public long[] computeChunking(Variable v) { // use entire if small enough long size = v.getSize() * v.getElementSize(); if (size < DEFAULT_CHUNKSIZE) return convert(v.getShape()); // all of it if (v.isUnlimited()) return _computeChunkingUnlimited(v); return _computeChunking(v); }
protected void fillRecordVariables(int recStart, int recEnd) throws IOException, InvalidRangeException { // do each record completely, should be a bit more efficient for (int i = recStart; i < recEnd; i++) { // do one record at a time Range r = new Range(i, i); // run through each variable for (Variable v : ncfile.getVariables()) { if (!v.isUnlimited() || (v instanceof Structure)) continue; Section recordSection = new Section( v.getRanges()); recordSection.setRange(0, r); writeData(v, recordSection, makeConstantArray(v)); } } }
protected void fillRecordVariables(int recStart, int recEnd) throws IOException, InvalidRangeException { // do each record completely, should be a bit more efficient for (int i = recStart; i < recEnd; i++) { // do one record at a time Range r = new Range(i, i); // run through each variable for (Variable v : ncfile.getVariables()) { if (!v.isUnlimited() || (v instanceof Structure)) continue; Section recordSection = new Section( v.getRanges()); recordSection.setRange(0, r); writeData(v, recordSection, makeConstantArray(v)); } } }
protected void fillRecordVariables(int recStart, int recEnd) throws IOException, InvalidRangeException { // do each record completely, should be a bit more efficient for (int i = recStart; i < recEnd; i++) { // do one record at a time Range r = new Range(i, i); // run through each variable for (Variable v : ncfile.getVariables()) { if (!v.isUnlimited() || (v instanceof Structure)) continue; Section recordSection = new Section( v.getRanges()); recordSection.setRange(0, r); writeData(v, recordSection, makeConstantArray(v)); } } }
public long readToByteChannel(ucar.nc2.Variable v2, Section section, WritableByteChannel channel) throws java.io.IOException, ucar.ma2.InvalidRangeException { if (v2 instanceof Structure) return readRecordData((Structure) v2, section, channel); N3header.Vinfo vinfo = (N3header.Vinfo) v2.getSPobject(); DataType dataType = v2.getDataType(); Layout layout = (!v2.isUnlimited()) ? new LayoutRegular(vinfo.begin, v2.getElementSize(), v2.getShape(), section) : new LayoutRegularSegmented(vinfo.begin, v2.getElementSize(), header.recsize, v2.getShape(), section); return readData(layout, dataType, channel); }
@Override public long readToByteChannel(ucar.nc2.Variable v2, Section section, WritableByteChannel channel) throws java.io.IOException, ucar.ma2.InvalidRangeException { if (v2 instanceof Structure) return readRecordData((Structure) v2, section, channel); N3header.Vinfo vinfo = (N3header.Vinfo) v2.getSPobject(); DataType dataType = v2.getDataType(); Layout layout = (!v2.isUnlimited()) ? new LayoutRegular(vinfo.begin, v2.getElementSize(), v2.getShape(), section) : new LayoutRegularSegmented(vinfo.begin, v2.getElementSize(), header.recsize, v2.getShape(), section); return readData(layout, dataType, channel); }
@Override public long readToByteChannel(ucar.nc2.Variable v2, Section section, WritableByteChannel channel) throws java.io.IOException, ucar.ma2.InvalidRangeException { if (v2 instanceof Structure) return readRecordData((Structure) v2, section, channel); N3header.Vinfo vinfo = (N3header.Vinfo) v2.getSPobject(); DataType dataType = v2.getDataType(); Layout layout = (!v2.isUnlimited()) ? new LayoutRegular(vinfo.begin, v2.getElementSize(), v2.getShape(), section) : new LayoutRegularSegmented(vinfo.begin, v2.getElementSize(), header.recsize, v2.getShape(), section); return readData(layout, dataType, channel); }