public ucar.unidata.geoloc.vertical.VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT) { return new WRFEta(ds, timeDim, vCT.getParameters()); }
isXStag = getParameterBooleanValue(params, IsStaggeredX); isYStag = getParameterBooleanValue(params, IsStaggeredY); isZStag = getParameterBooleanValue(params, IsStaggeredZ); pertVarName = getParameterStringValue(params, PerturbationGeopotentialVariable); baseVarName = getParameterStringValue(params, BaseGeopotentialVariable); units = "m"; //PH and PHB are in m^2/s^2, so dividing by g=9.81 m/s^2 results in meters } else { pertVarName = getParameterStringValue(params, PerturbationPressureVariable); baseVarName = getParameterStringValue(params, BasePressureVariable); units = "Pa"; //P and PB are in Pascals //ADD:safe assumption? grab unit attribute?
ArrayDouble.D3 array; Array pertArray = getTimeSlice(pertVar, timeIndex); Array baseArray = getTimeSlice(baseVar, timeIndex); array = addStagger(array, 2); //assuming x dim index is 2 array = addStagger(array, 1); //assuming y dim index is 1
/** * Get the 1D vertical coordinate array for this time step and point * * @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 { ArrayDouble.D3 data = getCoordinateArray(timeIndex); int[] origin = new int[3]; int[] shape = new int[3]; origin[0]=0; origin[1]=yIndex; origin[2]=xIndex; shape[0] = data.getShape()[0]; shape[1] =1; shape[2] =1; Array tmp = data.section(origin, shape); return (ArrayDouble.D1)tmp.reduce(); }
/** * Extract an Array (with rank reduced by one) from the Variable * for the given time index. * * @param v variable to extract from * @param timeIndex time index * @return Array of data * @throws IOException problem getting Array */ private Array getTimeSlice(Variable v, int timeIndex) throws IOException { //ADD: this would make a good utility method //ADD: use Array.slice? int[] shape = v.getShape(); int[] origin = new int[v.getRank()]; if (getTimeDimension() != null) { int dimIndex = v.findDimensionIndex(getTimeDimension().getShortName()); if (dimIndex >= 0) { shape[dimIndex] = 1; origin[dimIndex] = timeIndex; } } try { return v.read(origin, shape).reduce(); } catch (InvalidRangeException e) { throw new IOException(e); } }
double[] d2 = extrapinterpolate(d); //compute new values
ArrayDouble.D3 array; Array pertArray = getTimeSlice(pertVar, timeIndex); Array baseArray = getTimeSlice(baseVar, timeIndex); array = addStagger(array, 2); //assuming x dim index is 2 array = addStagger(array, 1); //assuming y dim index is 1
/** * Get the 1D vertical coordinate array for this time step and point * * @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 { ArrayDouble.D3 data = getCoordinateArray(timeIndex); int[] origin = new int[3]; int[] shape = new int[3]; origin[0]=0; origin[1]=yIndex; origin[2]=xIndex; shape[0] = data.getShape()[0]; shape[1] =1; shape[2] =1; Array tmp = data.section(origin, shape); return (ArrayDouble.D1)tmp.reduce(); }
/** * Extract an Array (with rank reduced by one) from the Variable * for the given time index. * * @param v variable to extract from * @param timeIndex time index * @return Array of data * @throws IOException problem getting Array */ private Array getTimeSlice(Variable v, int timeIndex) throws IOException { //ADD: this would make a good utility method //ADD: use Array.slice? int[] shape = v.getShape(); int[] origin = new int[v.getRank()]; if (getTimeDimension() != null) { int dimIndex = v.findDimensionIndex(getTimeDimension().getShortName()); if (dimIndex >= 0) { shape[dimIndex] = 1; origin[dimIndex] = timeIndex; } } try { return v.read(origin, shape).reduce(); } catch (InvalidRangeException e) { throw new IOException(e); } }
double[] d2 = extrapinterpolate(d); //compute new values
isXStag = getParameterBooleanValue(params, IsStaggeredX); isYStag = getParameterBooleanValue(params, IsStaggeredY); isZStag = getParameterBooleanValue(params, IsStaggeredZ); pertVarName = getParameterStringValue(params, PerturbationGeopotentialVariable); baseVarName = getParameterStringValue(params, BaseGeopotentialVariable); units = "m"; //PH and PHB are in m^2/s^2, so dividing by g=9.81 m/s^2 results in meters } else { pertVarName = getParameterStringValue(params, PerturbationPressureVariable); baseVarName = getParameterStringValue(params, BasePressureVariable); units = "Pa"; //P and PB are in Pascals //ADD:safe assumption? grab unit attribute?
ArrayDouble.D3 array; Array pertArray = getTimeSlice(pertVar, timeIndex); Array baseArray = getTimeSlice(baseVar, timeIndex); array = addStagger(array, 2); //assuming x dim index is 2 array = addStagger(array, 1); //assuming y dim index is 1
public ucar.unidata.geoloc.vertical.VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT) { return new WRFEta(ds, timeDim, vCT.getParameters()); }
ArrayDouble.D3 data = getCoordinateArray(timeIndex);
/** * Extract an Array (with rank reduced by one) from the Variable * for the given time index. * * @param v variable to extract from * @param timeIndex time index * @return Array of data * @throws IOException problem getting Array */ private Array getTimeSlice(Variable v, int timeIndex) throws IOException { //ADD: this would make a good utility method //ADD: use Array.slice? int[] shape = v.getShape(); int[] origin = new int[v.getRank()]; if (getTimeDimension() != null) { int dimIndex = v.findDimensionIndex(getTimeDimension().getShortName()); if (dimIndex >= 0) { shape[dimIndex] = 1; origin[dimIndex] = timeIndex; } } try { return v.read(origin, shape).reduce(); } catch (InvalidRangeException e) { return null; } }
double[] d2 = extrapinterpolate(d); //compute new values
isXStag = getParameterBooleanValue(params, IsStaggeredX); isYStag = getParameterBooleanValue(params, IsStaggeredY); isZStag = getParameterBooleanValue(params, IsStaggeredZ); pertVarName = getParameterStringValue(params, PerturbationGeopotentialVariable); baseVarName = getParameterStringValue(params, BaseGeopotentialVariable); units = "m"; //PH and PHB are in m^2/s^2, so dividing by g=9.81 m/s^2 results in meters } else { pertVarName = getParameterStringValue(params, PerturbationPressureVariable); baseVarName = getParameterStringValue(params, BasePressureVariable); units = "Pa"; //P and PB are in Pascals //ADD:safe assumption? grab unit attribute?
public ucar.unidata.geoloc.vertical.VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT) { return new WRFEta(ds, timeDim, vCT.getParameters()); }