AGERA5 Terrascope collection datacubes contain NaN only data

Hi,
I am learning my way around openEO using the Terrascope instance. I have succesfully reproduced the Dataset sampling example.
I am now trying to extend it to other data sources and I have been successful in adding other collections (“SENTINEL1_GRD_SIGMA0”, “COPERNICUS_30”).
However, when I try to use the “AGERA5” collection, the downloaded files contain NaN for all the pixels and all the bands.

I am retrieving [“dewpoint-temperature”, “precipitation-flux”, “solar-radiation-flux”,“temperature-max”,“temperature-mean”,“temperature-min”,“vapour-pressure”,“wind-speed” ]. The netCDF files are generated with the correct size and geometry.

I have tested different time spans in case the collection was not complete, but this does not seem to be the case.

Below, you can see the code I am using. As I said, this works with S2, S1 and the Copernicus DEM.

Thanks for your help.

Jordi

TIMERANGE = ["2018-06-04", "2018-08-04"]
OUTDIR = Path("/usr/local/stok/DATA/MMDC/OpenEO/")
FEATURES = (
    "https://artifactory.vgt.vito.be/testdata-public/parcels/test_10.geojson"
)


def filter_and_run_job(datacube, title, description, subdir):
    job = datacube.filter_spatial(
        FEATURES,
    ).create_job(
        title=title,
        description=description,
        out_format="netCDF",
        sample_by_feature=True,
    )

    job.start_and_wait()
    out_dir = OUTDIR / subdir
    if not out_dir.exists():
        out_dir.mkdir()
    job.download_results(out_dir)



def sample_and_download_agera5(connection):
    agera5 = connection.load_collection(
        "AGERA5",
        temporal_extent=TIMERANGE,
        bands=[
            "dewpoint-temperature",
            "precipitation-flux",
            "solar-radiation-flux",
            "temperature-max",
            "temperature-mean",
            "temperature-min",
            "vapour-pressure",
            "wind-speed",
        ],
    )
    filter_and_run_job(
        datacube=agera5,
        title="AGERA5",
        description="AGERA-5",
        subdir="AGERA5",
    )

Hi Jordi,
the AGERA5 collection is a bit tricky in the sense that it is much lower resolution than most of the other datasets, and this sometimes causes unexpected results.

In this case, my best guess is that these test features are designed for 10m resolution, and the much larger agera5 pixels don’t really intersect in the sense of the center point falling inside one of the features.

One solution is to use resample_spatial to increase the resolution of the agera5 datacube, another would be to do aggregate_spatial but with point geometry.

Can you try that, or let me know if I should provide a more detailed example?

best regards,
Jeroen

Hi Jeroen,
Thanks for your answer.

I was assuming that the intersection between features and pixels was done using pixel footprints and not using the pixel center.

I will try resample_spatial (I don’t understand the other proposed solution).

Also, if you can point to any relevant example, I find it easier for learning.

Thanks again.
Jordi

PS: Just to be sure of what you suggest, I am doing this:

datacube.resample_spatial(resolution=RESOLUTION)
        .filter_spatial(
            FEATURES,
        )

With RESOLUTION=10 and FEATURES = “https://artifactory.vgt.vito.be/testdata-public/parcels/test_10.geojson

Hi again,

Still getting NaNs for all features and bands when using resample_spatial.

Jordi

Hi Jordi,
the resolution is in the reference system of the datacube, which is epsg:4326 in the case of agera5.
(I can try to produce a working sample but just takes a bit more time.)

best regards,
Jeroen

Of course. The problem is the resolution. It is solved now. Thanks!