/** * Set the projection information for this dimension. The internal <code>DArray</code> is * retrieved and then the <code>DArrayDimension</code> * associated with the <code>dimension</code> specified is retrieved and the <code>start</code> * <code>stride</code> and <code>stop</code> parameters are passed to its * <code>setProjection()</code> method. * * @param dimension The dimension that is to be modified. * @param start The starting point for the projection of this <code>DArrayDimension</code>. * @param stride The size of the stride for the projection of this <code>DArrayDimension</code>. * @param stop The stopping point for the projection of this <code>DArrayDimension</code>. * @see DArray * @see DArrayDimension */ public void setProjection(int dimension, int start, int stride, int stop) throws InvalidDimensionException, SBHException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); d.setProjection(start, stride, stop); DArray map = (DArray) getVar(dimension + 1); DArrayDimension mapD = map.getDimension(0); mapD.setProjection(start, stride, stop); } catch (NoSuchVariableException e) { throw new InvalidDimensionException("SDGrid.setProjection(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Set the projection information for this dimension. The internal <code>DArray</code> is * retrieved and then the <code>DArrayDimension</code> * associated with the <code>dimension</code> specified is retrieved and the <code>start</code> * <code>stride</code> and <code>stop</code> parameters are passed to its * <code>setProjection()</code> method. * * @param dimension The dimension that is to be modified. * @param start The starting point for the projection of this <code>DArrayDimension</code>. * @param stride The size of the stride for the projection of this <code>DArrayDimension</code>. * @param stop The stopping point for the projection of this <code>DArrayDimension</code>. * @see DArray * @see DArrayDimension */ public void setProjection(int dimension, int start, int stride, int stop) throws InvalidParameterException, SBHException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); d.setProjection(start, stride, stop); DArray map = (DArray) getVar(dimension + 1); DArrayDimension mapD = map.getDimension(0); mapD.setProjection(start, stride, stop); } catch (NoSuchVariableException e) { throw new InvalidParameterException("SDGrid.setProjection(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>stop</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>stop</code> value. */ public int getStop(int dimension) throws InvalidParameterException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStop()); } catch (NoSuchVariableException e) { throw new InvalidParameterException("SDGrid.getStop(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>stride</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>stride</code> value. */ public int getStride(int dimension) throws InvalidParameterException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStride()); } catch (NoSuchVariableException e) { throw new InvalidParameterException("SDGrid.getStride(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>start</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>start</code> value. */ public int getStart(int dimension) throws InvalidDimensionException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStart()); } catch (NoSuchVariableException e) { throw new InvalidDimensionException("SDGrid.getStart(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>stride</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>stride</code> value. */ public int getStride(int dimension) throws InvalidDimensionException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStride()); } catch (NoSuchVariableException e) { throw new InvalidDimensionException("SDGrid.getStride(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>stop</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>stop</code> value. */ public int getStop(int dimension) throws InvalidDimensionException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStop()); } catch (NoSuchVariableException e) { throw new InvalidDimensionException("SDGrid.getStop(): Bad Value for dimension!: " + e.getMessage()); } }
/** * Gets the <b>start</b> value for the projection of the * <code>dimension</code> indicated. The parameter * <code>dimension</code> is checked against the instance of the * <code>SDArray</code> for bounds violation. * * @param dimension The dimension from whose projection to retrieve the * <code>start</code> value. */ public int getStart(int dimension) throws InvalidParameterException { try { DArray a = (DArray) getVar(0); DArrayDimension d = a.getDimension(dimension); return (d.getStart()); } catch (NoSuchVariableException e) { throw new InvalidParameterException("SDGrid.getStart(): Bad Value for dimension!: " + e.getMessage()); } }
if (variable.getEncodedName().equals("lat")) { assertEquals(1, variable.numDimensions()); assertEquals(89, variable.getDimension(0).getSize()); } else if (variable.getEncodedName().equals("lon")) { assertEquals(1, variable.numDimensions()); assertEquals(180, variable.getDimension(0).getSize()); } else if (variable.getEncodedName().equals("time")) { assertEquals(1, variable.numDimensions()); assertEquals(1857, variable.getDimension(0).getSize()); } else if (variable.getEncodedName().equals("time_bnds")) { assertEquals(2, variable.numDimensions()); assertEquals(1857, variable.getDimension(0).getSize()); assertEquals(2, variable.getDimension(1).getSize()); final DArray gridArray = variable.getArray(); assertEquals(3, gridArray.numDimensions()); assertEquals(1857, gridArray.getDimension(0).getSize()); assertEquals(89, gridArray.getDimension(1).getSize()); assertEquals(180, gridArray.getDimension(2).getSize()); final Vector<DArrayDimension> gridMaps = variable.getArrayDims(); testMap(gridMaps.get(0), "time", 1857);
try { DArrayDimension thisDim = arrayVar.getDimension(d); //(DArrayDimension) aDims.nextElement(); SDArray mapArray = (SDArray)getVar(d+1); //e.nextElement(); DArrayDimension mapDim = mapArray.getFirstDimension();
try { DArrayDimension thisDim = arrayVar.getDimension(d); //(DArrayDimension) aDims.nextElement(); SDArray mapArray = (SDArray)getVar(d+1); //e.nextElement(); DArrayDimension mapDim = mapArray.getFirstDimension();