ProductTemporalBinRenderer implements TemporalBinRenderer { @Override public void renderBin(int x, int y, TemporalBin temporalBin, Vector outputVector) throws IOException { if (y != yLast) { completeLine(); yLast = y; } setData(x, temporalBin, outputVector); } ProductTemporalBinRenderer(String[] featureNames,
                                      File outputFile,
                                      String outputFormat,
                                      Rectangle outputRegion,
                                      double pixelSize,
                                      ProductData.UTC startTime,
                                      ProductData.UTC endTime,
                                      ProductCustomizer productCustomizer,
                                      MetadataElement... metadataElements); @Override Rectangle getRasterRegion(); @Override void begin(); @Override void end(); @Override void renderBin(int x, int y, TemporalBin temporalBin, Vector outputVector); @Override void renderMissingBin(int x, int y);  }
@Test public void testRenderBin() throws Exception { File tempFile = File.createTempFile("BEAM", ".nc"); tempFile.deleteOnExit(); BinningContextImpl binningContext = new BinningContextImpl(new SEAGrid(10), new BinManager(), CompositingType.BINNING, 1, -1, null, null); ProductTemporalBinRenderer binRenderer = createBinRenderer(tempFile, binningContext, null); Rectangle region = binRenderer.getRasterRegion(); Product product = renderBins(tempFile, binRenderer, region); Band numObs = product.getBand("num_obs"); numObs.loadRasterData(); int[] actualObsLine = new int[region.width]; int[] expectedObsLine = new int[region.width]; for (int y = 0; y < region.height; y++) { numObs.readPixels(0, y, region.width, 1, actualObsLine); Arrays.fill(expectedObsLine, y); if (y == 3) { expectedObsLine[0] = -1; } assertArrayEquals(expectedObsLine, actualObsLine); } Band numPasses = product.getBand("num_passes"); numPasses.loadRasterData(); int[] actualPassesLine = new int[region.width]; int[] expectedPassesLine = new int[region.width]; for (int y = 0; y < region.height; y++) { numPasses.readPixels(0, y, region.width, 1, actualPassesLine); Arrays.fill(expectedPassesLine, y+1); if (y == 3) { expectedPassesLine[0] = -1; } assertArrayEquals("row=" + y, expectedPassesLine, actualPassesLine); } }