Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
jvaldezch
Posts: 31
Joined: Fri Aug 24, 2018 2:52 pm America/New_York
Answers: 0
Has thanked: 2 times

Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF

by jvaldezch » Tue Feb 11, 2025 6:45 pm America/New_York

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
qgis_3_4.png (110.06 KiB) Not viewed yet

Filters:

OB SeaDAS - dshea
Subject Matter Expert
Subject Matter Expert
Posts: 272
Joined: Thu Mar 05, 2009 10:25 am America/New_York
Answers: 0
Been thanked: 3 times

Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF

by OB SeaDAS - dshea » Wed Feb 12, 2025 9:48 am America/New_York

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
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.
Attachments
Screenshot 2025-02-12 at 9.41.57 AM.png
Screenshot 2025-02-12 at 9.41.57 AM.png (218.73 KiB) Not viewed yet

jvaldezch
Posts: 31
Joined: Fri Aug 24, 2018 2:52 pm America/New_York
Answers: 0
Has thanked: 2 times

Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF

by jvaldezch » Wed Feb 12, 2025 11:09 am America/New_York

Got it! So subsetting the image first might help. Thanks!

mdsumner
Posts: 5
Joined: Mon Jul 14, 2014 9:05 pm America/New_York
Answers: 0
Been thanked: 1 time

Re: Reprojecting S3B-OLCI Level-2 Reduced Resolution to GeoTIFF

by mdsumner » Fri May 09, 2025 1:04 am America/New_York

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"
```

Post Reply