Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bands argument in load_stac leads to error after aggregate_spatial #873

Open
VincentVerelst opened this issue Sep 19, 2024 · 1 comment
Open

Comments

@VincentVerelst
Copy link

I have a process graph in which I load in a STAC collection, filter on some bands, and then do spatial aggregation to extract some points:

...
s2_bands = [
    "S2-L2A-B01",
    "S2-L2A-B02",
    "S2-L2A-B03",
    "S2-L2A-B04",
    "S2-L2A-B05",
    "S2-L2A-B06",
    "S2-L2A-B07",
    "S2-L2A-B08",
    "S2-L2A-B8A",
    "S2-L2A-B11",
    "S2-L2A-B12"
]

cube = c.load_stac('/data/users/Public/vincent.verelst/world_cereal/s1_s2_meteo_extraction/Sentinel2/small-split-stac/collection-32736/collection.json', bands=s2_bands)

geometries = c.load_url('https://artifactory.vgt.vito.be/artifactory/auxdata-public/gfmap/32736-random-points.geoparquet', format='Parquet')

cube = cube.aggregate_spatial(geometries=geometries, reducer='mean')
...

This process graph gives the following error:

java.lang.IllegalArgumentException: Invalid band count, actual: 15, expected: 11

When I explicitly filter on bands using the filter_bands process, everything works as expected:

...
cube = c.load_stac('/data/users/Public/vincent.verelst/world_cereal/s1_s2_meteo_extraction/Sentinel2/small-split-stac/collection-32736/collection.json')
cube = cube.filter_bands(s2_bands)

geometries = c.load_url('https://artifactory.vgt.vito.be/artifactory/auxdata-public/gfmap/32736-random-points.geoparquet', format='Parquet')

cube = cube.aggregate_spatial(geometries=geometries, reducer='mean')
...
  • Job ID of failing process graph on Terrascope: j-240919a7bb79431bbf1021832a084414
  • Job ID of successful process graph on Terrascope: j-2409194d84c54b509e2482c8739773c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@VincentVerelst and others