Reprojecting Sentinel-3 OLCI Chlorophyll Bands

Hello,

I am trying to Reproject the Sentinel 3 data but I was not able to ‘grasp’ the right way to do it.
I really would like to understand exactly how to transform the ‘raw’ unprojected .nc file to a Geotiff georrerenced using snappy library in Python.
Can someone please help me?

I really need to solve this. I’ve read many other threads but I am still not able to do it.
Thanks in advance.

It is better to open the xfdumanifest.xml file with snappy instead of working with the single netcdf files. The netcdf files have no geo-information. The geo-information is in tie_geo_coordinates.nc and geo_coordinates.nc. You would need to manually combine this information.
If you open the xfdumanifest.xml the data is georeferenced automatically for and you can reproject the data and export to geotiff.

Many thanks for the prompt answer. Fortunately I was able to find the solution. Sharing my code for future reference of other users:

def reprojecting():
p = ProductIO.readProduct({path} + “xfdumanifest.xml”)
HashMap = snappy.jpy.get_type(‘java.util.HashMap’)
parProj = HashMap()
parProj.put(‘crs’,‘GEOGCS[“WGS84(DD)”,’
‘DATUM[“WGS84”,’
‘SPHEROID[“WGS84”, 6378137.0, 298.257223563]],’
‘PRIMEM[“Greenwich”, 0.0],’
'UNIT[“degree”, 0.017453292519943295], ’
‘AXIS[“Geodetic longitude”, EAST],’
‘AXIS[“Geodetic latitude”, NORTH]]’)
parProj.put(‘resampling’, “Nearest”)
parProj.put(“orthorectify”, “false”)
parProj.put(“noDataValue”, -32768.0)
parProj.put(“includeTiePointGrids”, “false”)
parProj.put(“addDeltaBands”, “false”)
outProj = GPF.createProduct(“Reproject”, parProj, p)
ProductIO.writeProduct(outProj,{path} + “file_reprojected.nc”, ‘NetCDF-CF’)

1 Like

Please, some one know read the CRS from an existing product (p in the example above).

Specifically, I want read the CRS from one product. then use it for the projection on a second product. Instead of write the following lines:

parProj.put(‘crs’,‘GEOGCS[“WGS84(DD)”,’
‘DATUM[“WGS84”,’
‘SPHEROID[“WGS84”, 6378137.0, 298.257223563]],’
‘PRIMEM[“Greenwich”, 0.0],’
'UNIT[“degree”, 0.017453292519943295], ’
‘AXIS[“Geodetic longitude”, EAST],’
‘AXIS[“Geodetic latitude”, NORTH]]’)

Apologies for the slight necro here- but I am having the same issue and have run into a different error.

I am trying to carry out the re-project as part of a subset and band extract. All the params.put (parProj.put in the case in your example) work. Except for the primary projection input. Of that step, DATUM works fine on its own, but the rest return the error:
RuntimeError: no matching Java method overloads found

The full reproject paramters input looks like this:
params.put(‘targetBands’, targetBands)
params.put(‘crs’, ‘GEOGCS[“WGS84(DD)”]’),
params.put(‘DATUM[“WGS84”]’,
‘SPHEROID[“WGS84”, 6378137.0, 298.257223563]]’,
‘PRIMEM[“Greenwich”, 0.0]’,
‘UNIT[“degree”, 0.017453292519943295]’,
‘AXIS[“Geodetic”]’,
‘longitude[“EAST”],’,
‘AXIS[“Geodetic”],’,
‘latitude[“NORTH]”’)
params.put(‘resampling’, ‘Nearest’)
params.put(‘orthorectify’, False)
params.put(‘includeTiePointGrids’, False)
params.put(‘addDeltaBands’, False)

Any ideas sorry? Or is there a built in method that we can call to reporject to wgs84?

And I figured out it via this post: Model list of the snappy

For anyone else who follows this, it is actually super simple. All you need to do is:

params.put('crs', 'EPSG:4326')
out_product_reproj = snappy.GPF.createProduct('Reproject', params, in_product)
1 Like