-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Issue: Maximum value is outside of range using /cog/statistics for an area of interest (AOI). (subset of the COG file)
Here is some information in potential errors or uncertainties when using /cog/statistics
endpoint within raster API.
This is for the notebook user_data_notebooks/cms-global-map-mangrove_User_Notebook.ipynb
. For my specific notebook with mangrove data for GHG, I've noticed that the maximum value within the selected AOI is outside of the bounds of the maximum value in the tile. This makes me think that /cog/statistics
is selecting some other data, or I may just be mis-interpreting the API functionality so I would need some clarification.
Here is the PR in ghgc-docs
: mangrove-data.
This is the STAC collection
1.) For AOI selected within the Australia tile, the maximum value in the collection statistics is 145.98
(as seen in the collection id cms-mangrove-agb-canopyheight-grid-v1.3-Australia
for variable agb
). But running the generate_stats
function which calls POST /cog/statistics endpoint, the maximum value is 212.61
which is outside of the range. Even though its a subset of the tile, it should not be >145.98
.
2.) I looked into all 3 assets (agb, hmax95, hba) to see if it was getting those statistics, but none of them have values >145.98.
3a.) I looked briefly through other User_notebooks and I believe that I found another inconsistency within odiac-ffco2-monthgrid-v2022_User_Notebook.ipynb
in ghgc-docs
. Here is the STAC collection/items link. Within this notebook for item_id odiac-ffco2-monthgrid-v2022-202112, the maximum value from generate_stats is 404594
. But the maximum value within the item['statistics'] in STAC collection is 2497
for the asset co2-emissions.
3b.) To slightly complicate things, when I looked at the .tif file for 202112 in COG Viewer, I see that the maximum is around 585
(not at 404594
or 2497
). Here is the file path s3://ghgc-data-store/odiac-ffco2-monthgrid-v2022/odiac2022_1km_excl_intl_202112.tif. The histogram bins may influence what we perceive as the maximum but after changing the rescale there are no values >100000.
This may require more information, so please reach out to me and I'll offer any additional assistance or insight you may need.