PpeOp extends Operator { static Double getPixelValue(Tile tile, int x, int y) { if ((y >= tile.getMinY()) && (y <= tile.getMaxY())) { return tile.getSampleDouble(x, y); } else { return 0d; } }  @Override void initialize(); @Override void computeTileStack(Map<Band, Tile> targetTiles, Rectangle targetRectangle, ProgressMonitor pm);  }
@Test public void getPixelValueTest() throws IOException, URISyntaxException { String testFilePath = getTestFilePath(TESTFILENAME); Product sourceProduct = ProductIO.readProduct(testFilePath); RasterDataNode rasterDataNode = sourceProduct.getRasterDataNode("Oa11_radiance"); Rectangle expectedRect = new Rectangle(0, 0, 20, 20); MultiLevelImage image = rasterDataNode.getSourceImage(); Raster raster = image.getData(expectedRect); TileImpl sourceTile = new TileImpl(rasterDataNode, raster); Double testValue = PpeOp.getPixelValue(sourceTile, 0, 21); assertEquals(0, testValue, 1e-5); Double testValue2 = PpeOp.getPixelValue(sourceTile, 3, image.getMaxY() + 1); assertEquals(0, testValue2, 1e-5); Double testValue3 = PpeOp.getPixelValue(sourceTile, 8, -1); assertEquals(0, testValue3, 1e-5); Double testValue4 = PpeOp.getPixelValue(sourceTile, 1, 1); assertEquals(10.36252, testValue4, 1e-5); Double testValue5 = PpeOp.getPixelValue(sourceTile, 10, 10); assertEquals(10.47061, testValue5, 1e-5); }