This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
John- I guess the code is correct if one reads the java doc:@param z_stride use only if z_range is null, then take all z with this stride (1 means all)
So, I guess you'd have to use the stride in the Range instead of in the subset if you wanted to stride a subset of the entire vertical level. Don Don Murray wrote:
John- In ucar.nc2.dt.GeoGrid, the method:public GeoGrid subset(Range t_range, Range z_range, LatLonRect bbox, int z_stride, int y_stride, int x_stride) throws InvalidRangeException {does not handle the case where I have a z_range and z_stride. The code looks like: if ((z_range == null) && (z_stride > 1)) { Dimension zdim = getZDimension(); if (zdim != null) z_range = new Range(0, zdim.getLength() - 1, z_stride); } and should probably look like: if (z_stride > 1) { if (z_range == null) { Dimension zdim = getZDimension(); z_range = new Range( 0, zdim.getLength()-1, z_stride); } else { z_range= new Range( z_range.first(), z_range.last(), z_stride); } } to match the x and y cases. Right now, if z_range is not null, the stride is ignored. Don ************************************************************* Don Murray UCAR Unidata Program address@hidden P.O. Box 3000 (303) 497-8628 Boulder, CO 80307 http://www.unidata.ucar.edu/staff/donm *************************************************************
-- ************************************************************* Don Murray UCAR Unidata Program address@hidden P.O. Box 3000 (303) 497-8628 Boulder, CO 80307 http://www.unidata.ucar.edu/staff/donm *************************************************************