return new ArrayFloat.D3(dimensions[0], dimensions[1], dimensions[2]); } else if (varDataType == DataType.DOUBLE) { return new ArrayDouble.D3(dimensions[0], dimensions[1], dimensions[2]); } else if (varDataType == DataType.BYTE) { return new ArrayByte.D3(dimensions[0], dimensions[1], dimensions[2]);
int nk = shape[2]; array = new ArrayDouble.D3(ni, nj, nk); Index index = array.getIndex();
int nk = shape[2]; array = new ArrayDouble.D3(ni, nj, nk); Index index = array.getIndex();
Index depthIndex = depth.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
int nk = shape[2]; array = new ArrayDouble.D3(ni, nj, nk); Index index = array.getIndex();
Index orogIndex = orogArray.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
Index depthIndex = depth.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
Index orogIndex = orogArray.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
Index depthIndex = depth.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
Index orogIndex = orogArray.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
Index depthIndex = depth.getIndex(); ArrayDouble.D3 height = new ArrayDouble.D3(nz, ny, nx);
/** * 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 ucar.ma2.InvalidRangeException _more_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { // LOOK! we dont know what size to make this !! Array ps = null; // readArray(psVar, timeIndex); Index psIndex = ps.getIndex(); int nz = (int) pressure.getSize(); int[] shape2D = ps.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); IndexIterator ii = pressure.getIndexIterator(); for (int z = 0; z < nz; z++) { double p = ii.getDoubleNext(); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { result.set(z, y, x, p); } } } 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 ucar.ma2.InvalidRangeException _more_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { int nz = (int) pressure.getSize(); int[] shape2D = pressure.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); IndexIterator ii = pressure.getIndexIterator(); for (int z = 0; z < nz; z++) { double p = ii.getDoubleNext(); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { result.set(z, y, x, p); } } } 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 ucar.ma2.InvalidRangeException _more_ */ public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { int nz = (int) pressure.getSize(); int[] shape2D = pressure.getShape(); int ny = shape2D[0]; int nx = shape2D[1]; ArrayDouble.D3 result = new ArrayDouble.D3(nz, ny, nx); IndexIterator ii = pressure.getIndexIterator(); for (int z = 0; z < nz; z++) { double p = ii.getDoubleNext(); for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { result.set(z, y, x, p); } } } return result; }
static ArrayDouble factory( Index index, double [] storage) { if (index instanceof Index0D) { return new ArrayDouble.D0(index, storage); } else if (index instanceof Index1D) { return new ArrayDouble.D1(index, storage); } else if (index instanceof Index2D) { return new ArrayDouble.D2(index, storage); } else if (index instanceof Index3D) { return new ArrayDouble.D3(index, storage); } else if (index instanceof Index4D) { return new ArrayDouble.D4(index, storage); } else if (index instanceof Index5D) { return new ArrayDouble.D5(index, storage); } else if (index instanceof Index6D) { return new ArrayDouble.D6(index, storage); } else if (index instanceof Index7D) { return new ArrayDouble.D7(index, storage); } else { return new ArrayDouble(index, storage); } }
static ArrayDouble factory( Index index, double [] storage) { switch (index.getRank()) { case 0 : return new ArrayDouble.D0(index, storage); case 1 : return new ArrayDouble.D1(index, storage); case 2 : return new ArrayDouble.D2(index, storage); case 3 : return new ArrayDouble.D3(index, storage); case 4 : return new ArrayDouble.D4(index, storage); case 5 : return new ArrayDouble.D5(index, storage); case 6 : return new ArrayDouble.D6(index, storage); case 7 : return new ArrayDouble.D7(index, storage); default : return new ArrayDouble(index, storage); } }
static ArrayDouble factory( Index index, double [] storage) { switch (index.getRank()) { case 0 : return new ArrayDouble.D0(index, storage); case 1 : return new ArrayDouble.D1(index, storage); case 2 : return new ArrayDouble.D2(index, storage); case 3 : return new ArrayDouble.D3(index, storage); case 4 : return new ArrayDouble.D4(index, storage); case 5 : return new ArrayDouble.D5(index, storage); case 6 : return new ArrayDouble.D6(index, storage); case 7 : return new ArrayDouble.D7(index, storage); default : return new ArrayDouble(index, storage); } }