Update S1 metadata files after crop with external tools

Currently, subset operator seems to be broken. This turns any pipeline into quite a problem, because the whole product needs to be processed. I was wondering if there is any way to update noise and calibration xmls with a product subset through other manners after a product has been cropped with rasterio or GDAL. I tried to look over the Subset Operator but found nothing relevant.

Note: I am using SNAP in a Docker through the GPT tool, not the GUI version

With ESA BEAM, I had products generated with 3rd party tools that lacked metadata, so used beampy to copy the GeoCoding. If you can use the GUI once to get a product with the correct GeoCoding you might be able to update products created with GPT.

# read a sourceProduct, copy navigation from a template sourceProduct, 
# and save to NetCDF4-CF
import sys
import numpy
from snappy import String
from snappy import Product
from snappy import ProductData
from snappy import ProductIO
from snappy import ProductUtils
if len(sys.argv) != 4:
    print("usage: %s <source_file> <nav_file> <outfile>" % sys.argv[0]);
sourceProduct = ProductIO.readProduct(sys.argv[1])
width = sourceProduct.getSceneRasterWidth()
height = sourceProduct.getSceneRasterHeight()
name = sourceProduct.getName()
description = sourceProduct.getDescription()
band_names = sourceProduct.getBandNames()
print("sourceProduct: %s, %d x %d pixels, %s" % (name, width, height, description))
print("Bands:   %s" % (list(band_names)))
navProduct = ProductIO.readProduct(sys.argv[2])
ProductUtils.copyGeoCoding(navProduct, sourceProduct)
ProductIO.writeProduct(sourceProduct,  sys.argv[3], 'NetCDF4-CF')