HorizCoordSys2D(LatLonAxis2D latCoord, LatLonAxis2D lonCoord) { super(null, null, latCoord, lonCoord, null); int[] shape = latCoord.getShape(); // y, x nrows = shape[0]; ncols = shape[1]; }
CoverageCoordAxisBuilder(CoverageCoordAxis from) { this.name = from.name; this.units = from.units; this.description = from.description; this.dataType = from.dataType; this.axisType = from.axisType; this.attributes = from.attributes; this.dependenceType = from.dependenceType; this.spacing = from.spacing; this.values = from.values; this.reader = from.reader; // used only if values == null this.dependsOn = from.dependsOn; this.startValue = from.startValue; this.endValue = from.endValue; this.resolution = from.resolution; this.ncoords = from.ncoords; this.isSubset = from.isSubset; this.timeHelper = from.timeHelper; if (from instanceof LatLonAxis2D) { LatLonAxis2D latlon = (LatLonAxis2D) from; this.shape = latlon.getShape(); this.userObject = latlon.getUserObject(); } }
public double[] readLatLonAxis2DCoordValues(LatLonAxis2D coordAxis) throws IOException { GribCollectionImmutable.VariableIndex vindex = (GribCollectionImmutable.VariableIndex) coordAxis.getUserObject(); int[] shape = coordAxis.getShape(); List<RangeIterator> ranges = new ArrayList<>(); List<Integer> fullShape = new ArrayList<>(); for (Coordinate coord : vindex.getCoordinates()) { ranges.add(new Range(1)); fullShape.add(coord.getNCoords()); } ranges.add(new Range(shape[0])); fullShape.add(shape[0]); ranges.add(new Range(shape[1])); fullShape.add(shape[1]); SectionIterable siter = new SectionIterable(ranges, fullShape); GribDataReader dataReader = GribDataReader.factory(gribCollection, vindex); Array data; try { data = dataReader.readData(siter); // optimize pass in null ?? LOOK old way } catch (InvalidRangeException e) { throw new RuntimeException(e); } return (double[]) data.get1DJavaArray(DataType.DOUBLE); // LOOK lame conversion }
double maxx = LatLonPointImpl.lonNormalFrom(urpt.getLongitude(), lonMinMax.min); int shape[] = lonAxis2D.getShape(); int ny = shape[0]; int nx = shape[1];
for (int shape : latlon2D.getShape()) builder.addShape(shape);