private static String getCoregBandName(final Band band) { String bandName = band.getName(); int suffixLoc = bandName.indexOf(StackUtils.MST); if (suffixLoc < 0) { suffixLoc = bandName.indexOf(StackUtils.SLV); } if (suffixLoc < 0) { suffixLoc = bandName.indexOf('_'); } return bandName.substring(0, suffixLoc); }
public CplxContainer(String date, SLCImage metaData, Orbit orbit, Band realBand, Band imagBand) { this.date = date; this.metaData = metaData; this.orbit = orbit; this.realBand = realBand; this.imagBand = imagBand; this.polarisation = OperatorUtils.getPolarizationFromBandName(realBand.getName()); this.subswath = OperatorUtils.getSubswathFromBandName(realBand.getName()); this.name = realBand.getName(); } }
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 Band getComplexSrcBand(final Band iBand) { String name = iBand.getName(); if (name.startsWith("i_")) { name = name.replace("i_", "q_"); } else if (name.startsWith("q_")) { name = name.replace("q_", "i_"); } return srcProduct.getBand(name); }
private String formatName(final Band srcBand) { String name = srcBand.getName(); if (excludeMaster) { // multi-output without master String newName = StackUtils.getBandNameWithoutDate(name); if (name.equals(processedSlaveBand)) { processedSlaveBand = newName; } return newName; } return name; }
/** * 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 void updateListBands(Product product) { listBands.clear(); if(product == null) { return; } for(Band band : product.getBands()) { listBands.add(band.getName()); } }
private static void createUniqueBandName(final Product product, final Band band, final String origName) { int cnt = 1; band.setName(origName); while (product.getBand(band.getName()) != null) { band.setName(origName + cnt); ++cnt; } }
@Override public void undo() throws CannotUndoException { super.undo(); for (Band displacementBand : displacementBands) { if (product.containsBand(displacementBand.getName())) { product.removeBand(displacementBand); } } }
public static void createVirtualIntensityBand(final Product product, final Band band, final String countStr) { final String expression = band.getName() + " * " + band.getName(); final VirtualBand virtBand = new VirtualBand("Intensity" + countStr, ProductData.TYPE_FLOAT32, band.getRasterWidth(), band.getRasterHeight(), expression); virtBand.setUnit(Unit.INTENSITY); virtBand.setDescription("Intensity from complex data"); virtBand.setNoDataValueUsed(true); product.addBand(virtBand); }
public void removeFactorsForCurrentTile(Band targetBand, Tile targetTile, String srcBandName) throws OperatorException { Band sourceBand = sourceProduct.getBand(targetBand.getName()); Tile sourceTile = calibrationOp.getSourceTile(sourceBand, targetTile.getRectangle()); targetTile.setRawSamples(sourceTile.getRawSamples()); } }
public void removeFactorsForCurrentTile(final Band targetBand, final Tile targetTile, final String srcBandName) throws OperatorException { final Band sourceBand = sourceProduct.getBand(targetBand.getName()); final Tile sourceTile = calibrationOp.getSourceTile(sourceBand, targetTile.getRectangle()); targetTile.setRawSamples(sourceTile.getRawSamples()); }
public void removeFactorsForCurrentTile(Band targetBand, Tile targetTile, String srcBandName) throws OperatorException { Band sourceBand = sourceProduct.getBand(targetBand.getName()); Tile sourceTile = calibrationOp.getSourceTile(sourceBand, targetTile.getRectangle()); targetTile.setRawSamples(sourceTile.getRawSamples()); }
public void removeFactorsForCurrentTile(Band targetBand, Tile targetTile, String srcBandName) throws OperatorException { Band sourceBand = sourceProduct.getBand(targetBand.getName()); Tile sourceTile = calibrationOp.getSourceTile(sourceBand, targetTile.getRectangle()); targetTile.setRawSamples(sourceTile.getRawSamples()); } }
@Test public void testdBToLinear() { final Product product = createTestProduct(16, 4); final Band band1 = product.getBandAt(0); band1.setName(band1.getName() + dBStr); band1.setUnit(band1.getUnit() + dBStr); LinearTodBAction.convert(product, band1, false); assertTrue(product.getNumBands() == 2); final Band band2 = product.getBandAt(1); assertTrue(band2.getUnit().equals(Unit.AMPLITUDE)); assertTrue(band2.getName().equals("Amplitude")); }
@Test public void testLinearTodB() { final Product product = createTestProduct(16, 4); final Band band1 = product.getBandAt(0); LinearTodBAction.convert(product, band1, true); assertTrue(product.getNumBands() == 2); final Band band2 = product.getBandAt(1); assertTrue(band2.getUnit().endsWith(dBStr)); assertTrue(band2.getName().endsWith(dBStr)); }
@Test public void testAmplitudeToIntensity() { final Product product = createTestProduct("Amplitude", Unit.AMPLITUDE, 16, 4); final Band band1 = product.getBandAt(0); AmplitudeToIntensityAction.convert(product, band1, false); assertTrue(product.getNumBands() == 2); final Band band2 = product.getBandAt(1); assertTrue(band2.getUnit().contains(Unit.INTENSITY)); assertTrue(band2.getName().endsWith("Intensity")); }