private void showCoords(CoordinateAxis axis, Formatter f) { try { if (axis instanceof CoordinateAxis1D && axis.isNumeric()) { CoordinateAxis1D axis1D = (CoordinateAxis1D) axis; if (!axis1D.isInterval()) { double[] e = axis1D.getCoordEdges(); for (double anE : e) { f.format("%f,", anE); } } else { double[] b1 = axis1D.getBound1(); double[] b2 = axis1D.getBound2(); for (int i = 0; i < b1.length; i++) { f.format("(%f,%f) = %f%n", b1[i], b2[i], b2[i] - b1[i]); } } } else { f.format("%s", NCdumpW.printVariableData(axis, null)); } } catch (IOException ioe) { f.format(ioe.getMessage()); } f.format(" %s%n", axis.getUnitsString()); }
private void showCoords(CoordinateAxis axis, Formatter f) { try { if (axis instanceof CoordinateAxis1D && axis.isNumeric()) { CoordinateAxis1D axis1D = (CoordinateAxis1D) axis; if (!axis1D.isInterval()) { double[] e = axis1D.getCoordEdges(); for (double anE : e) { f.format("%f,", anE); } } else { double[] b1 = axis1D.getBound1(); double[] b2 = axis1D.getBound2(); for (int i=0; i<b1.length; i++) { f.format("(%f,%f) = %f%n", b1[i], b2[i], b2[i] - b1[i]); } } } else { f.format("%s", NCdumpW.printVariableData(axis, null)); } } catch (IOException ioe) { f.format(ioe.getMessage()); } f.format(" %s%n", axis.getUnitsString()); }
private void showCoords(CoordinateAxis axis, Formatter f) { try { if (axis instanceof CoordinateAxis1D && axis.isNumeric()) { CoordinateAxis1D axis1D = (CoordinateAxis1D) axis; if (!axis1D.isInterval()) { double[] e = axis1D.getCoordEdges(); for (double anE : e) { f.format("%f,", anE); } } else { double[] b1 = axis1D.getBound1(); double[] b2 = axis1D.getBound2(); for (int i=0; i<b1.length; i++) { f.format("(%f,%f) = %f%n", b1[i], b2[i], b2[i] - b1[i]); } } } else { f.format("%s", NCdumpW.printVariableData(axis, null)); } } catch (IOException ioe) { f.format(ioe.getMessage()); } f.format(" %s%n", axis.getUnitsString()); }
private void showCoords(CoordinateAxis axis, Formatter f) { try { if (axis instanceof CoordinateAxis1D && axis.isNumeric()) { CoordinateAxis1D axis1D = (CoordinateAxis1D) axis; if (!axis1D.isInterval()) { double[] e = axis1D.getCoordEdges(); for (double anE : e) { f.format("%f,", anE); } } else { double[] b1 = axis1D.getBound1(); double[] b2 = axis1D.getBound2(); for (int i=0; i<b1.length; i++) { f.format("(%f,%f) = %f%n", b1[i], b2[i], b2[i] - b1[i]); } } } else { f.format("%s", NCdumpW.printVariableData(axis, null)); } } catch (IOException ioe) { f.format(ioe.getMessage()); } f.format(" %s%n", axis.getUnitsString()); }
logger.debug("edge time = {}", Arrays.toString(fooTimeAxis.getCoordEdges())); ok &= compare.compareData("time getCoordEdges", fooTimeAxis.getCoordEdges(), new double[] {0.0, 31.0, 59.0, 90.0, 120.0}); logger.debug("edge lat = {}", Arrays.toString(fooLatAxis.getCoordEdges())); ok &= compare.compareData("lat getCoordEdges", fooLatAxis.getCoordEdges(), new double[] {-90.0, -18.0, 36.0, 72.0, 90.0}); logger.debug("edge lon= " + Arrays.toString(fooLonAxis.getCoordEdges())); ok &= compare.compareData("lon getCoordEdges", fooLonAxis.getCoordEdges(), new double[] {0.0, 36.0, 108.0, 216.0, 360.0}); logger.debug("subset edge time = {}", Arrays.toString(fooSubTimeAxis.getCoordEdges())); ok &= compare.compareData("subset time getCoordValues", fooSubTimeAxis.getCoordValues(), new double[] {45.0, 74.5}); ok &= compare.compareData("subset time getCoordEdges", fooSubTimeAxis.getCoordEdges(), new double[] {31.0, 59.0, 90.0}); logger.debug("subset edge lat = {}", Arrays.toString(fooSubLatAxis.getCoordEdges())); ok &= compare.compareData("subset lat getCoordValues", fooSubLatAxis.getCoordValues(), new double[] {9.0, 54.0} ); ok &= compare.compareData("subset lat getCoordEdges", fooSubLatAxis.getCoordEdges(), new double[] {-18.0, 36.0, 72.0} ); logger.debug("subset edge lon = {}", Arrays.toString(fooSubLonAxis.getCoordEdges())); ok &= compare.compareData("subset lon getCoordValues", fooSubLonAxis.getCoordValues(), new double[] {72.0, 162.0, } ); ok &= compare.compareData("subset lon getCoordEdges", fooSubLonAxis.getCoordEdges(), new double[] {36.0, 108.0, 216.0} );
/** * Copy constructor * @param ncd ok to reparent * @param org copy from here */ CoordinateAxis1D(NetcdfDataset ncd, CoordinateAxis1D org) { super(ncd, org); this.orgName = org.orgName; this.cache = new Variable.Cache(); // decouple cache org.setCaching(true); // copy rest of state this.increment = org.getIncrement(); this.isAscending = org.isAscending; this.isInterval = org.isInterval(); this.isRegular = org.isRegular(); this.coords = org.getCoordValues(); this.edge = org.getCoordEdges(); this.names = org.names; if (isInterval) { this.bound1 = org.getBound1(); this.bound2 = org.getBound2(); } this.wasBoundsDone = org.wasBoundsDone; this.wasCalcRegular = org.wasCalcRegular; this.wasRead = org.wasRead; }
CoordinateAxis1D axis1D = (CoordinateAxis1D) dataset.findVariable(varName); if (axis1D.isContiguous()) { double[] edge = axis1D.getCoordEdges(); System.out.printf("%s bounded=%s", varName, bounded); for (int i = 0; i < edge.length; i++)
/** * Copy constructor * * @param ncd ok to reparent * @param org copy from here */ CoordinateAxis1D(NetcdfDataset ncd, CoordinateAxis1D org) { super(ncd, org); this.orgName = org.orgName; this.cache = new Variable.Cache(); // decouple cache org.setCaching(true); // copy rest of state this.increment = org.getIncrement(); this.isAscending = org.isAscending; this.isInterval = org.isInterval(); this.isRegular = org.isRegular(); if (isNumeric()) { this.coords = org.getCoordValues(); this.edge = org.getCoordEdges(); } this.names = org.names; if (isInterval) { this.bound1 = org.getBound1(); this.bound2 = org.getBound2(); } this.wasBoundsDone = org.wasBoundsDone; this.wasCalcRegular = org.wasCalcRegular; this.wasRead = org.wasRead; }
return axis1D.getCoordEdges();
values = axis1D.getCoordEdges(); resolution = (endValue - startValue) / ncoords;