does not save all the input metadata data


I am using to create a subset of sentintel 1 images. However, it does not save all the metadata from the imput datasets, loosing that under the Original_Product_Metadata, which has the calibration files needed to perform the radiometric calibration of the radar data.

Any help will be really appreciated.

what is the output format of your subset image?

BEAM-DIMAP format.

are you working with SLC or GRD data?

With GRD data

can you please share the script you use?

import os
import sys
import snappy
from snappy import ProductIO, WKTReader

SubsetOp = snappy.jpy.get_type(‘org.esa.snap.core.gpf.common.SubsetOp’)

if len(sys.argv) != 3:
print(“usage: s <file> <geometry-wkt>" sys.argv[0])
print(” s ./TEST.N1 \"POLYGON((15.786082 45.30223, 11.798364 46.118263, 10.878688 43.61961, 14.722727" "42.85818, 15.786082 45.30223))\"" sys.argv[0])

file_path = os.getcwd()
file = file_path + ‘\’ + sys.argv[1]

print("filename: ", filename)

wkt = sys.argv[2]

geom = WKTReader().read(wkt)


product = ProductIO.readProduct(file)

op = SubsetOp()

sub_product = op.getTargetProduct()


ProductIO.writeProduct(sub_product, ‘…/R03_Subset/’+filename+’_subset.dim’, ‘BEAM-DIMAP’)


Hi Andreas,

Some of the symbols in the print function have been corrupted in the copy/paste. Nevertheless the script is in this link:

Thanks and regards.

let’s wait for @marpet then who created this script :slight_smile:

Hi palejandro,

Try adding


to the code.

I’ve updated the script in the repository too.

It works. Thank you very much.