ucar.ma2.Array.getDouble()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中ucar.ma2.Array.getDouble()方法的一些代码示例,展示了Array.getDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.getDouble()方法的具体详情如下:
包路径:ucar.ma2.Array
类名称:Array
方法名:getDouble

Array.getDouble介绍

[英]Get the array element at the current element of ima, as a double.
[中]获取ima当前元素处的数组元素,作为双精度数组。

代码示例

代码示例来源:origin: edu.ucar/netcdf

public double getDoubleNext() {
 count++;
 currElement = counter.incr();
 return maa.getDouble(currElement);
}

代码示例来源:origin: edu.ucar/cdm

/**
 * 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);
}

代码示例来源:origin: Unidata/thredds

public double getDoubleNext() {
 count++;
 currElement = counter.incr();
 return maa.getDouble(currElement);
}

代码示例来源:origin: Unidata/thredds

/**
 * 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);
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * 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);
}

代码示例来源:origin: edu.ucar/cdm

public double getDoubleNext() {
 count++;
 currElement = counter.incr();
 return maa.getDouble(currElement);
}

代码示例来源:origin: edu.ucar/cdm

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());
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * 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);
}

代码示例来源:origin: edu.ucar/netcdf

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());
}

代码示例来源:origin: edu.ucar/cdm

/**
 * 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);
}

代码示例来源:origin: Unidata/thredds

/**
 * 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);
}

代码示例来源:origin: Unidata/thredds

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());
}

代码示例来源:origin: bcdev/beam

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;
}

代码示例来源:origin: edu.ucar/cdm

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;
}

代码示例来源:origin: edu.ucar/cdm

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
}

代码示例来源:origin: Unidata/thredds

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;
}

代码示例来源:origin: edu.ucar/netcdf

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
}

代码示例来源:origin: edu.ucar/netcdf

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;
}

代码示例来源:origin: Unidata/thredds

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
}

代码示例来源:origin: Unidata/thredds

@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);
 }
}

相关文章

微信公众号

最新文章

更多