PpeOp extends Operator { static double[] getPixelList(int x, int y, Tile sourceTile) { double[] pixelList = new double[5]; pixelList[0] = getPixelValue(sourceTile, x, y - 2); pixelList[1] = getPixelValue(sourceTile, x, y - 1); pixelList[2] = getPixelValue(sourceTile, x, y); pixelList[3] = getPixelValue(sourceTile, x, y + 1); pixelList[4] = getPixelValue(sourceTile, x, y + 2); Arrays.sort(pixelList); if (pixelList[0] < 0) { throw new OperatorException("Radiance bands contain values lower than zero at x=" + x + " y=" + y); } return pixelList; }  @Override void initialize(); @Override void computeTileStack(Map<Band, Tile> targetTiles, Rectangle targetRectangle, ProgressMonitor pm);  }
@Test public void getPixelListTest() 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[] pixelList1 = PpeOp.getPixelList(0, 0, sourceTile); assertEquals(0, pixelList1[0], 1e-5); assertEquals(10.39630, pixelList1[2], 1e-5); assertEquals(10.58545, pixelList1[4], 1e-5); double[] pixelList2 = PpeOp.getPixelList(0, 19, sourceTile); assertEquals(0, pixelList2[0], 1e-5); assertEquals(0, pixelList2[1], 1e-5); assertEquals(10.22066, pixelList2[2], 1e-5); }