Reproject raster image: How to choose geolocation band?

When you install snappy (the snap-python bridge) there are also some examples installed.
Some general links are given in this post:

For you specific problem there is no example. But in general you would need to do the following.

PixelGC = jpy.get_type('org.esa.snap.core.datamodel.PixelGeoCoding')

product = ProductIO.readProduct(input_file_path)
lat_tc = product.getBand('lat_corrected')
lon_tc = product.getBand('lon_corrected')
valid_mask = None
searchRadius = 3
pixel_gc = PixelGC(lat_tc, lon_tc, valid_mask, searchRadius)
product.setSceneGeoCoding(pixel_gc )
ProductIO.writeProduct(product, output_file_path, 'NetCDF4-CF')

That’s roughly the code. It reads the product, creates and sets the new GeoCoding and writes it as NetCDF.

2 Likes