cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis2D.java
static public ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy) {
    int[] shape = midy.getShape();
    int ny = shape[0];
    int nx = shape[1];
    ArrayDouble.D2 edgey = new ArrayDouble.D2(ny + 2, nx + 1);

    // compute the interior rows
    for (int y = 0; y < ny; y++) {
      for (int x = 1; x < nx; x++) {
        double yval = (midy.get(y, x - 1) + midy.get(y, x)) / 2;
        edgey.set(y + 1, x, yval);
      }
      edgey.set(y + 1, 0, midy.get(y, 0) - (edgey.get(y + 1, 1) - midy.get(y, 0)));
      edgey.set(y + 1, nx, midy.get(y, nx - 1) - (edgey.get(y + 1, nx - 1) - midy.get(y, nx - 1)));
    }

    // compute the first row
    for (int x = 0; x < nx; x++) {
      double pt0 = midy.get(0, x);
      double pt = edgey.get(2, x);

      double diff = pt0 - pt;
      edgey.set(0, x, pt0 + diff);
    }

    // compute the last row
    for (int x = 0; x < nx - 1; x++) {
      double pt0 = midy.get(ny - 1, x);
      double pt = edgey.get(ny - 1, x);

      double diff = pt0 - pt;
      edgey.set(ny + 1, x, pt0 + diff);
    }

    return edgey;
  }
static public ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy) {
    int[] shape = midy.getShape();
    int ny = shape[0];
    int nx = shape[1];
    ArrayDouble.D2 edgey = new ArrayDouble.D2(ny + 2, nx + 1);

    // compute the interior rows
    for (int y = 0; y < ny; y++) {
      for (int x = 1; x < nx; x++) {
        double yval = (midy.get(y, x - 1) + midy.get(y, x)) / 2;
        edgey.set(y + 1, x, yval);
      }
      edgey.set(y + 1, 0, midy.get(y, 0) - (edgey.get(y + 1, 1) - midy.get(y, 0)));
      edgey.set(y + 1, nx, midy.get(y, nx - 1) - (edgey.get(y + 1, nx - 1) - midy.get(y, nx - 1)));
    }

    // compute the first row
    for (int x = 0; x < nx; x++) {
      double pt0 = midy.get(0, x);
      double pt = edgey.get(2, x);

      double diff = pt0 - pt;
      edgey.set(0, x, pt0 + diff);
    }

    // compute the last row
    for (int x = 0; x < nx - 1; x++) {
      double pt0 = midy.get(ny - 1, x);
      double pt = edgey.get(ny - 1, x);

      double diff = pt0 - pt;
      edgey.set(ny + 1, x, pt0 + diff);
    }

    return edgey;
  }
static public ArrayDouble . D2 makeYEdgesRotated ( ArrayDouble . D2 midy ) { int [ ] shape = midy . getShape ( ) ; int ny = shape [ 0 ] ; int nx = shape [ 1 ] ; ArrayDouble . D2 edgey = new ArrayDouble . D2 ( ny + 2 , nx + 1 ) ; // compute the interior rows
 for ( int y = 0 ; y < ny ; y ++ ) { for ( int x = 1 ; x < nx ; x ++ ) { double yval = ( midy . get ( y , x - 1 ) + midy . get ( y , x ) ) / 2 ; edgey . set ( y + 1 , x , yval ) ; } edgey . set ( y + 1 , 0 , midy . get ( y , 0 ) - ( edgey . get ( y + 1 , 1 ) - midy . get ( y , 0 ) ) ) ; edgey . set ( y + 1 , nx , midy . get ( y , nx - 1 ) - ( edgey . get ( y + 1 , nx - 1 ) - midy . get ( y , nx - 1 ) ) ) ; } // compute the first row
 for ( int x = 0 ; x < nx ; x ++ ) { double pt0 = midy . get ( 0 , x ) ; double pt = edgey . get ( 2 , x ) ; double diff = pt0 - pt ; edgey . set ( 0 , x , pt0 + diff ) ; } // compute the last row
 for ( int x = 0 ; x < nx - 1 ; x ++ ) { double pt0 = midy . get ( ny - 1 , x ) ; double pt = edgey . get ( ny - 1 , x ) ; double diff = pt0 - pt ; edgey . set ( ny + 1 , x , pt0 + diff ) ; } return edgey ; }
Experimental: for WRF rotated (NMM "E") Grids

@param midy y coordinates of midpoints
@return y coordinates of edges with shape (ny+2, nx+1)
Experimental : for WRF rotated ( NMM E ) Grids