cdm/src/main/java/ucar/unidata/geoloc/vertical/HybridSigmaPressure.java
public ArrayDouble.D3 getCoordinateArray(int timeIndex)
          throws IOException, InvalidRangeException {
    Array psArray = readArray(psVar, timeIndex);

    if (null == aArray) {
      aArray = aVar.read();
      bArray = bVar.read();
      //p0 = (p0Var == null) ? 1.0 : p0Var.readScalarDouble();
      p0 = computeP0();
    }

    int nz = (int) aArray.getSize();
    Index aIndex = aArray.getIndex();
    Index bIndex = bArray.getIndex();

    // it's possible to have rank 3 because pressure can have a level, usually 1
    // Check if rank 3 and try to reduce
    if( psArray.getRank() == 3) 
      psArray = psArray.reduce(0);

    int[] shape2D = psArray.getShape();
    int ny = shape2D[0];
    int nx = shape2D[1];

    Index psIndex = psArray.getIndex();

    ArrayDouble.D3 press = new ArrayDouble.D3(nz, ny, nx);

    double ps;
    for (int z = 0; z < nz; z++) {
      double term1 = aArray.getDouble(aIndex.set(z)) * p0;
      
      //AP might need unit conversion
      if(!apUnits.equals(units) ){
    	  term1 = convertPressureToPSUnits(apUnits, term1);
      }
      
      double bz = bArray.getDouble(bIndex.set(z));

      for (int y = 0; y < ny; y++) {
        for (int x = 0; x < nx; x++) {
          ps = psArray.getDouble(psIndex.set( y, x));
          press.set(z, y, x, term1 + bz * ps);
        }
      }
    }

    return press;
  }
public ArrayDouble.D3 getCoordinateArray(int timeIndex)
          throws IOException, InvalidRangeException {
    Array psArray = readArray(psVar, timeIndex);

    if (null == aArray) {
      aArray = aVar.read();
      bArray = bVar.read();
      //p0 = (p0Var == null) ? 1.0 : p0Var.readScalarDouble();
      p0 = computeP0();
    }

    int nz = (int) aArray.getSize();
    Index aIndex = aArray.getIndex();
    Index bIndex = bArray.getIndex();

    // it's possible to have rank 3 because pressure can have a level, usually 1
    // Check if rank 3 and try to reduce
    if( psArray.getRank() == 3) 
      psArray = psArray.reduce(0);

    int[] shape2D = psArray.getShape();
    int ny = shape2D[0];
    int nx = shape2D[1];

    Index psIndex = psArray.getIndex();

    ArrayDouble.D3 press = new ArrayDouble.D3(nz, ny, nx);

    double ps;
    for (int z = 0; z < nz; z++) {
      double term1 = aArray.getDouble(aIndex.set(z)) * p0;
      
      //AP might need unit conversion
      if(!apUnits.equals(units) ){
    	  term1 = convertPressureToPSUnits(apUnits, term1);
      }
      
      double bz = bArray.getDouble(bIndex.set(z));

      for (int y = 0; y < ny; y++) {
        for (int x = 0; x < nx; x++) {
          ps = psArray.getDouble(psIndex.set( y, x));
          press.set(z, y, x, term1 + bz * ps);
        }
      }
    }

    return press;
  }
public ArrayDouble . D3 getCoordinateArray ( int timeIndex ) throws IOException , InvalidRangeException { Array psArray = readArray ( psVar , timeIndex ) ; if ( null == aArray ) { aArray = aVar . read ( ) ; bArray = bVar . read ( ) ; //p0 = (p0Var == null) ? 1.0 : p0Var.readScalarDouble();
 p0 = computeP0 ( ) ; } int nz = ( int ) aArray . getSize ( ) ; Index aIndex = aArray . getIndex ( ) ; Index bIndex = bArray . getIndex ( ) ; // it's possible to have rank 3 because pressure can have a level, usually 1
 // Check if rank 3 and try to reduce
 if ( psArray . getRank ( ) == 3 ) psArray = psArray . reduce ( 0 ) ; int [ ] shape2D = psArray . getShape ( ) ; int ny = shape2D [ 0 ] ; int nx = shape2D [ 1 ] ; Index psIndex = psArray . getIndex ( ) ; ArrayDouble . D3 press = new ArrayDouble . D3 ( nz , ny , nx ) ; double ps ; for ( int z = 0 ; z < nz ; z ++ ) { double term1 = aArray . getDouble ( aIndex . set ( z ) ) * p0 ; //AP might need unit conversion
 if ( ! apUnits . equals ( units ) ) { term1 = convertPressureToPSUnits ( apUnits , term1 ) ; } double bz = bArray . getDouble ( bIndex . set ( z ) ) ; for ( int y = 0 ; y < ny ; y ++ ) { for ( int x = 0 ; x < nx ; x ++ ) { ps = psArray . getDouble ( psIndex . set ( y , x ) ) ; press . set ( z , y , x , term1 + bz * ps ) ; } } } return press ; }
Get the 3D vertical coordinate array for this time step.

@param timeIndex the time index. Ignored if !isTimeDependent().
@return vertical coordinate array
@throws IOException           problem reading data
@throws InvalidRangeException _more_
Get the 3D vertical coordinate array for this time step .