ProductTemporalBinRenderer implements TemporalBinRenderer { @Override public Rectangle getRasterRegion() { return outputRegion; } 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 testRenderBinWithCustomizer() 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, new MyProductCustomizer()); 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"); assertNull(numPasses); Band const3 = product.getBand("const3"); assertNotNull(const3); const3.loadRasterData(); int[] actualConst3Line = new int[region.width]; int[] expectedConst3Line = new int[region.width]; Arrays.fill(expectedConst3Line, 3); for (int y = 0; y < region.height; y++) { const3.readPixels(0, y, region.width, 1, actualConst3Line); assertArrayEquals(expectedConst3Line, actualConst3Line); } }