コード例 #1
0
ファイル: Slant2HeightOp.java プロジェクト: ppolabs/jlinda
  private void createTargetProduct() {

    // construct target product
    targetProduct =
        new Product(
            PRODUCT_NAME,
            sourceProduct.getProductType(),
            sourceProduct.getSceneRasterWidth(),
            sourceProduct.getSceneRasterHeight());

    OperatorUtils.copyProductNodes(sourceProduct, targetProduct);

    for (final Band band : targetProduct.getBands()) {
      targetProduct.removeBand(band);
    }

    for (String key : targetMap.keySet()) {
      String bandName = targetMap.get(key).targetBandName_I;
      targetProduct.addBand(bandName, ProductData.TYPE_FLOAT32);
      targetProduct.getBand(bandName).setUnit(Unit.METERS);
    }

    //        targetProduct.setPreferredTileSize(1,1);

  }
コード例 #2
0
ファイル: Slant2HeightOp.java プロジェクト: ppolabs/jlinda
  private void metaMapPut(
      final String tag,
      final MetadataElement root,
      final Product product,
      final HashMap<Integer, CplxContainer> map)
      throws Exception {

    // pull out band names for this product
    final String[] bandNames = product.getBandNames();
    final int numOfBands = bandNames.length;

    // map key: ORBIT NUMBER
    int mapKey = root.getAttributeInt(AbstractMetadata.ABS_ORBIT);

    // metadata: construct classes and define bands
    final String date = OperatorUtils.getAcquisitionDate(root);
    final SLCImage meta = new SLCImage(root);
    final Orbit orbit = new Orbit(root, orbitDegree);

    // TODO: mlook factores are hard-coded for now
    meta.setMlAz(1);
    meta.setMlRg(1);

    Band bandReal = null;
    Band bandImag = null;

    for (int i = 0; i < numOfBands; i++) {
      String bandName = bandNames[i];
      if (bandName.contains(tag) && bandName.contains(date)) {
        final Band band = product.getBandAt(i);
        if (BandUtilsDoris.isBandReal(band)) {
          bandReal = band;
        } else if (product.getBandAt(i).getUnit().contains(Unit.ABS_PHASE)) {
          bandReal = band;
        } else if (BandUtilsDoris.isBandImag(band)) {
          bandImag = band;
        }
      }
    }
    try {
      map.put(mapKey, new CplxContainer(date, meta, orbit, bandReal, bandImag));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }