NOAA-OWP / gval

A high-level Python framework to evaluate the skill of geospatial datasets by comparing candidates to benchmark maps producing agreement maps and metrics.
https://noaa-owp.github.io/gval/
Other
22 stars 0 forks source link

Value Error depicting the absence of no data values. #187

Open Dipsi27 opened 2 months ago

Dipsi27 commented 2 months ago

I have used two binary rasters : candidate and benchmark. Both maps have a shape of (2271, 4552). The benchmark raster contains two classes: 0 for no flood and 2 for flood. The candidate raster also contains two classes: 1 for no flood and 2 for flood. When I run the ‘gval.categorical_compare’ command, the following error appears.

ValueError: Both candidate and benchmark maps need to have nodata values set.

What do the ‘no data’ values indicate?

benchmark candidate error

GregoryPetrochenkov-NOAA commented 2 months ago

The reason we require nodata values in a dataset is that they represent where the model domain of a map ends. Since gridded datasets are square, they often contain cells that were not originally in the modeled domain, in this case a flood map. Cells not in the domain but marked as not flooded will affect the overall evaluations either artificially improving or regressing their metrics in an agreement map. While in some cases this cannot be avoided if the original data does not provide nodata information delineating the model domain, we still want a user to explicitly assign nodata values before running a comparison so they are aware it is not included. Please consult this tutorial in order to see how to set a nodata value: https://noaa-owp.github.io/gval/SphinxTutorial.html

Dipsi27 commented 2 months ago

Thank you very much for the information.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Gregory Petrochenkov @.> Sent: Tuesday, June 25, 2024 2:13:57 PM To: NOAA-OWP/gval @.> Cc: Dipsikha Devi @.>; Author @.> Subject: [EXTERNAL] Re: [NOAA-OWP/gval] Value Error depicting the absence of no data values. (Issue #187)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

The reason we require nodata values in a dataset is that they represent where the model domain of a map ends. Since gridded datasets are square, they often contain cells that were not originally in the modeled domain, in this case a flood map. Cells not in the domain but marked as not flooded will affect the overall evaluations either artificially improving or regressing their metrics in an agreement map. While in some cases this cannot be avoided if the original data does not provide nodata information delineating the model domain, we still want a user to explicitly assign nodata values before running a comparison so they are aware it is not included. Please consult this tutorial in order to see how to set a nodata value: https://noaa-owp.github.io/gval/SphinxTutorial.html

— Reply to this email directly, view it on GitHubhttps://github.com/NOAA-OWP/gval/issues/187#issuecomment-2189786464, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BIT2FQCM4WDMMB4GZHKH3BLZJG6PLAVCNFSM6AAAAABJ4GZBWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZG44DMNBWGQ. You are receiving this because you authored the thread.Message ID: @.***>