Write a georeferenced TIFF with snappy

Hi all,

I’m writing you about a pretty urgent matter. I wrote a python script to read two Sentinel-1 IW GRD products that share some area, calibrate them, subset over the common area and write a geotiff.

The problem is that, when opened in SNAP the resulting GeoTIFF is correctly georeferenced, as it retains Tie-Point Grids, but not when opened in ArcGIS.

I have to process the GeoTIFF I write with snappy in another script and write the result as an additional band, using gdal or rasterio. When doing this I’ll just create an exact copy of the original raster (the snappy output) and add my result, so I need it so be georeferenced. Any idea on how to solve this?

Thanks.

Although this is not the most elegant way, the simplest/quickest way I got to achieving this was using gpt with Python subprocess.

I went into SNAP application graph builder and illustrated the entire preprocessing procedure. After, I exported the xml file.

Looking into the xml file, I changed lines Sigma_VV to
${Band}

So that in Python 3, I call:
args = [gpt, xmlFile, '-e', sProduct, tFile, Band, eDEM]
where
xmlFile= path to the xml exported from graph builder
sProduct=’-PsourceProduct=’+sourceFile
tFile=’-PtargetFile=’+targetFile
Band=’-PBand=Sigma0_’+polarization (e.g. “VV”)
eDEM=’-PexternalDEM=’+dem_path

Finally, run subprocess.run(args,shell=False).
This way, we can iterate through any file or polarization using Python.
I’ve attached a sample xml file here. Look for ${} parameters.

Again, this does not a specific solution for your problem, but if this is urgent, this is the quickest way I found.
sen1_preprocessing_set_dem.xml (4.5 KB)

1 Like