/** * Get the 1D vertical coordinate array for this time step and point * * (needds test!!!) * * @param timeIndex the time index. Ignored if !isTimeDependent(). * @param xIndex the x index * @param yIndex the y index * @return vertical coordinate array * @throws java.io.IOException problem reading data * @throws ucar.ma2.InvalidRangeException _more_ */ public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; ArrayDouble.D1 result = new ArrayDouble.D1(nz); double psVal = ps.getDouble(psIndex.set(yIndex, xIndex)); for (int z = 0; z < nz; z++) { result.set(z, ptop + sigma[z] * (psVal - ptop)); } return result; }
/** * Get the 1D vertical coordinate array for this time step and point * * (needds test!!!) * * @param timeIndex the time index. Ignored if !isTimeDependent(). * @param xIndex the x index * @param yIndex the y index * @return vertical coordinate array * @throws java.io.IOException problem reading data * @throws ucar.ma2.InvalidRangeException _more_ */ public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; ArrayDouble.D1 result = new ArrayDouble.D1(nz); double psVal = ps.getDouble(psIndex.set(yIndex, xIndex)); for (int z = 0; z < nz; z++) { result.set(z, ptop + sigma[z] * (psVal - ptop)); } return result; }
/** * Get the 1D vertical coordinate array for this time step and point * * (needds test!!!) * * @param timeIndex the time index. Ignored if !isTimeDependent(). * @param xIndex the x index * @param yIndex the y index * @return vertical coordinate array * @throws java.io.IOException problem reading data * @throws ucar.ma2.InvalidRangeException _more_ */ public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; ArrayDouble.D1 result = new ArrayDouble.D1(nz); double psVal = ps.getDouble(psIndex.set(yIndex, xIndex)); for (int z = 0; z < nz; z++) { result.set(z, ptop + sigma[z] * (psVal - ptop)); } return result; }
/** * 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_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; int[] shape2D = ps.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { double psVal = ps.getDouble(psIndex.set(y, x)); for (int z = 0; z < nz; z++) { result.set(z, y, x, ptop + sigma[z] * (psVal - ptop)); } } } return result; }
/** * 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_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; int[] shape2D = ps.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { double psVal = ps.getDouble(psIndex.set(y, x)); for (int z = 0; z < nz; z++) { result.set(z, y, x, ptop + sigma[z] * (psVal - ptop)); } } } return result; }
/** * 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_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array ps = readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = sigma.length; int[] shape2D = ps.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { double psVal = ps.getDouble(psIndex.set(y, x)); for (int z = 0; z < nz; z++) { result.set(z, y, x, ptop + sigma[z] * (psVal - ptop)); } } } return result; }