@Override protected void setUp() { _rsBand = new Band("band1", ProductData.TYPE_INT8, 20, 20); _rsBandBlaByte5050 = new Band("Bla", ProductData.TYPE_UINT8, 50, 50); _rsBandBlubbUShort1010 = new Band("Blubb", ProductData.TYPE_UINT16, 10, 10); _rsBandTestShort2020 = new Band("Test", ProductData.TYPE_INT16, 20, 20); _rsBandGnmpfInt1515 = new Band("Gnmpf", ProductData.TYPE_INT32, 15, 15); _rsBandBlimFloat2323 = new Band("Blim", ProductData.TYPE_FLOAT32, 23, 23); _rsBandZippFloat1005 = new Band("Zipp", ProductData.TYPE_FLOAT32, 10, 5); _rsBandBlepDouble100100 = new Band("Blep", ProductData.TYPE_FLOAT64, 100, 100); }
@Override public void initialize() { targetProduct = new Product("Op1Name", "Op1Type", RASTER_WIDTH, RASTER_HEIGHT); targetProduct.addBand(new Band("Op1A", ProductData.TYPE_INT8, RASTER_WIDTH, RASTER_HEIGHT)); }
@Override public void initialize() { targetProduct = new Product("Op1Name", "Op1Type", RASTER_WIDTH, RASTER_HEIGHT); targetProduct.addBand(new Band("Op1A", ProductData.TYPE_INT8, RASTER_WIDTH, RASTER_HEIGHT)); pi = 3.142; }
/** * Creates the forward view 1600 nm band */ private void createForward1600Band() { Band band = new Band(AtsrGBTConstants.FORWARD_1600_REF_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.REFLECTANCE_UNIT); band.setDescription(AtsrGBTConstants.FORWARD_1600_REF_DESCRIPTION); band.setSpectralWavelength(AtsrConstants.BAND_16_WAVELENGTH); band.setSpectralBandwidth(AtsrConstants.BAND_16_WIDTH); addBand(band); }
@Before public void setup() throws Exception { final Rectangle imageBounds = new Rectangle(10, 20); srcGeoCoding = createCrsGeoCoding(imageBounds); final Band srcNode = new Band("srcDummy", ProductData.TYPE_INT8, 10, 20); srcNode.setGeoCoding(srcGeoCoding); srcScene = SceneFactory.createScene(srcNode); final Band destNode = new Band("destDummy", ProductData.TYPE_INT8, 10, 20); destScene = SceneFactory.createScene(destNode); }
private Band addBand(RasterDataNode raster, TimeCoding rasterTimeCoding, String bandName) { final Band band = new Band(bandName, raster.getDataType(), tsProduct.getSceneRasterWidth(), tsProduct.getSceneRasterHeight()); band.setSourceImage(raster.getSourceImage()); ProductUtils.copyRasterDataNodeProperties(raster, band); // todo copy also referenced band in valid pixel expression band.setValidPixelExpression(null); rasterTimeMap.put(band, rasterTimeCoding); tsProduct.addBand(band); return band; }
@Before public void beforeTest() { band = new Band("n", ProductData.TYPE_INT16, 1, 1); band.setRasterData(band.createCompatibleRasterData()); }
@Override public void initialize() throws OperatorException { Product product = new Product("X", "Y", w, h); product.addBand(new Band("A", ProductData.TYPE_INT32, w, h)); product.addBand(new Band("B", ProductData.TYPE_INT32, w, h)); product.addBand(new VirtualBand("C", ProductData.TYPE_INT32, w, h, "A*B")); setTargetProduct(product); } }
private Band createDataBand(int min, int max, String bandName) { final Band band = new Band(bandName, ProductData.TYPE_INT8, PRODUCT_WIDTH, PRODUCT_HEIGHT); final byte[] array = new byte[PRODUCT_WIDTH * PRODUCT_HEIGHT]; fillArray(array, max, min); band.setData(new ProductData.Byte(array)); return band; }
public void testGetPersistabelByObject() { final GeneralFilterBand gfb = new GeneralFilterBand("test1", new Band("b", ProductData.TYPE_UINT16, 2, 2), GeneralFilterBand.OpType.MAX, new Kernel(1,1,new double[1]), 1); final DimapPersistable gfbPersistable = DimapPersistence.getPersistable(gfb); assertNotNull(gfbPersistable); assertTrue(gfbPersistable instanceof GeneralFilterBandPersistable); final ConvolutionFilterBand cfb = new ConvolutionFilterBand("test2", new Band("b", ProductData.TYPE_INT8, 3, 3), new Kernel(2, 2, new double[4]), 1); final DimapPersistable cfbPersistable = DimapPersistence.getPersistable(cfb); assertNotNull(cfbPersistable); assertTrue(cfbPersistable instanceof ConvolutionFilterBandPersistable); }
static private SpectrumBand createBand(int index) { final Band band = new Band("Radiance_" + (index + 1), ProductData.TYPE_INT16, 100, 100); band.setDescription("Radiance for band " + (index + 1)); band.setSpectralWavelength((float) Math.random()); band.setSpectralBandwidth((float) Math.random()); band.setUnit("sr^-1"); if (index == 7) { band.setUnit("dl"); } return new SpectrumBand(band, true); }
public void testCanPersist() { final Band source = new Band("b", ProductData.TYPE_INT8, 2, 2); final GeneralFilterBand gfb = new GeneralFilterBand("test", source, GeneralFilterBand.OpType.MAX, new Kernel(3, 3, new double[3 * 3]), 1); assertTrue(_persistableSpi.canPersist(gfb)); assertFalse(_persistableSpi.canPersist(new ArrayList())); assertFalse(_persistableSpi.canPersist(new Object())); assertFalse(_persistableSpi.canPersist(new Band("b", ProductData.TYPE_INT8, 2, 2))); }
public void testCanPersist() { final Band source = new Band("b", ProductData.TYPE_INT8, 2, 2); final ConvolutionFilterBand cfb = new ConvolutionFilterBand("test", source, new Kernel(2, 2, new double[]{0, 1, 2, 3}), 1); assertTrue(_persistableSpi.canPersist(cfb)); assertFalse(_persistableSpi.canPersist(new ArrayList())); assertFalse(_persistableSpi.canPersist(new Object())); assertFalse(_persistableSpi.canPersist(new Band("b", ProductData.TYPE_INT8, 2, 2))); }
public void testTransferGeoCodingWithSubset() { final Band srcNode = new Band("srcDummy",ProductData.TYPE_INT8, 10,20); srcNode.setGeoCoding(_geoCoding); final Scene srcScene = SceneFactory.createScene(srcNode); final ProductSubsetDef subset = new ProductSubsetDef("subset"); subset.setRegion(10,10,50,50); subset.setSubSampling(2, 3); final Band destNode = new Band("destDummy",ProductData.TYPE_INT8, 10,20); final Scene destScene = SceneFactory.createScene(destNode); srcScene.transferGeoCodingTo(destScene, subset); assertFXYGeoCodingIsCopied((FXYGeoCoding)destNode.getGeoCoding(), subset); }
@Test public void testCanPersist() { final Mask mask = new Mask("b", 2, 2, Mask.RangeType.INSTANCE); assertTrue(_persistableSpi.canPersist(mask)); assertFalse(_persistableSpi.canPersist(new ArrayList())); assertFalse(_persistableSpi.canPersist(new Object())); assertFalse(_persistableSpi.canPersist(new Band("b", ProductData.TYPE_INT8, 2, 2))); }
public void testScalingInitialValues() { Band bandFloat = new Band("radiance_13", ProductData.TYPE_FLOAT32, 10, 10); assertEquals(1.0f, bandFloat.getScalingFactor(), 1e-10f); assertEquals(0.0f, bandFloat.getScalingOffset(), 1e-10f); assertEquals(false, bandFloat.isLog10Scaled()); }
@Override protected void setUp() throws Exception { _targetBand = new Band("b1n", ProductData.TYPE_UINT16, _width, _height); _product1 = new Product("p1", "t", _width, _height); final Band band1 = _product1.addBand("b1", ProductData.TYPE_FLOAT32); final Band band1_3 = _product1.addBand("band1#3", ProductData.TYPE_FLOAT32); _product1.setRefNo(1); _product2 = new Product("p2", "t", _width, _height); _product2.addBand("b1", ProductData.TYPE_FLOAT32); _product2.setRefNo(2); }
public void testSetSpectralBandInfo_notSpectral() { final Band band = new Band("bla", ProductData.TYPE_FLOAT32, 3, 3); final ModisBandDescription description = new ModisBandDescription("", "false", "", "", "", "", "", ""); ModisFileReader.setBandSpectralInformation(description, "", band); assertEquals(-1, band.getSpectralBandIndex()); assertEquals(0.f, band.getSpectralWavelength(), 1e-8); assertEquals(0.f, band.getSpectralBandwidth(), 1e-8); }
private void copyBandTo(Product destP, Band sourceBand) { final Band destBand = new Band(sourceBand.getName(), sourceBand.getDataType(), sourceBand.getRasterWidth(), sourceBand.getRasterHeight()); destBand.setRasterData(sourceBand.getData().createDeepClone()); destP.addBand(destBand); }
public void testSetSpectralBandInfo_fromSpecInfo() { final Band band = new Band("bla", ProductData.TYPE_FLOAT32, 3, 3); final ModisBandDescription description = new ModisBandDescription("", "true", "", "", "", "", "", ""); final ModisSpectralInfo spectralInfo = new ModisSpectralInfo("2", "3", "4"); description.setSpecInfo(spectralInfo); ModisFileReader.setBandSpectralInformation(description, "", band); assertEquals(4, band.getSpectralBandIndex()); assertEquals(2.f, band.getSpectralWavelength(), 1e-8); assertEquals(3.f, band.getSpectralBandwidth(), 1e-8); }