static boolean isValidPixelExpressionUsed(Product product) { if (product != null) { for (final Band band : product.getBands()) { final String expression = band.getValidPixelExpression(); if (expression != null && !expression.trim().isEmpty()) { return true; } } } return false; }
public static void setPixelGeoCoding(final Product product) throws IOException { Band lonBand = null, latBand = null; for (String lonStr : NetcdfConstants.LON_VAR_NAMES) { lonBand = product.getBand(lonStr); if (lonBand != null) break; } for (String latStr : NetcdfConstants.LAT_VAR_NAMES) { latBand = product.getBand(latStr); if (latBand != null) break; } if (latBand != null && lonBand != null) { product.setSceneGeoCoding(new PixelGeoCoding(latBand, lonBand, latBand.getValidPixelExpression(), 5, ProgressMonitor.NULL)); } }
private static List<RasterDataNode> getReferencedValidMasks(final RasterDataNode node) { final Product product = node.getProduct(); final List<RasterDataNode> rasterList = new ArrayList<RasterDataNode>(); if (product != null) { for (int i = 0; i < product.getNumBands(); i++) { final Band band = product.getBandAt(i); if (band != node) { if (isNodeReferencedByExpression(node, band.getValidPixelExpression())) { rasterList.add(band); } } } for (int i = 0; i < product.getNumTiePointGrids(); i++) { final TiePointGrid tiePointGrid = product.getTiePointGridAt(i); if (tiePointGrid != node) { if (isNodeReferencedByExpression(node, tiePointGrid.getValidPixelExpression())) { rasterList.add(tiePointGrid); } } } } return rasterList; }
addEntry("No-data value:", String.valueOf(band.getNoDataValue()), ""); addEntry("Geophysical no-data value:", String.valueOf(band.getGeophysicalNoDataValue()), ""); addEntry("Valid pixel expression:", String.valueOf(band.getValidPixelExpression()), ""); addEntry("Spectral band index:", String.valueOf(band.getSpectralBandIndex()), ""); addEntry("Wavelength:", String.valueOf(band.getSpectralWavelength()), "nm");
targetBand.setValidPixelExpression(srcBand.getValidPixelExpression()); targetBand.setNoDataValue(srcBand.getNoDataValue()); targetBand.setNoDataValueUsed(true);
targetBand.setLog10Scaled(firstSourceBand.isLog10Scaled()); targetBand.setNoDataValue(firstSourceBand.getNoDataValue()); targetBand.setValidPixelExpression(firstSourceBand.getValidPixelExpression()); targetBand.setSpectralWavelength(firstSourceBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(firstSourceBand.getSpectralBandwidth());
realBand.setValidPixelExpression(computedBand.getValidPixelExpression()); realBand.setUnit(computedBand.getUnit()); realBand.setSpectralWavelength(computedBand.getSpectralWavelength());