section.setRange(0, range); } catch (InvalidRangeException exception) { throw netcdfFailure(exception);
private void readNextGeneralRank() throws IOException { try { Section section = new Section(shape); section.setRange( 0, new Range(outerCount, outerCount)); as = (ArrayStructure) read( section); if (NetcdfFile.debugStructureIterator) System.out.println("readNext inner="+outerCount+" total="+outerCount); outerCount++; } catch (InvalidRangeException e) { log.error("Structure.Iterator.readNext() ",e); throw new IllegalStateException("Structure.Iterator.readNext() ",e); } // cant happen readStart += as.getSize(); readCount = 0; }
private void readNextGeneralRank() throws IOException { try { Section section = new Section(shape); section.setRange( 0, new Range(outerCount, outerCount)); as = (ArrayStructure) read( section); if (NetcdfFile.debugStructureIterator) System.out.println("readNext inner="+outerCount+" total="+outerCount); outerCount++; } catch (InvalidRangeException e) { log.error("Structure.Iterator.readNext() ",e); throw new IllegalStateException("Structure.Iterator.readNext() ",e); } // cant happen readStart += as.getSize(); readCount = 0; }
private void readNextGeneralRank() throws IOException { try { Section section = new Section(shape); section.setRange( 0, new Range(outerCount, outerCount)); as = (ArrayStructure) read( section); if (NetcdfFile.debugStructureIterator) System.out.println("readNext inner="+outerCount+" total="+outerCount); outerCount++; } catch (InvalidRangeException e) { log.error("Structure.Iterator.readNext() ",e); throw new IllegalStateException("Structure.Iterator.readNext() ",e); } // cant happen readStart += as.getSize(); readCount = 0; }
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 Array reallyRead(CancelTask cancelTask) throws IOException { Variable orgVar = ncd_2dtime.findVariable(mainv.getFullNameEscaped()); int[] orgVarShape = orgVar.getShape(); // calculate shape - wants it "all" (we dont seem to have access to the derived variable, so must construct) int rank = orgVar.getRank()-1; int[] varShape = new int[rank]; varShape[0] = invList.size(); System.arraycopy(orgVarShape, 2, varShape, 1, rank - 1); Array allData = Array.factory(mainv.getDataType(), varShape); int destPos = 0; Section section = new Section(orgVar.getRanges()); // loop over inventory for (Inventory inv : invList) { Array varData; try { section.setRange(0, new Range(inv.run, inv.run)); section.setRange(1, new Range(inv.time, inv.time)); varData = orgVar.read(section); } catch (InvalidRangeException e) { logger.error("read failed", e); throw new IllegalStateException(e.getMessage()); } Array.arraycopy(varData, 0, allData, destPos, (int) varData.getSize()); destPos += varData.getSize(); if ((cancelTask != null) && cancelTask.isCancel()) return null; } return allData; }
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)); } } }
int need = (int) (last - done); // how many to read this time section.setRange(0, new Range(count, count+need-1)); try { bytesDone += recordVar.readToByteChannel( section, channel);
int need = (int) (last - done); // how many to read this time section.setRange(0, new Range(count, count+need-1)); try { bytesDone += recordVar.readToByteChannel( section, channel);
int need = (int) (last - done); // how many to read this time section.setRange(0, new Range(count, count+need-1)); try { bytesDone += recordVar.readToByteChannel( section, channel);
section.setRange(0, range); } catch (InvalidRangeException exception) { throw netcdfFailure(exception);