final Band[] mstBands = getBands(srcProduct, sourceProductType, mstBandNames); final String suffix = mstBandNames[0].substring(mstBandNames[0].lastIndexOf('_'), mstBandNames[0].length()); quadSrcBandList.add(new PolSourceBand(srcProduct.getName(), mstBands, suffix)); final Band[] slvBands = getBands(srcProduct, sourceProductType, slvBandNames); final String suf = slvBandNames[0].substring(slvBandNames[0].lastIndexOf('_'), slvBandNames[0].length()); quadSrcBandList.add(new PolSourceBand(slvProd, slvBands, suf)); quadSrcBandList.add(new PolSourceBand(srcProduct.getName(), mstBands, ""));
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { final List<String> targetBandNameList = new ArrayList<>(10); targetBandNameList.add("T11"); targetBandNameList.add("T12_real"); targetBandNameList.add("T12_imag"); targetBandNameList.add("T13_real"); targetBandNameList.add("T13_imag"); targetBandNameList.add("T22"); targetBandNameList.add("T23_real"); targetBandNameList.add("T23_imag"); targetBandNameList.add("T33"); if (outputOrientationAngle) { targetBandNameList.add("Ori_Ang"); } final String[] bandNames = targetBandNameList.toArray(new String[targetBandNameList.size()]); for (PolBandUtils.PolSourceBand bandList : srcBandList) { final Band[] targetBands = OperatorUtils.addBands(targetProduct, bandNames, bandList.suffix); if (outputOrientationAngle) { targetBands[9].setUnit("radians"); } bandList.addTargetBands(targetBands); } }
bandList.addTargetBands(targetBands);
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { for (PolBandUtils.PolSourceBand bandList : srcBandList) { int k = 0; final Band[] targetBands = new Band[4]; for (int i = 0; i < bandList.srcBands.length; ++i) { final String bandName = bandList.srcBands[i].getName(); if (bandName.toLowerCase().contains("_hv") || bandName.toLowerCase().contains("_vh")) { final Band targetBand = new Band( bandName, ProductData.TYPE_FLOAT32, sourceImageWidth, sourceImageHeight); targetBand.setUnit(bandList.srcBands[i].getUnit()); targetProduct.addBand(targetBand); targetBands[k++] = targetBand; } else { ProductUtils.copyBand(bandName, sourceProduct, targetProduct, true); } } bandList.addTargetBands(targetBands); } }
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { final String[] targetBandNames = polDecomp.getTargetBandNames(); for (final PolBandUtils.PolSourceBand bandList : srcBandList) { final Band[] targetBands = new Band[targetBandNames.length]; int i = 0; for (String targetBandName : targetBandNames) { final Band targetBand = new Band(targetBandName + bandList.suffix, ProductData.TYPE_FLOAT32, targetProduct.getSceneRasterWidth(), targetProduct.getSceneRasterHeight()); polDecomp.setBandUnit(targetBandName + bandList.suffix, targetBand); targetBand.setNoDataValueUsed(true); targetBand.setNoDataValue(0); targetProduct.addBand(targetBand); targetBands[i++] = targetBand; } bandList.addTargetBands(targetBands); } }
private void addSelectedBands() throws OperatorException { String[] bandNames = null; boolean copyInputBands = false; if (sourceProductType == PolBandUtils.MATRIX.FULL) { bandNames = PolBandUtils.getT3BandNames(); } else if (PolBandUtils.isDualPol(sourceProductType)) { bandNames = PolBandUtils.getC2BandNames(); } else { copyInputBands = true; } for (PolBandUtils.PolSourceBand bandList : srcBandList) { String suffix = bandList.suffix; if (copyInputBands) { bandNames = new String[bandList.srcBands.length]; int i = 0; for (Band band : bandList.srcBands) { bandNames[i++] = band.getName(); } suffix = ""; } final Band[] targetBands = OperatorUtils.addBands(targetProduct, bandNames, suffix); bandList.addTargetBands(targetBands); } }
private void addBands(final String[] bandNames) { for (PolBandUtils.PolSourceBand bandList : srcBandList) { final java.util.List<Band> tgtBandList = new ArrayList<>(bandNames.length); for (String targetBandName : bandNames) { final Band targetBand = new Band(targetBandName + bandList.suffix, ProductData.TYPE_FLOAT32, targetProduct.getSceneRasterWidth(), targetProduct.getSceneRasterHeight()); if (targetBandName.startsWith("i_") || targetBandName.contains("_real")) { targetBand.setUnit(Unit.REAL); } else if (targetBandName.startsWith("q_") || targetBandName.contains("_imag")) { targetBand.setUnit(Unit.IMAGINARY); } else { targetBand.setUnit(Unit.INTENSITY); } tgtBandList.add(targetBand); targetProduct.addBand(targetBand); } final Band[] targetBands = tgtBandList.toArray(new Band[tgtBandList.size()]); bandList.addTargetBands(targetBands); } }
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { final String[] targetBandNames = polDecomp.getTargetBandNames(); for (final PolBandUtils.PolSourceBand bandList : srcBandList) { final Band[] targetBands = new Band[targetBandNames.length]; int i = 0; for (String targetBandName : targetBandNames) { final Band targetBand = new Band(targetBandName + bandList.suffix, ProductData.TYPE_FLOAT32, targetProduct.getSceneRasterWidth(), targetProduct.getSceneRasterHeight()); polDecomp.setBandUnit(targetBandName + bandList.suffix, targetBand); targetProduct.addBand(targetBand); targetBands[i++] = targetBand; } bandList.addTargetBands(targetBands); } }
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { final String[] targetBandNames = getTargetBandNames(); for (PolBandUtils.PolSourceBand bandList : srcBandList) { final Band[] targetBands = OperatorUtils.addBands(targetProduct, targetBandNames, bandList.suffix); bandList.addTargetBands(targetBands); } if (targetProduct.getNumBands() == 0) { throw new OperatorException("No output bands selected"); } }
/** * Add bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { final String[] targetBandNames = getTargetBandNames(); for (PolBandUtils.PolSourceBand bandList : srcBandList) { final Band[] targetBands = OperatorUtils.addBands(targetProduct, targetBandNames, bandList.suffix); bandList.addTargetBands(targetBands); } }