Open-EO / openeo-geopyspark-driver

OpenEO driver for GeoPySpark (Geotrellis)
Apache License 2.0
25 stars 4 forks source link

SENTINEL3_SYN cloud flags band #716

Closed jdries closed 2 months ago

jdries commented 3 months ago
con = openeo.connect("openeo.dev.warsaw.openeo.dataspace.copernicus.eu").authenticate_oidc()

    spatial_extent = {"west": -100, "south": 50, "east": -95, "north": 60}
    temporal_extent = ["2021-08-03", "2021-08-10"]
    mask = con.load_collection(
        "SENTINEL3_SYN_L2_SYN",
        spatial_extent=spatial_extent,
        temporal_extent=temporal_extent,
        bands=["CLOUD_flags"]
    )
    mask.download("/tmp/s3_mask.nc")

KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/eodata/Sentinel-3/SYNERGY/SY_2_SYN_/2021/08/05/S3B_SY_2_SYN__20210805T180318_20210805T180618_20210807T201444_0179_055_255_1980_LN2_O_NT_002.SEN3/flags_in.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False))] E

jdries commented 3 months ago

Getting different error now:

File "/opt/openeo/lib/python3.8/site-packages/openeogeotrellis/collections/sentinel3.py", line 203, in read_product
E                   orfeo_bands = create_s3_toa(product_type, creo_path, band_names,
E                 File "/opt/openeo/lib/python3.8/site-packages/openeogeotrellis/collections/sentinel3.py", line 271, in create_s3_toa
E                   bbox_original, source_coordinates,data_mask = _read_latlonfile(geofile, lat_band, lon_band, bbox_tile)
E                 File "/opt/openeo/lib/python3.8/site-packages/openeogeotrellis/collections/sentinel3.py", line 413, in _read_latlonfile
E                   extreme_right_lon = lon_orig[0,-1] # negative degrees (-170)
E               IndexError: index 0 is out of bounds for axis 0 with size 0
E                (ref: r-24031218e88b409892c407ef908ade3c)
JeroenVerstraelen commented 3 months ago

For this sprint only an analysis needed.

jdries commented 2 months ago

When bounds went outside of product geometry, there are 0 valid lat/lon coords, hence the error. Committed a fix + test.