public double getDoubleNext() { count++; currElement = counter.incr(); return maa.getDouble(currElement); }
/** * Get the value as a double for a scalar Variable. May also be one-dimensional of length 1. * * @throws IOException if theres an IO Error * @throws UnsupportedOperationException if not a scalar Variable or one-dimensional of length 1. * @throws ForbiddenConversionException if data type not convertible to double */ public double readScalarDouble() throws IOException { Array data = getScalarData(); return data.getDouble(Index.scalarIndexImmutable); }
public double getDoubleNext() { count++; currElement = counter.incr(); return maa.getDouble(currElement); }
/** * Get member data of type double. * @param m get data from this StructureMembers.Member. Must be of type double. * @return scalar double value */ public double getScalarDouble(StructureMembers.Member m) { Array data = getArray(m); return data.getDouble(Index.scalarIndexImmutable); }
/** * Get member data of type double. * @param m get data from this StructureMembers.Member. Must be of type double. * @return scalar double value */ public double getScalarDouble(StructureMembers.Member m) { Array data = getArray(m); return data.getDouble(Index.scalarIndexImmutable); }
public double getDoubleNext() { count++; currElement = counter.incr(); return maa.getDouble(currElement); }
MStationObsImpl(ucar.unidata.geoloc.Station s, int stationIndex, int obsIndex, List<VariableSimpleIF> dataVariables, StructureMembers sm) throws IOException { super(s, 0, 0); this.stationIndex = stationIndex; this.obsIndex = obsIndex; this.dataVariables = dataVariables; this.sm = sm; // must read the time Array timeData = readData(timeVar, stationIndex, obsIndex); obsTime = timeData.getDouble( timeData.getIndex()); }
/** * Get the value as a double for a scalar Variable. May also be one-dimensional of length 1. * * @throws IOException if theres an IO Error * @throws UnsupportedOperationException if not a scalar Variable or one-dimensional of length 1. * @throws ForbiddenConversionException if data type not convertible to double */ public double readScalarDouble() throws IOException { Array data = getScalarData(); return data.getDouble(Index.scalarIndexImmutable); }
MStationObsImpl(ucar.unidata.geoloc.Station s, int stationIndex, int obsIndex, List<VariableSimpleIF> dataVariables, StructureMembers sm) throws IOException { super(s, 0, 0); this.stationIndex = stationIndex; this.obsIndex = obsIndex; this.dataVariables = dataVariables; this.sm = sm; // must read the time Array timeData = readData(timeVar, stationIndex, obsIndex); obsTime = timeData.getDouble( timeData.getIndex()); }
/** * Get member data of type double. * @param m get data from this StructureMembers.Member. Must be of type double. * @return scalar double value */ public double getScalarDouble(StructureMembers.Member m) { Array data = getArray(m); return data.getDouble(Index.scalarIndexImmutable); }
/** * Get the value as a double for a scalar Variable. May also be one-dimensional of length 1. * * @throws IOException if theres an IO Error * @throws UnsupportedOperationException if not a scalar Variable or one-dimensional of length 1. * @throws ForbiddenConversionException if data type not convertible to double */ public double readScalarDouble() throws IOException { Array data = getScalarData(); return data.getDouble(Index.scalarIndexImmutable); }
MStationObsImpl(ucar.unidata.geoloc.Station s, int stationIndex, int obsIndex, List<VariableSimpleIF> dataVariables, StructureMembers sm) throws IOException { super(s, 0, 0); this.stationIndex = stationIndex; this.obsIndex = obsIndex; this.dataVariables = dataVariables; this.sm = sm; // must read the time Array timeData = readData(timeVar, stationIndex, obsIndex); obsTime = timeData.getDouble( timeData.getIndex()); }
public static double[] getDoubleValues(Attribute attribute) { final Array values = attribute.getValues(); final long size = values.getSize(); final double[] result = new double[(int) size]; for (int i = 0; i < size; i++) { result[i] = values.getDouble(i); } return result; }
public double[] getJavaArrayDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); int count = m.getSize(); Array data = m.getDataArray(); double[] pa = new double[count]; for (int i=0; i<count; i++) pa[i] = data.getDouble( recnum * count + i); return pa; }
public double getScalarDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); Array data = m.getDataArray(); return data.getDouble( recnum * m.getSize()); // gets first one in the array }
public double[] getJavaArrayDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); int count = m.getSize(); Array data = m.getDataArray(); double[] pa = new double[count]; for (int i=0; i<count; i++) pa[i] = data.getDouble( recnum * count + i); return pa; }
public double getScalarDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); Array data = m.getDataArray(); return data.getDouble( recnum * m.getSize()); // gets first one in the array }
public double[] getJavaArrayDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); int count = m.getSize(); Array data = m.getDataArray(); double[] pa = new double[count]; for (int i=0; i<count; i++) pa[i] = data.getDouble( recnum * count + i); return pa; }
public double getScalarDouble(int recnum, StructureMembers.Member m) { if (m.getDataType() != DataType.DOUBLE) throw new IllegalArgumentException("Type is "+m.getDataType()+", must be double"); Array data = m.getDataArray(); return data.getDouble( recnum * m.getSize()); // gets first one in the array }
@org.junit.Test public void testOffsetCompactLayout() throws IOException { try (NetcdfFile ncfile = TestH5.openH5("matlab_cols.mat")) { Variable v = ncfile.findVariable("b"); System.out.printf("%s%n", v); Array data = v.read(); logger.debug("{}", NCdumpW.toString(data, "offset data", null)); Index ii = data.getIndex(); assert (data.getDouble(ii.set(3, 2)) == 12.0); } }