bandStatistics = new ArrayList<>(); for (int j = 0; j < sampleDimensions.length; j++) { bandStatistics.add(new DataPacking.DataStats()); Double max = getDoubleAttribute(sourceVar, NetCDFUtilities.VALID_MAX); if (min != null && max != null) { stats.update(min, max);
this.stats = new DataPacking.DataStats(); for (GridCoverage2D coverage : this.granuleStack.getGranules()) { updateDimensionValues(coverage); if (unitConverter != null) { updatedStats.setMax(unitConverter.convert(updatedStats.getMax())); updatedStats.setMin(unitConverter.convert(updatedStats.getMin()));
statisticsPeriods = new double[]{1 * XAffineTransform.getScaleX0(transform), 1 * XAffineTransform.getScaleY0(transform)}; stats = new DataStats();
/** * Collects stats for future dataPacking from the provided coverage and update the statistics. * * @param coverage The coverage on which the statistics will be collected * @param statsList The list of statistic beans, one per image band */ protected void collectStats(GridCoverage2D coverage, List<DataPacking.DataStats> statsList) { // It will internally take care of noData ImageWorker iw = new ImageWorker(coverage.getRenderedImage()); double[] minimum = iw.getMinimums(); double[] maximum = iw.getMaximums(); int count = Math.min(minimum.length, statsList.size()); for (int i = 0; i < count; i++) { DataPacking.DataStats stats = statsList.get(i); double min = minimum[i]; double max = maximum[i]; stats.update(min, max); } }
/** * Collects stats for future dataPacking from the provided coverage and update * the statistics. * * @param coverage * @param statsParams */ private void collectStats(GridCoverage2D coverage, double[] statsParams) { // It will internally take care of noData ImageWorker iw = new ImageWorker(coverage.getRenderedImage()); double[] minimum = iw.getMinimums(); double[] maximum = iw.getMaximums(); double min = minimum[0]; double max = maximum[0]; stats.update(min,max); }