@Test public void testAddVirtualBand_hasFillValueIsAdded() { when(bandDescriptor.hasFillValue()).thenReturn(true); ProductHelper.addVirtualBand(product, bandDescriptor, "2 * source_band"); final Band band = product.getBand(VIRTUAL_BAND_NAME); assertNotNull(band); assertTrue(band.isNoDataValueUsed()); }
static void addVirtualBand(Product product, BandDescriptor descriptor, String bandExpression) { final VirtualBand virtualBand = new VirtualBand(descriptor.getBandName(), ProductData.TYPE_FLOAT32, product.getSceneRasterWidth(), product.getSceneRasterHeight(), bandExpression); final String validPixelExpression = createValidPixelExpression(product, bandExpression); virtualBand.setValidPixelExpression(validPixelExpression); virtualBand.setImageInfo(createImageInfo(virtualBand, descriptor)); virtualBand.setDescription(descriptor.getDescription()); virtualBand.setUnit(descriptor.getUnit()); virtualBand.setGeophysicalNoDataValue(descriptor.getFillValue()); virtualBand.setNoDataValueUsed(descriptor.hasFillValue()); product.addBand(virtualBand); }
ProductHelper { static void addVirtualBand(Product product, BandDescriptor descriptor, String bandExpression) { final VirtualBand virtualBand = new VirtualBand(descriptor.getBandName(), ProductData.TYPE_FLOAT32, product.getSceneRasterWidth(), product.getSceneRasterHeight(), bandExpression); final String validPixelExpression = createValidPixelExpression(product, bandExpression); virtualBand.setValidPixelExpression(validPixelExpression); virtualBand.setImageInfo(createImageInfo(virtualBand, descriptor)); virtualBand.setDescription(descriptor.getDescription()); virtualBand.setUnit(descriptor.getUnit()); virtualBand.setGeophysicalNoDataValue(descriptor.getFillValue()); virtualBand.setNoDataValueUsed(descriptor.hasFillValue()); product.addBand(virtualBand); } }
ProductHelper { static void addVirtualBand(Product product, BandDescriptor descriptor, String bandExpression) { final VirtualBand virtualBand = new VirtualBand(descriptor.getBandName(), ProductData.TYPE_FLOAT32, product.getSceneRasterWidth(), product.getSceneRasterHeight(), bandExpression); final String validPixelExpression = createValidPixelExpression(product, bandExpression); virtualBand.setValidPixelExpression(validPixelExpression); virtualBand.setImageInfo(createImageInfo(virtualBand, descriptor)); virtualBand.setDescription(descriptor.getDescription()); virtualBand.setUnit(descriptor.getUnit()); virtualBand.setGeophysicalNoDataValue(descriptor.getFillValue()); virtualBand.setNoDataValueUsed(descriptor.hasFillValue()); product.addBand(virtualBand); } private  ProductHelper(); }
ProductHelper { static void addVirtualBand(Product product, BandDescriptor descriptor, String bandExpression) { final VirtualBand virtualBand = new VirtualBand(descriptor.getBandName(), ProductData.TYPE_FLOAT32, product.getSceneRasterWidth(), product.getSceneRasterHeight(), bandExpression); final String validPixelExpression = createValidPixelExpression(product, bandExpression); virtualBand.setValidPixelExpression(validPixelExpression); virtualBand.setImageInfo(createImageInfo(virtualBand, descriptor)); virtualBand.setDescription(descriptor.getDescription()); virtualBand.setUnit(descriptor.getUnit()); virtualBand.setGeophysicalNoDataValue(descriptor.getFillValue()); virtualBand.setNoDataValueUsed(descriptor.hasFillValue()); product.addBand(virtualBand); } private  ProductHelper();  }
ProductHelper { static void addVirtualBand(Product product, BandDescriptor descriptor, String bandExpression) { final VirtualBand virtualBand = new VirtualBand(descriptor.getBandName(), ProductData.TYPE_FLOAT32, product.getSceneRasterWidth(), product.getSceneRasterHeight(), bandExpression); final String validPixelExpression = createValidPixelExpression(product, bandExpression); virtualBand.setValidPixelExpression(validPixelExpression); virtualBand.setImageInfo(createImageInfo(virtualBand, descriptor)); virtualBand.setDescription(descriptor.getDescription()); virtualBand.setUnit(descriptor.getUnit()); virtualBand.setGeophysicalNoDataValue(descriptor.getFillValue()); virtualBand.setNoDataValueUsed(descriptor.hasFillValue()); product.addBand(virtualBand); } private  ProductHelper();   }