Projection missing when exporting C2RCC S2 products as NetCDF

Dear all,
I am computing the inherent optical properties using C2RCC with Sentinel 2 data with the GPT. The final products are converted to NetCDF files, as I need to do further statistics with the values.
As I import the NetCDF in QGIS no information about the geographic system is being stored.


I try to give it in manually - WGS84, UTM Zone 35N, however this doesn’t reproject the layer - it just disappears from the preview.
The same output saved in .dim format works perfectly fine with SNAP:

Do you have any suggestions how I could solve this?
Many thanks in advance!

can you please try to load the img file inside the data folder of the BEAM DIMAP product directly in QGIS?

Yes, the img file from .dim loaded in QGIS gives the correct projection.


However I need to work with the NetCDFs due to the statistics which I calculate with different software.
I managed to visualize the NetCDF correctly with python though, however without the Basemap.

So the problem which remains is why QGIS doesn’t recognize the coordinate system.

So is it an option to export to NetCDF from QGIS?

I think the geocoding somehow got lost during the export from SNAP. Have you tried all four export options in SNAP?
grafik

The NetCDF export should happen from the GPT.
I have tried all four formats with the same result.
Apparently SNAP looses the information about the geoprojection when converting to NetCDF and currently my only workaround is to visualize the results in Python without a Basemap.

It is likely that your QGIS is slightly broken. If python found the geolocation metadata the NetCDF files are probably OK. NASA Panoply i another way to check geolocation and visualize NetCDF data.

QGIS import uses GDAL libraries via python, which in turn uses proj, netcdf, and hdf5 libraries. It is not unusual to have multiple versions of all these libraries installed, so there is potential that QGIS finds the wrong version (e.g., due to shoddy configuration changes made by another app).

The thing is that python doesn’t recognize the projection. If I try plotting the data using Basemap it does not work.
I can plot it only using matplotlib.pcolor(lon, lat, data), which is a generic way of plotting NetCDF without needing any type of projection information.
I have also tried to reproject the data using pyproj in python, also without success.

Try NASA Panoply, which doesn’t use python.