void updateBands(Product product) { List<String> bandNames = new ArrayList<>(); if (product != null) { ProductNodeGroup<Band> prod = product.getBandGroup(); if (prod != null) { for (int index = 0; index < prod.getNodeCount(); index++) { Band band = prod.get(index); bandNames.add(band.getName()); } } if(this.model != null) { this.model.clear(); for(String band: bandNames){ this.model.addElement(band); } } } }
@Override public void destroy() throws IOException { deleteProductNode(getProductNode().getProduct(), getProductNode().getProduct().getBandGroup(), getProductNode()); }
private RasterDataNode getAnyRasterDataNode(Product product) { RasterDataNode node = null; if (product != null) { final ProductNodeGroup<Band> bandGroup = product.getBandGroup(); if (bandGroup.getNodeCount() == 0) { final ProductNodeGroup<TiePointGrid> tiePointGridGroup = product.getTiePointGridGroup(); if (tiePointGridGroup.getNodeCount() > 0) { node = tiePointGridGroup.get(0); } } else { node = bandGroup.get(0); } } return node; }
private RasterDataNode getAnyRasterDataNode(Product product) { RasterDataNode node = null; if (product != null) { final ProductNodeGroup<Band> bandGroup = product.getBandGroup(); if (bandGroup.getNodeCount() == 0) { final ProductNodeGroup<TiePointGrid> tiePointGridGroup = product.getTiePointGridGroup(); if (tiePointGridGroup.getNodeCount() > 0) { node = tiePointGridGroup.get(0); } } else { node = bandGroup.get(0); } } return node; }
Band band = resampledMaskProduct.getBandGroup().get(0); WriteMaskTilesComputing writeMaskTilesComputing = new WriteMaskTilesComputing(band, tileSize.width, tileSize.height, temporaryParentFolder); temporaryMaskFolder = writeMaskTilesComputing.runTilesInParallel(this.threadCount, this.threadPool);
list.add(new PNGGroup.QL(product.getQuicklookGroup())); if (product.getBandGroup().getNodeCount() > 0) { list.add(new PNGroupingGroup.B(product.getBandGroup())); list.addAll(Arrays.asList(product.getTiePointGridGroup().toArray())); list.addAll(Arrays.asList(product.getQuicklookGroup().toArray())); list.addAll(Arrays.asList(product.getBandGroup().toArray())); list.addAll(Arrays.asList(product.getMaskGroup().toArray()));
DefaultReprojectionSettingsProvider(ImageGeometry imageGeometry) { Band firstBand = sourceProduct.getBandGroup().get(0); MultiLevelModel sourceModel = firstBand.getMultiLevelModel(); MultiLevelModel targetModel = targetProduct.createMultiLevelModel(); Reproject reprojection = new Reproject(targetModel.getLevelCount()); defaultReprojectionSettings = new ReprojectionSettings(null, sourceModel, imageGeometry); defaultReprojectionSettings.setTargetModel(targetModel); defaultReprojectionSettings.setReprojection(reprojection); }
private void refreshGroup() { final ProductNodeGroup<Band> productBandGroup = product.getBandGroup(); if (group != productBandGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productBandGroup.getNodeCount(); i++) { final Band band = productBandGroup.get(i); if (autoGrouping.indexOf(band.getName()) == groupIndex) { group.add(band); } } } } }
sourceMasterProduct.getBand(masterSourceBand) == null) { throw new OperatorException("Band name " + masterSourceBand + " wrong for master product " + sourceMasterProduct.getName() + " having bands : " + Arrays.toString(sourceMasterProduct.getBandGroup().toArray())); sourceSlaveProduct.getName() + " having bands : " + Arrays.toString(sourceSlaveProduct.getBandGroup().toArray()));
referenceBandButton.setEnabled(product.getBandNames().length > 0); final ProductNodeGroup<Band> productBands = product.getBandGroup(); final ProductNodeGroup<TiePointGrid> productTiePointGrids = product.getTiePointGridGroup(); double xOffset = Double.NaN;
private static Band createBandCopy(Product targetProduct, Mask mask) { String bandName = ProductUtils.getAvailableNodeName("mask_" + mask.getName(), targetProduct.getBandGroup()); String maskName = ProductUtils.getAvailableNodeName(mask.getName(), targetProduct.getMaskGroup()); int dataType = mask.getDataType(); Band band = targetProduct.addBand(bandName, dataType); String description = mask.getDescription() + " (from " + mask.getProduct().getDisplayName() + ")"; targetProduct.addMask(maskName, bandName, description, mask.getImageColor(), mask.getImageTransparency()); return band; }
MultiResolutionReprojectionSettingsProvider() { reprojectionSettingsMap = new HashMap<>(); final ProductNodeGroup<Band> sourceBands = sourceProduct.getBandGroup(); if (referenceProduct != null) { for (int i = 0; i < sourceBands.getNodeCount(); i++) { addReprojectionSettingsIfNecessary(sourceBands.get(i), referenceProduct.getBandAt(i)); } } else { for (int i = 0; i < sourceBands.getNodeCount(); i++) { addReprojectionSettingsIfNecessary(sourceBands.get(i), null); } } if (includeTiePointGrids) { if (referenceProduct != null) { final ProductNodeGroup<TiePointGrid> tiePointGridGroup = sourceProduct.getTiePointGridGroup(); for (int i = 0; i < tiePointGridGroup.getNodeCount(); i++) { addReprojectionSettingsIfNecessary(tiePointGridGroup.get(i),referenceProduct.getBandAt(i)); } } else { final ProductNodeGroup<TiePointGrid> tiePointGridGroup = sourceProduct.getTiePointGridGroup(); for (int i = 0; i < tiePointGridGroup.getNodeCount(); i++) { addReprojectionSettingsIfNecessary(tiePointGridGroup.get(i),null); } } } }
referenceBandButton.setEnabled(product.getBandNames().length > 0); final ProductNodeGroup<Band> productBands = product.getBandGroup(); final ProductNodeGroup<TiePointGrid> productTiePointGrids = product.getTiePointGridGroup(); double xOffset = Double.NaN;
@Override protected void onOK() { String uncertaintyExpression = targetExprArea.getText(); Product targetProduct = sourceBand.getProduct(); int width = sourceBand.getRasterWidth(); int height = sourceBand.getRasterHeight(); ProductNodeGroup<Band> bandGroup = targetProduct.getBandGroup(); VirtualBand uncertaintyBand = new VirtualBand(getBandName(), ProductData.TYPE_FLOAT32, width, height, uncertaintyExpression); uncertaintyBand.setDescription("Uncertainty propagated from band " + sourceBand.getName() + " = " + sourceBand.getExpression()); uncertaintyBand.setUnit(sourceBand.getUnit()); uncertaintyBand.setNoDataValue(Double.NaN); uncertaintyBand.setNoDataValueUsed(true); uncertaintyBand.setValidPixelExpression(sourceBand.getValidPixelExpression()); ProductUtils.copySpectralBandProperties(sourceBand, uncertaintyBand); bandGroup.add(uncertaintyBand); sourceBand.addAncillaryVariable(uncertaintyBand, relation); UndoRedo.Manager undoManager = SnapApp.getDefault().getUndoManager(targetProduct); if (undoManager != null) { undoManager.addEdit(new UndoableProductNodeInsertion<>(bandGroup, uncertaintyBand)); } hide(); uncertaintyBand.setModified(true); if (SnapApp.getDefault().getPreferences().getBoolean(BandMathsDialog.PREF_KEY_AUTO_SHOW_NEW_BANDS, true)) { OpenImageViewAction.openImageView(uncertaintyBand); } }
int firstBandCount = firstSourceProduct.getBandGroup().getNodeCount(); for (int i=1; i<this.sourceProducts.length; i++) { int bandCount = this.sourceProducts[i].getBandGroup().getNodeCount(); if (firstBandCount != bandCount) { throw new OperatorException("Different band count.");
ProductNodeGroup<Band> bandGroup = targetProduct.getBandGroup(); bandGroup.add(band);
ProductNodeGroup<Band> bandGroup = product.getBandGroup(); int bandIndex = bandGroup.indexOf(computedBand); bandGroup.remove(computedBand);