return getDualPolSrcBands(srcProduct, getComplexBandNames()); } else if (sourceProductType == MATRIX.DUAL_VH_VV) { // dual VH VV return getDualPolSrcBands(srcProduct, getComplexBandNames()); } else if (sourceProductType == MATRIX.DUAL_HH_VV) { // dual HH VV return getDualPolSrcBands(srcProduct, getComplexBandNames()); }else if (sourceProductType == MATRIX.FULL) { // full pol return getQuadPolSrcBands(srcProduct, bandNames); } else if (sourceProductType == MATRIX.C3) { // C3 return getProductBands(srcProduct, bandNames, getC3BandNames()); } else if (sourceProductType == MATRIX.T3) { // T3 return getProductBands(srcProduct, bandNames, getT3BandNames()); } else if (sourceProductType == MATRIX.C4) { return getProductBands(srcProduct, bandNames, getC4BandNames()); } else if (sourceProductType == MATRIX.T4) { return getProductBands(srcProduct, bandNames, getT4BandNames()); } else if (sourceProductType == MATRIX.C2) { // compact pol C2 return getProductBands(srcProduct, bandNames, getC2BandNames()); } else if (sourceProductType == MATRIX.LCHCP) { // LCH compact pol S2 return getProductBands(srcProduct, bandNames, getLCHModeS2BandNames()); } else if (sourceProductType == MATRIX.RCHCP) { // RCH compact pol S2 return getProductBands(srcProduct, bandNames, getRCHModeS2BandNames());
private static String getPolarCase(final Product srcProduct) { final PolBandUtils.MATRIX matrixType = PolBandUtils.getSourceProductType(srcProduct); if (matrixType.equals(PolBandUtils.MATRIX.C4) || matrixType.equals(PolBandUtils.MATRIX.T4)) { return "bistatic"; } return "monostatic"; }
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)); for (String slvProd : slvProductNames) { final String[] slvBandNames = StackUtils.getSlaveBandNames(srcProduct, slvProd); 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)); final Band[] mstBands = getBands(srcProduct, sourceProductType, bandNames); quadSrcBandList.add(new PolSourceBand(srcProduct.getName(), mstBands, ""));
case C2: bandNames = PolBandUtils.getC2BandNames(); matrixType = PolBandUtils.MATRIX.C2; case C3: bandNames = PolBandUtils.getC3BandNames(); matrixType = PolBandUtils.MATRIX.C3; case C4: bandNames = PolBandUtils.getC4BandNames(); matrixType = PolBandUtils.MATRIX.C4; case T3: bandNames = PolBandUtils.getT3BandNames(); matrixType = PolBandUtils.MATRIX.T3; case T4: bandNames = PolBandUtils.getT4BandNames(); matrixType = PolBandUtils.MATRIX.T4;
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); } }
/** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link org.esa.snap.core.datamodel.Product} annotated with the * {@link org.esa.snap.core.gpf.annotations.TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws org.esa.snap.core.gpf.OperatorException If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); validator.checkIfSLC(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); useRCMConvention = Boolean.getBoolean(SystemUtils.getApplicationContextId() + ".hybridmode.useRCMConvention"); if (simulateNoiseFloor) { sigma = Math.sqrt(FastMath.pow(10.0, noisePower / 10.0) / 2.0); } createTargetProduct(); updateTargetProductMetadata(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }
/** * Add C2 or S2 bands to the target product. * * @throws OperatorException The exception. */ private void addSelectedBands() throws OperatorException { if (sourceProductType != PolBandUtils.MATRIX.FULL) { throw new OperatorException("Full polarimetric product is expected."); } String[] bandNames = null; if (outputFormat.equals(C2)) { bandNames = PolBandUtils.getC2BandNames(); addBands(bandNames); mapMatrixElemToBandsC2(); } else { if (compactMode.equals(CompactPolProcessor.lch)) { bandNames = PolBandUtils.getLCHModeS2BandNames(); } else { bandNames = PolBandUtils.getRCHModeS2BandNames(); } addBands(bandNames); mapMatrixElemToBandsS2(); } }
@Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); if (sourceProductType != PolBandUtils.MATRIX.FULL) { throw new OperatorException("Quad-pol source product is expected."); } srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); halfWindowSize = windowSize / 2; sourceImageWidth = sourceProduct.getSceneRasterWidth(); sourceImageHeight = sourceProduct.getSceneRasterHeight(); createTargetProduct(); updateTargetProductMetadata(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }
validator.checkIfSLC(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); if (sourceProductType != PolBandUtils.MATRIX.LCHCP && sourceProductType != PolBandUtils.MATRIX.RCHCP && srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType);
/** * Initializes all the internal file and directory elements from the given output file. This method only must be * called if the product writer should write the given data to raw data files without calling of writeProductNodes. * This may be at the time when a dimap product was opened and the data shold be continously changed in the same * product file without an previous call to the saveProductNodes to this product writer. * * @param outputFile the dimap header file location. */ protected void initDirs(final File outputFile) { super.initDirs(outputFile); final PolBandUtils.MATRIX matrixType = PolBandUtils.getSourceProductType(getSourceProduct()); String folder = ""; if (matrixType.equals(PolBandUtils.MATRIX.C3)) { folder = "C3"; } else if (matrixType.equals(PolBandUtils.MATRIX.T3)) { folder = "T3"; } else if (matrixType.equals(PolBandUtils.MATRIX.C4)) { folder = "C4"; } else if (matrixType.equals(PolBandUtils.MATRIX.T4)) { folder = "T4"; } if (!folder.isEmpty()) { _outputDir = new File(_outputDir, folder); if(!_outputDir.exists() && !_outputDir.mkdirs()) { SystemUtils.LOG.severe("Unable to create folders in "+_outputDir); } _outputFile = new File(_outputDir, outputFile.getName()); } }
/** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link Product} annotated with the * {@link TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws OperatorException If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); validator.checkIfSLC(); validator.checkIfTOPSARBurstProduct(false); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); checkSourceProductType(); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); createTargetProduct(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }
/** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link Product} annotated with the * {@link TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws OperatorException If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); validator.checkIfTOPSARBurstProduct(false); validator.checkIfSLC(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); checkSourceProductType(); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); createTargetProduct(); updateTargetProductMetadata(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }
/** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link Product} annotated with the * {@link TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws OperatorException If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); //validator.checkIfSLC(); validator.checkIfTOPSARBurstProduct(false); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); polDecomp = createDecomposition(); checkSourceProductType(sourceProductType); createTargetProduct(); updateTargetProductMetadata(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }
isComplex = validator.isComplex(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType);
validator.checkIfSLC(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); if (sourceProductType != PolBandUtils.MATRIX.LCHCP && sourceProductType != PolBandUtils.MATRIX.RCHCP && sourceProductType != PolBandUtils.MATRIX.C2) { srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType);
/** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link Product} annotated with the * {@link TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws OperatorException If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { final InputProductValidator validator = new InputProductValidator(sourceProduct); validator.checkIfSARProduct(); //validator.checkIfSLC(); validator.checkIfTOPSARBurstProduct(false); sourceImageWidth = sourceProduct.getSceneRasterWidth(); sourceImageHeight = sourceProduct.getSceneRasterHeight(); sourceProductType = PolBandUtils.getSourceProductType(sourceProduct); checkSourceProductType(sourceProductType); srcBandList = PolBandUtils.getSourceBands(sourceProduct, sourceProductType); createTargetProduct(); speckleFilter = createFilter(); } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } }