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

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

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

Array.get1DJavaArray介绍

暂无

代码示例

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

@Override
public void setDataToZero() {
 float[] data = (float[]) dataArray.get1DJavaArray(dataArray.getDataType());
 Arrays.fill(data, 0.0f);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Array hrData = null;
 RadialDatasetSweep.Sweep spn = (RadialDatasetSweep.Sweep)sweeps.get(sweeps.size()-1);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Array hrData = null;
 RadialDatasetSweep.Sweep spn = (RadialDatasetSweep.Sweep)sweeps.get(sweeps.size()-1);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Array hrData = null;
 RadialDatasetSweep.Sweep spn = (RadialDatasetSweep.Sweep)sweeps.get(sweeps.size()-1);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Sweep spn = (Sweep) sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float[]) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Sweep spn = (Sweep)sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
   allData = v.read();
 } catch (IOException e) {
    throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws java.io.IOException {
 Array allData;
 Sweep spn = (Sweep)sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(Float.TYPE);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Sweep spn = (Sweep)sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
   allData = v.read();
 } catch (IOException e) {
    throw new IOException(e.getMessage());
 }
 return (float []) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Sweep spn = (Sweep) sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float[]) allData.get1DJavaArray(float.class);
}

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

public float[] readAllData() throws IOException {
 Array allData;
 Sweep spn = (Sweep) sweeps.get(0);
 Variable v = spn.getsweepVar();
 try {
  allData = v.read();
 } catch (IOException e) {
  throw new IOException(e.getMessage());
 }
 return (float[]) allData.get1DJavaArray(float.class);
}

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

public float[] getAzimuth() throws IOException {
  Array aziData = null;
  try{
    Variable azi = ds.findVariable("Azimuth");
     aziData = azi.read();
  } catch (IOException e) {
    e.printStackTrace();
    meanElevation = 0.0;
  }
  return (float [])aziData.get1DJavaArray(float.class);
}

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

/**
 * @deprecated use get1DJavaArray(DataType wantType)
 */
public Object get1DJavaArray(Class wantType) {
 DataType want = DataType.getType(wantType, isUnsigned());
 return get1DJavaArray(want);
}

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

public float[] getElevation() throws IOException {
 float[] spArray = null;
 try {
  Variable sp = ds.findVariable("elevation");
  Array spData = sp.read();
  sp.setCachedData(spData, false);
  spArray = (float[]) spData.get1DJavaArray(float.class);
 } catch (IOException e) {
  e.printStackTrace();
 }
 return spArray;
}

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

public float[] getElevation() throws IOException {
 float[] spArray = null;
 try {
  Variable sp = ds.findVariable("elevation");
  Array spData = sp.read();
  sp.setCachedData(spData, false);
  spArray = (float[]) spData.get1DJavaArray(float.class);
 } catch (IOException e) {
  e.printStackTrace();
 }
 return spArray;
}

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

public float getRadialDistance(int gate) throws IOException {
  float gateStart =  getRangeToFirstGate();
  Variable gateSize =  ds.findVariable("GateWidth");
  float [] data = (float [])gateSize.read().get1DJavaArray(float.class);
  float dist = gateStart + gate*data[0];
  return dist;
}

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

public float[] getAzimuth() throws IOException {
 Variable sp = ds.findVariable("azimuth");
 Array spData = sp.read();
 sp.setCachedData(spData, false);
 return (float[]) spData.get1DJavaArray(float.class);
}

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

public float getRadialDistance(int gate) throws IOException {
  float gateStart =  getRangeToFirstGate();
  Variable gateSize =  ds.findVariable("GateWidth");
  float [] data = (float [])gateSize.read().get1DJavaArray(float.class);
  float dist = (float)(gateStart + gate*data[0]);
  return dist;
}

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

public float[] getAzimuth() throws IOException {
 Variable sp = ds.findVariable("azimuth");
 Array spData = sp.read();
 sp.setCachedData(spData, false);
 return (float[]) spData.get1DJavaArray(float.class);
}

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

public float[] readData() throws IOException {
 Array allData = null;
 int[] shape = sweepVar.getShape();
 int[] origind = new int[sweepVar.getRank()];
 try {
  allData = sweepVar.read(origind, shape);
 } catch (InvalidRangeException e) {
  throw new IOException(e.getMessage());
 }
 return (float[]) allData.get1DJavaArray(float.class);
}

代码示例来源:origin: org.apache.sis.storage/sis-netcdf

/**
 * Reads all the data for this variable and returns them as an array of a Java primitive type.
 * Multi-dimensional variables are flattened as a one-dimensional array (wrapped in a vector).
 * This method may cache the returned vector, at UCAR library choice.
 */
@Override
public Vector read() throws IOException {
  final Array array = variable.read();                // May be cached by the UCAR library.
  return Vector.create(array.get1DJavaArray(array.getElementType()), variable.isUnsigned());
}

相关文章

微信公众号

最新文章

更多