@Override public synchronized void computeTileStack(Map<Band, Tile> targetTileMap, Rectangle targetRectangle, ProgressMonitor pm) throws OperatorException { for(Band targetBand : targetProduct.getBands()) { final Tile targetTile = targetTileMap.get(targetBand); //computePattern(targetBand, targetTile); } }
private boolean productHasABSPhase(Product product) { for (Band band : product.getBands()) { if (band.getUnit().contains(Unit.ABS_PHASE)) { return true; } } return false; }
private Band findReferenceBand(Product product, int width) { Band referenceBand = null; for (Band band : product.getBands()) { if (band.getRasterWidth() == width) { referenceBand = band; break; } } return referenceBand; }
private Band findReferenceBand(Product product, int width) { Band referenceBand = null; for (Band band : product.getBands()) { if (band.getRasterWidth() == width) { referenceBand = band; break; } } return referenceBand; }
private Band[] getSourceBands(final String name_prefix) { final Band[] bands = sourceProduct.getBands(); final List<Band> bandList = new ArrayList<>(); for (Band band : bands) { if (!(band instanceof VirtualBand) && band.getName().startsWith(name_prefix)) { bandList.add(band); } } return bandList.toArray(new Band[bandList.size()]); }
private static Band[] getDualPolSrcBands(final Product srcProduct, final String[] srcBandNames) { final List<Band> bandList = new ArrayList<>(); for(Band srcBand : srcProduct.getBands()) { final String bandName = srcBand.getName(); for (String s : srcBandNames) { if(bandName.startsWith(s)) { bandList.add(srcBand); } } } return bandList.toArray(new Band[bandList.size()]); }
private Band getSourceBand(final String subSwathName, final String polarization) { final Band[] sourceBands = sourceProduct.getBands(); for (Band band:sourceBands) { if (band.getName().contains(subSwathName + '_' + polarization)) { return band; } } return null; }
private int getBandRowCount() { int rowCount = 0; if (currentProduct != null) { Band[] bands = currentProduct.getBands(); for (final Band band : bands) { if (shouldDisplayBand(band)) { rowCount++; } } } return rowCount; }
private void updateListBands(Product product) { listBands.clear(); if(product == null) { return; } for(Band band : product.getBands()) { listBands.add(band.getName()); } }
void removeAllVariableConfigBands(Product contextProduct) { Band[] bands = contextProduct.getBands(); for (Band band : bands) { if(band instanceof VariableConfigBand) { contextProduct.removeBand(band); } } }
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; }
/** * Get the number of bands for which statistics are computed. */ void getNumOfBandsForStatistics() { numOfBands = 0; for (Band band : sourceProduct.getBands()) { statisticsBandIndex.put(band.getName(), numOfBands); numOfBands++; } }
private String getSourceBandName(String variable){ String bandName = null; for(Band Band : this.sourceProducts[0].getBands()){ if (variable.equals(Band.getName())) { bandName = Band.getName(); break; } } return bandName; }
private void sortOutSourceProducts() { // check whether there are absolute phases bands in the product Band tempBand = null; for (Band band : sourceProduct.getBands()) { if (band.getUnit() != null && band.getUnit().equals(Unit.ABS_PHASE)) { tempBand = band; } } if (tempBand == null) { throw new OperatorException("Slant2HeightOp requires minimum one 'unwrapped' phase band"); } }
private double computeStepX(Product product){ OptionalDouble result = Arrays.stream(product.getBands()) .mapToDouble(band -> Math.abs(band.getSourceImage().getModel().getImageToModelTransform(0).getScaleX())) .min(); if (result.isPresent()) { return result.getAsDouble(); } else { return this.pixelSizeX; } }
private double computeStepY(Product product){ OptionalDouble result = Arrays.stream(product.getBands()) .mapToDouble(band -> Math.abs(band.getSourceImage().getModel().getImageToModelTransform(0).getScaleY())) .min(); if (result.isPresent()) { return result.getAsDouble(); } else { return this.pixelSizeY; } }
public int getHighestElemSize() { int highestElemSize = 0; for (Band band : srcProduct.getBands()) { if (writer.shouldWrite(band)) { int elemSize = ProductData.getElemSize(band.getDataType()); if (elemSize > highestElemSize) { highestElemSize = elemSize; } } } return highestElemSize; }
private double computeTargetStepX(Product product){ OptionalDouble result = Arrays.stream(product.getBands()) .mapToDouble(band -> band.getSourceImage().getModel().getImageToModelTransform(0).getScaleX()) .min(); if (result.isPresent()) { return result.getAsDouble(); } else { return this.pixelSizeX; } }
private double computeTargetStepY(Product product){ OptionalDouble result = Arrays.stream(product.getBands()) .mapToDouble(band -> band.getSourceImage().getModel().getImageToModelTransform(0).getScaleY()) .min(); if (result.isPresent()) { double signum = Math.signum(product.getBandAt(0).getSourceImage().getModel().getImageToModelTransform(0).getScaleY()); return signum * result.getAsDouble(); } else { return this.pixelSizeY; } }
private void attachNewDimapReaderInstance(Product product, File newFile) throws IOException { DimapProductReader productReader = (DimapProductReader) ProductIO.getProductReader(DimapProductConstants.DIMAP_FORMAT_NAME); productReader.bindProduct(newFile, product); product.setProductReader(productReader); Band[] bands = product.getBands(); for (Band band : bands) { if (band.isSourceImageSet() && band.getSourceImage().getImage(0) instanceof BandOpImage) { band.setSourceImage(null); } } }