Page 1 of 1
Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF
Posted: Tue Feb 11, 2025 6:45 pm America/New_York
by jvaldezch
I'm downloading some IOP from different sensor (Aqua, Terra, Virrs and Sentinel L2) data from your website and so far I managed to properly reproject Aqua, Terra and Virrs raster information and in those cases I have use GDAL (GDAL Warp) to do it. But when I try to do it wth Sentinel-3 Level-2 Reduced Resolution A and B it fails. It seems that metadata is different that data contained.
I'm missing a file or which is the projection coordinates used for this files?
Any help will be appreciated.
Code: Select all
file_in = "S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc"
band = xr.open_rasterio(
f"NETCDF:{file_in}:/geophysical_data/bbp_443"
)
printr(band.rio.crs)
band.rio.write_crs("EPSG:4326 ", inplace=True)
band_reprojected = band.rio.reproject("EPSG:4326")
band_reprojected.rio.to_raster(file_tmp)
Take a look at coordinates in QGIS 3.4 (image below).

- qgis_3_4.png (110.06 KiB) Not viewed yet
Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF
Posted: Wed Feb 12, 2025 9:48 am America/New_York
by OB SeaDAS - dshea
Nothing about this file jumps out as a problem. Seadas had no problem displaying this L2 file.

- S3B_OLCI_ERRNT_20250101T164657_L2_IOP_NRT_a_443.png (26.42 KiB) Not viewed yet
Maybe GDAL has a problem with full orbit files that cross the dateline.
Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF
Posted: Wed Feb 12, 2025 11:09 am America/New_York
by jvaldezch
Got it! So subsetting the image first might help. Thanks!
Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF
Posted: Fri May 09, 2025 1:04 am America/New_York
by mdsumner
The coordinate arrays are recognized as "geolocation arrays":
```
gdalinfo NETCDF:"S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc":/geophysical_data/bb_443
...
Geolocation:
SRS=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
X_DATASET=NETCDF:"S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc":/navigation_data/longitude
X_BAND=1
Y_DATASET=NETCDF:"S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc":/navigation_data/latitude
Y_BAND=1
PIXEL_OFFSET=0
PIXEL_STEP=1
LINE_OFFSET=0
LINE_STEP=1
GEOREFERENCING_CONVENTION=PIXEL_CENTER
...
```
so I tried these which seem fine. Use '-te', '-tr', and '-ts' in combination with '-t_srs' for the desired output grid.
```
gdalwarp NETCDF:"S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc":/geophysical_data/bb_443 ll.tif
gdalwarp NETCDF:"S3B_OLCI_ERRNT.20250101T164657.L2.IOP.NRT.nc":/geophysical_data/bb_443 laea.tif -t_srs "+proj=laea +lon_0=-150 +lat_0=-65"
```