static String getTypeString(String type, Product product) { final String prodType; if (type == null) { prodType = product.getProductType(); } else { prodType = type; } return prodType; }
private boolean isTimeSerisProduct(Product product) { return product.getProductType().equals(AbstractTimeSeries.TIME_SERIES_PRODUCT_TYPE); } };
public PrintWriter createWriterFor(Product product) throws IOException { String productType = product.getProductType(); final String fileName = String.format(MEASUREMENTS_FILE_NAME_PATTERN, filenamePrefix, productType); File coordinateFile = new File(outputDir, fileName); PrintWriter writer = new PrintWriter(new FileOutputStream(coordinateFile)); writerMap.put(productType, writer); return writer; }
private static String getQcFileType(Product product, ModisProductDescription desc) { final String replaceWith = product.getProductType().substring(1, 2); final String pattern = desc.getExternalGeolocationPattern(); return pattern.replaceFirst("[xX]", replaceWith); }
@Override public String[] getRasterNames(Product product) { final String productType = product.getProductType(); if (rasterNamesMap.containsKey(productType)) { return rasterNamesMap.get(productType); } else { final String[] rasterNames = extractRasterNames(product, aggregatorStrategy); rasterNamesMap.put(productType, rasterNames); return rasterNames; } }
/** * Installs an Envisat-specific pointing factory in the given product. */ public static void initPointingFactory(final Product product) { PointingFactoryRegistry registry = PointingFactoryRegistry.getInstance(); PointingFactory pointingFactory = registry.getPointingFactory(product.getProductType()); product.setPointingFactory(pointingFactory); }
private static void addPointingFactory(final Product product) { PointingFactoryRegistry registry = PointingFactoryRegistry.getInstance(); PointingFactory pointingFactory = registry.getPointingFactory(product.getProductType()); product.setPointingFactory(pointingFactory); }
static ProductIdentifier create(Product product) { String location = getProductLocation(product); return new ProductIdentifier(product.getName(), product.getProductType(), location); }
private boolean isTimeSeriesView(ProductSceneView view) { if (view != null) { final RasterDataNode viewRaster = view.getRaster(); final String viewProductType = viewRaster.getProduct().getProductType(); return !view.isRGB() && viewProductType.equals(AbstractTimeSeries.TIME_SERIES_PRODUCT_TYPE) && TimeSeriesMapper.getInstance().getTimeSeries(view.getProduct()) != null; } return false; }
private void maySetCurrentView(ProductSceneView view) { final String viewProductType = view.getProduct().getProductType(); if (view != currentView && !view.isRGB() && viewProductType.equals(AbstractTimeSeries.TIME_SERIES_PRODUCT_TYPE) && TimeSeriesMapper.getInstance().getTimeSeries(view.getProduct()) != null) { setCurrentView(view); } }
private void initProductTypeParam() { final ParamProperties properties = new ParamProperties(String.class); properties.setNullValueAllowed(false); properties.setEmptyValuesNotAllowed(true); properties.setLabel("Product type"); /*I18N*/ paramProductType = new Parameter("productType", product.getProductType(), properties); }
private void addProductionElements() { //Übernommen Element production = new Element(DimapProductConstants.TAG_PRODUCTION); JDomHelper.addElement(DimapProductConstants.TAG_DATASET_PRODUCER_NAME, DimapProductConstants.DATASET_PRODUCER_NAME, production); JDomHelper.addElement(DimapProductConstants.TAG_PRODUCT_TYPE, getProduct().getProductType(), production); _root.addContent(production); }
@Override public void writeProductBody(ProfileWriteContext ctx, Product p) throws IOException { super.writeProductBody(ctx, p); NFileWriteable writeable = ctx.getNetcdfFileWriteable(); writeable.addGlobalAttribute(PRODUCT_TYPE, p.getProductType()); writeable.addGlobalAttribute("metadata_profile", "beam"); writeable.addGlobalAttribute("metadata_version", "0.5"); }
private static void performBandTest(String filePath) throws IOException { Product product = ProductIO.readProduct(filePath); Band band0 = product.getBandAt(0); double[] times = computeStx(band0); System.out.println(product.getProductType()); System.out.println("band width : " + band0.getSceneRasterWidth()); System.out.println("band height: " + band0.getSceneRasterHeight()); System.out.println(); for (int i = 0; i < times.length; i++) { System.out.println("stx" + i + " : " + times[i]); } System.out.println(); }
@Test public void testGetType() { Product prod; prod = new Product("TestName", "TEST", _sceneWidth, _sceneHeight); assertEquals("TEST", prod.getProductType()); prod = new Product("TestName", "TEST", _sceneWidth, _sceneHeight, null); assertEquals("TEST", prod.getProductType()); }
private ProductDescriptor createProductDescriptor(Product product) { return new ProductDescriptor(product.getName(), product.getProductType(), product.getSceneRasterWidth(), product.getSceneRasterHeight(), createBandDescriptors(), product.getDescription()); }
@Override public void initialize() throws OperatorException { sourceBand = sourceProduct.getBand(bandName); targetProduct = new Product(sourceProduct.getName(), sourceProduct.getProductType(), sourceProduct.getSceneRasterWidth(), sourceProduct.getSceneRasterHeight()); targetBand = targetProduct.addBand(bandName, sourceBand.getDataType()); }
@Override public void initialize() throws OperatorException { targetProduct = new Product(sourceProduct.getName() + "_MulConst", sourceProduct.getProductType(), sourceProduct.getSceneRasterWidth(), sourceProduct.getSceneRasterHeight()); Band[] bands = sourceProduct.getBands(); for (Band sourceBand : bands) { targetProduct.addBand(sourceBand.getName(), sourceBand.getDataType()); } }
@Override public void initialize() throws OperatorException { targetProduct = new Product(sourceProduct1.getName() + "_Add", sourceProduct1.getProductType(), sourceProduct1.getSceneRasterWidth(), sourceProduct1.getSceneRasterHeight()); Band[] bands = sourceProduct1.getBands(); for (Band sourceBand : bands) { targetProduct.addBand(sourceBand.getName(), sourceBand.getDataType()); } }
private void performTest(float accuracy) throws IOException { final Product inProduct = writeReadProduct(); assertEquals(outProduct.getName(), inProduct.getName()); assertEquals(outProduct.getProductType(), inProduct.getProductType()); assertEquals(outProduct.getNumBands(), inProduct.getNumBands()); for (int i = 0; i < outProduct.getNumBands(); i++) { assertEquality(outProduct.getBandAt(i), inProduct.getBandAt(i)); } assertEquals(location, inProduct.getFileLocation()); assertNotNull(inProduct.getGeoCoding()); assertEquality(outProduct.getGeoCoding(), inProduct.getGeoCoding(), accuracy); }