use of org.esa.snap.core.datamodel.Product in project s1tbx by senbox-org.
the class TestERSEnvisatProductReader method read.
private Product read(final File file) throws Exception {
final DecodeQualification canRead = readerPlugIn.getDecodeQualification(file);
if (canRead != DecodeQualification.INTENDED) {
throw new Exception("Reader not intended");
}
final ProductReader reader = readerPlugIn.createReaderInstance();
final Product product = reader.readProductNodes(file, null);
if (product == null) {
throw new Exception("Unable to read product");
}
return product;
}
use of org.esa.snap.core.datamodel.Product in project s1tbx by senbox-org.
the class TestERSEnvisatProductReader method testERS2_E2_IMP.
@Test
public void testERS2_E2_IMP() throws Exception {
Product prod = read(ers2_envisat_imp);
final ProductValidator validator = new ProductValidator(prod);
validator.validateProduct();
// validator.validateMetadata();
validator.validateBands(new String[] { "Amplitude", "Intensity" });
}
use of org.esa.snap.core.datamodel.Product in project s1tbx by senbox-org.
the class TestERSEnvisatProductReader method testERS2_ENVISAT_IMM_ZIP.
@Test
public void testERS2_ENVISAT_IMM_ZIP() throws Exception {
Product prod = read(ers2_envisat_imm_zip);
final ProductValidator validator = new ProductValidator(prod);
validator.validateProduct();
// validator.validateMetadata();
validator.validateBands(new String[] { "Amplitude", "Intensity" });
}
use of org.esa.snap.core.datamodel.Product in project s1tbx by senbox-org.
the class TestERSEnvisatProductReader method testERS1_E1_IMP.
@Test
public void testERS1_E1_IMP() throws Exception {
Product prod = read(ers1_envisat_imp);
final ProductValidator validator = new ProductValidator(prod);
validator.validateProduct();
// validator.validateMetadata();
validator.validateBands(new String[] { "Amplitude", "Intensity" });
}
use of org.esa.snap.core.datamodel.Product in project s1tbx by senbox-org.
the class TestCreateStackOp method testForumIssue.
@Test
public void testForumIssue() throws IOException {
Product[] products = new Product[2];
products[0] = ProductIO.readProduct(asarBamFile1);
products[1] = ProductIO.readProduct(asarBamFile2);
assertNotNull(products[0]);
assertNotNull(products[1]);
GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis();
final HashMap<String, Object> parameters = new HashMap<>();
parameters.put("extent", "Master");
parameters.put("initialOffsetMethod", "Product Geolocation");
parameters.put("masterBands", products[0].getBandAt(0).getName() + "," + products[0].getBandAt(1).getName());
parameters.put("resamplingType", "NEAREST_NEIGHBOUR");
parameters.put("sourceBands", products[1].getBandAt(0).getName() + "," + products[1].getBandAt(1).getName());
System.out.println("Creating stack...");
Product outProduct = GPF.createProduct("CreateStack", parameters, products);
File tmpFolder = createTmpFolder("stacks");
ProductIO.writeProduct(outProduct, new File(tmpFolder, "target.dim"), "BEAM-DIMAP", true);
outProduct.dispose();
delete(tmpFolder);
}
Aggregations