Easily Parse and Extract BEAM-DIMAP metadata with Python

Hello all,

Just sharing my latest project. It’s a relatively simple project that allows you to quickly extract data from the BEAM-DIMAP files using Python. This includes important data about the scene and processing history. See some samples on the official documentation here.

It’s still a work in progress but right now it’s verified to work with Sentinel-1 data. But I plan on testing it with Sentinel-2, Sentinel-3, and possibly Sentinel-5 if it has .dim files. Though I think Sentinel-5 isn’t officially supported by SNAP.

Link to the github repo:

Some sample code:

    >> dimap = Sentinel1('S1A.dim', 'SLC')
    >>> history = dimap.get_processing_history(5)
    >>> print(history)
    {'node': 'node.5',
    'operator': 'Interferogram',
    'moduleName': 'S1TBX InSAR Tools',
    'moduleVersion': '8.0.3',
    'purpose': 'Compute interferograms from stack of coregistered S-1 images',
    'authors': 'Petar Marinkovic, Jun Lu',
    'version': '1.0',
    'copyright': '2021-07-04T15:29:40.799Z',
    'processingTime': None,
    'sources': {'sourceProduct': 'file:/E:/SAR_Iceland/20190809_20190902_Orb_Stack.dim'},
        {'subtractTopographicPhase': 'false', 'cohWinAz': '2', 'includeCoherence': 'true',
        'srpPolynomialDegree': '5', 'srpNumberPoints': '501', 'cohWinRg': '10',
        'outputElevation': 'false', 'outputLatLon': 'false', 'orbitDegree': '3',
        'squarePixel': 'true', 'subtractFlatEarthPhase': 'true',
        'tileExtensionPercent': '100', 'externalDEMApplyEGM': 'false',
        'demName': 'SRTM 1Sec HGT', 'externalDEMNoDataValue': '0.0'}