private List<CalendarDate> makeTimesFromStrings( VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<>(ncoords); ArrayObject data = (ArrayObject) org.read(); IndexIterator ii = data.getIndexIterator(); for (int i = 0; i < ncoords; i++) { String coordValue = (String) ii.getObjectNext(); CalendarDate cd = makeCalendarDateFromStringCoord( coordValue, org, errMessages); result.add(cd); } return result; }
private List<CalendarDate> makeTimesFromStrings( VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<CalendarDate>(ncoords); ArrayObject data = (ArrayObject) org.read(); IndexIterator ii = data.getIndexIterator(); for (int i = 0; i < ncoords; i++) { String coordValue = (String) ii.getObjectNext(); CalendarDate cd = makeCalendarDateFromStringCoord( coordValue, org, errMessages); result.add(cd); } return result; }
private List<CalendarDate> makeTimesFromStrings( VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<>(ncoords); ArrayObject data = (ArrayObject) org.read(); IndexIterator ii = data.getIndexIterator(); for (int i = 0; i < ncoords; i++) { String coordValue = (String) ii.getObjectNext(); CalendarDate cd = makeCalendarDateFromStringCoord( coordValue, org, errMessages); result.add(cd); } return result; }
@Override public Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { // see if its really a full read if ((null == section) || section.computeSize() == getSize()) return reallyRead(client, cancelTask); if (orgVar == null) return getMissingDataArray(section.getShape()); return orgVar.read(section); }
@Override public Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { // see if its really a full read if ((null == section) || section.computeSize() == getSize()) return reallyRead(client, cancelTask); if (orgVar == null) return getMissingDataArray(section.getShape()); return orgVar.read(section); }
@Override public Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException { // see if its really a full read if ((null == section) || section.computeSize() == getSize()) return reallyRead(client, cancelTask); if (orgVar == null) return getMissingDataArray(section.getShape()); return orgVar.read(section); }
elem.setAttribute("start", Double.toString(axis.getStart())); elem.setAttribute("increment", Double.toString(axis.getIncrement())); elem.setAttribute("npts", Long.toString(v.getSize()));
elem.setAttribute("start", Double.toString(axis.getStart())); elem.setAttribute("increment", Double.toString(axis.getIncrement())); elem.setAttribute("npts", Long.toString(v.getSize()));
elem.setAttribute("start", Double.toString(axis.getStart())); elem.setAttribute("increment", Double.toString(axis.getIncrement())); elem.setAttribute("npts", Long.toString(v.getSize()));
@Override protected Array _read(Section section) throws IOException, InvalidRangeException { // really a full read if ((null == section) || section.computeSize() == getSize()) return _read(); Array result; if (hasCachedData()) result = super._read(section); else result = proxyReader.reallyRead(this, section, null); return convert(result); }
private List<CalendarDate> makeTimesFromChar(VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); int rank = org.getRank(); int strlen = org.getShape(rank - 1); ncoords /= strlen; List<CalendarDate> result = new ArrayList<CalendarDate>(ncoords); ArrayChar data = (ArrayChar) org.read(); ArrayChar.StringIterator ii = data.getStringIterator(); ArrayObject.D1 sdata = new ArrayObject.D1(String.class, ncoords); for (int i = 0; i < ncoords; i++) { String coordValue = ii.next(); CalendarDate cd = makeCalendarDateFromStringCoord(coordValue, org, errMessages); sdata.set(i, coordValue); result.add( cd); } setCachedData(sdata, true); return result; }
private List<CalendarDate> makeTimesFromChar(VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); int rank = org.getRank(); int strlen = org.getShape(rank - 1); ncoords /= strlen; List<CalendarDate> result = new ArrayList<>(ncoords); ArrayChar data = (ArrayChar) org.read(); ArrayChar.StringIterator ii = data.getStringIterator(); ArrayObject.D1 sdata = new ArrayObject.D1(String.class, ncoords); for (int i = 0; i < ncoords; i++) { String coordValue = ii.next(); CalendarDate cd = makeCalendarDateFromStringCoord(coordValue, org, errMessages); sdata.set(i, coordValue); result.add( cd); } setCachedData(sdata, true); return result; }
private List<CalendarDate> makeTimesFromChar(VariableDS org, Formatter errMessages) throws IOException { int ncoords = (int) org.getSize(); int rank = org.getRank(); int strlen = org.getShape(rank - 1); ncoords /= strlen; List<CalendarDate> result = new ArrayList<>(ncoords); ArrayChar data = (ArrayChar) org.read(); ArrayChar.StringIterator ii = data.getStringIterator(); ArrayObject.D1 sdata = (ArrayObject.D1) Array.factory(DataType.STRING, new int[] {ncoords}); for (int i = 0; i < ncoords; i++) { String coordValue = ii.next(); CalendarDate cd = makeCalendarDateFromStringCoord(coordValue, org, errMessages); sdata.set(i, coordValue); result.add( cd); } setCachedData(sdata, true); return result; }
@Override protected Array _read(Section section) throws IOException, InvalidRangeException { // really a full read if ((null == section) || section.computeSize() == getSize()) return _read(); Array result; if (hasCachedData()) result = super._read(section); else result = proxyReader.reallyRead(this, section, null); if (needScaleOffsetMissing) return convertScaleOffsetMissing(result); else if (needEnumConversion) return convertEnums(result); else return result; }
@Override protected Array _read(Section section) throws IOException, InvalidRangeException { // really a full read if ((null == section) || section.computeSize() == getSize()) return _read(); Array result; if (hasCachedData()) result = super._read(section); else result = proxyReader.reallyRead(this, section, null); if (needScaleOffsetMissing) return convertScaleOffsetMissing(result); else if (needEnumConversion) return convertEnums(result); else return result; }
int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<CalendarDate>(ncoords);
int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<>(ncoords);
int ncoords = (int) org.getSize(); List<CalendarDate> result = new ArrayList<>(ncoords);
public void testByteAttribute() throws IOException { String filename = TestOnLocalServer.withHttpPath("dodsC/scanCdmUnitTests/ft/stationProfile/PROFILER_wind_06min_20091030_2330.nc"); NetcdfDataset ncd = NetcdfDataset.openDataset(filename, true, null); assert ncd != null; VariableDS v = (VariableDS) ncd.findVariable("uvQualityCode"); assert v != null; assert v.hasMissing(); int count = 0; Array data = v.read(); IndexIterator ii = data.getIndexIterator(); while (ii.hasNext()) { byte val = ii.getByteNext(); if (v.isMissing(val)) count++; if (val == (byte)-1) assert v.isMissing(val); } System.out.println("size = "+v.getSize()+" missing= "+count); } }
@Test public void testByteAttribute() throws IOException { String filename = TestOnLocalServer.withHttpPath("dodsC/scanCdmUnitTests/ft/stationProfile/PROFILER_wind_06min_20091030_2330.nc"); NetcdfDataset ncd = NetcdfDataset.openDataset(filename, true, null); assert ncd != null; VariableDS v = (VariableDS) ncd.findVariable("uvQualityCode"); assert v != null; assert v.hasMissing(); int count = 0; Array data = v.read(); IndexIterator ii = data.getIndexIterator(); while (ii.hasNext()) { byte val = ii.getByteNext(); if (v.isMissing(val)) count++; if (val == (byte)-1) assert v.isMissing(val); } System.out.println("size = "+v.getSize()+" missing= "+count); } }