cdm/src/main/java/ucar/nc2/dataset/conv/ADASConvention.java
private CoordinateAxis makeCoordAxis(NetcdfDataset ds, String axisName) throws IOException {
    Variable stagV = ds.findVariable(axisName + "_stag");
    Array data_stag = stagV.read();
    int n = (int) data_stag.getSize() - 1;
    DataType dt = DataType.getType(data_stag);
    Array data = Array.factory(dt, new int[]{n});
    Index stagIndex = data_stag.getIndex();
    Index dataIndex = data.getIndex();
    for (int i = 0; i < n; i++) {
      double val = data_stag.getDouble(stagIndex.set(i)) + data_stag.getDouble(stagIndex.set(i + 1));
      data.setDouble(dataIndex.set(i), 0.5 * val);
    }

    DataType dtype = DataType.getType(data);
    String units = ds.findAttValueIgnoreCase(stagV, CDM.UNITS, "m");
    CoordinateAxis v = new CoordinateAxis1D(ds, null, axisName, dtype, axisName, units, "synthesized non-staggered " + axisName + " coordinate");
    v.setCachedData(data, true);
    return v;
  }
private CoordinateAxis makeCoordAxis(NetcdfDataset ds, String axisName) throws IOException {
    Variable stagV = ds.findVariable(axisName + "_stag");
    Array data_stag = stagV.read();
    int n = (int) data_stag.getSize() - 1;
    DataType dt = DataType.getType(data_stag);
    Array data = Array.factory(dt, new int[]{n});
    Index stagIndex = data_stag.getIndex();
    Index dataIndex = data.getIndex();
    for (int i = 0; i < n; i++) {
      double val = data_stag.getDouble(stagIndex.set(i)) + data_stag.getDouble(stagIndex.set(i + 1));
      data.setDouble(dataIndex.set(i), 0.5 * val);
    }

    DataType dtype = DataType.getType(data);
    String units = ds.findAttValueIgnoreCase(stagV, CDM.UNITS, "m");
    CoordinateAxis v = new CoordinateAxis1D(ds, null, axisName, dtype, axisName, units, "synthesized non-staggered " + axisName + " coordinate");
    v.setCachedData(data, true);
    return v;
  }
private CoordinateAxis makeCoordAxis ( NetcdfDataset ds , String axisName ) throws IOException { Variable stagV = ds . findVariable ( axisName + "_stag" ) ; Array data_stag = stagV . read ( ) ; int n = ( int ) data_stag . getSize ( ) - 1 ; DataType dt = DataType . getType ( data_stag ) ; Array data = Array . factory ( dt , new int [ ] { n } ) ; Index stagIndex = data_stag . getIndex ( ) ; Index dataIndex = data . getIndex ( ) ; for ( int i = 0 ; i < n ; i ++ ) { double val = data_stag . getDouble ( stagIndex . set ( i ) ) + data_stag . getDouble ( stagIndex . set ( i + 1 ) ) ; data . setDouble ( dataIndex . set ( i ) , 0.5 * val ) ; } DataType dtype = DataType . getType ( data ) ; String units = ds . findAttValueIgnoreCase ( stagV , CDM . UNITS , "m" ) ; CoordinateAxis v = new CoordinateAxis1D ( ds , null , axisName , dtype , axisName , units , "synthesized non-staggered " + axisName + " coordinate" ) ; v . setCachedData ( data , true ) ; return v ; }
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////