本文整理了Java中ucar.ma2.Index.set()
方法的一些代码示例,展示了Index.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.set()
方法的具体详情如下:
包路径:ucar.ma2.Index
类名称:Index
方法名:set
[英]set current element at dimension 0 to v0
[中]将维度0处的当前元素设置为v0
代码示例来源:origin: omero/server
protected Object getObject(Array array) {
Index index = array.getIndex();
index.set(0);
return array.getObject(index);
}
代码示例来源:origin: omero/server
protected long getLong(Array array) {
Index index = array.getIndex();
index.set(0);
long targetId = array.getLong(index);
return targetId;
}
代码示例来源:origin: Unidata/thredds
private void dump(Array data, int col) {
int[] shape = data.getShape();
Index ima = data.getIndex();
for (int j = 0; j < shape[0]; j++) {
float dd = data.getFloat(ima.set(j, col));
System.out.println(j + " value= " + dd);
}
}
代码示例来源:origin: Unidata/thredds
Array convertReference(Array refArray) throws java.io.IOException {
int nelems = (int) refArray.getSize();
Index ima = refArray.getIndex();
String[] result = new String[nelems];
for (int i = 0; i < nelems; i++) {
long reference = refArray.getLong(ima.set(i));
String name = headerParser.getDataObjectName(reference);
result[i] = name != null ? name : Long.toString(reference);
if (debugVlen) System.out.printf(" convertReference 0x%x to %s %n", reference, result[i]);
}
return Array.factory(DataType.STRING, new int[]{nelems}, result);
}
代码示例来源:origin: edu.ucar/netcdf
public float getT(String tName, int swpNumber, int ray) throws IOException {
Array timeData = ds.findVariable(tName).read();
Index timeIndex = timeData.getIndex();
return timeData.getFloat(timeIndex.set(swpNumber, ray));
}
代码示例来源:origin: edu.ucar/cdm
public float getRadialDist(String dName, int gate) throws IOException {
Array data = ds.findVariable(dName).read();
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: edu.ucar/netcdf
public float getRadialDist(String dName, int gate) throws IOException {
Array data = ds.findVariable(dName).read();
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: edu.ucar/cdm
public float getT(String tName, int swpNumber, int ray) throws IOException {
Array timeData = ds.findVariable(tName).read();
Index timeIndex = timeData.getIndex();
return timeData.getFloat(timeIndex.set(swpNumber, ray));
}
代码示例来源:origin: Unidata/thredds
public float getRadialDist(String dName, int gate) throws IOException {
Array data = ds.findVariable(dName).read();
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: edu.ucar/cdm
public float getRadialDistance(int gate) throws IOException {
Variable sp = ds.findVariable("gate");
Array spData = sp.read();
sp.setCachedData(spData, false);
Index index = spData.getIndex();
return spData.getFloat(index.set(gate));
}
代码示例来源:origin: Unidata/thredds
public float getAzimuth(int ray) throws IOException {
Variable sp = ds.findVariable("azimuth");
Array spData = sp.read();
sp.setCachedData(spData, false);
Index index = spData.getIndex();
return spData.getFloat(index.set(ray));
}
代码示例来源:origin: edu.ucar/cdm
public float getRadialDist(String dName, int gate) throws IOException {
Variable dvar = ds.findVariable(dName);
Array data = dvar.read();
dvar.setCachedData(data, false);
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: edu.ucar/netcdf
public float getT(String tName, int swpNumber, int ray) throws IOException {
Variable tvar = ds.findVariable(tName);
Array timeData = tvar.read();
tvar.setCachedData(timeData, false);
Index timeIndex = timeData.getIndex();
return timeData.getFloat(timeIndex.set(swpNumber, ray));
}
代码示例来源:origin: edu.ucar/cdm
public float getT(String tName, int swpNumber, int ray) throws IOException {
Variable tvar = ds.findVariable(tName);
Array timeData = tvar.read();
tvar.setCachedData(timeData, false);
Index timeIndex = timeData.getIndex();
return timeData.getFloat(timeIndex.set(swpNumber, ray));
}
代码示例来源:origin: edu.ucar/cdm
public float getTime(int ray) throws IOException {
Variable sp = ds.findVariable("rays_time");
Array timeData = sp.read();
sp.setCachedData(timeData, false);
Index index = timeData.getIndex();
return timeData.getFloat(index.set(ray));
}
代码示例来源:origin: Unidata/thredds
public float getRadialDistance(int gate) throws IOException {
Variable sp = ds.findVariable("gate");
Array spData = sp.read();
sp.setCachedData(spData, false);
Index index = spData.getIndex();
return spData.getFloat(index.set(gate));
}
代码示例来源:origin: Unidata/thredds
public float getTime(int ray) throws IOException {
Variable sp = ds.findVariable("rays_time");
Array timeData = sp.read();
sp.setCachedData(timeData, false);
Index index = timeData.getIndex();
return timeData.getFloat(index.set(ray));
}
代码示例来源:origin: Unidata/thredds
public float getRadialDist(String dName, int gate) throws IOException {
Variable dvar = ds.findVariable(dName);
Array data = dvar.read();
dvar.setCachedData(data, false);
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: edu.ucar/netcdf
public float getRadialDist(String dName, int gate) throws IOException {
Variable dvar = ds.findVariable(dName);
Array data = dvar.read();
dvar.setCachedData(data, false);
Index index = data.getIndex();
return data.getFloat(index.set(gate));
}
代码示例来源:origin: Unidata/thredds
@org.junit.Test
public void testSuperblockIsOffset() throws IOException {
try (NetcdfFile ncfile = TestH5.openH5("superblockIsOffsetNPP.h5")) {
Variable v = ncfile.findVariable("BeamTime");
System.out.printf("%s%n", v);
Array data = v.read();
logger.debug("{}", NCdumpW.toString(data, "offset data", null));
Index ii = data.getIndex();
assert (data.getLong(ii.set(11, 93)) == 1718796166693743L);
}
}
内容来源于网络,如有侵权,请联系作者删除!