Zonal Statistics as Table yields unexpected output

1080
4
05-10-2021 02:57 PM
dazu
by
New Contributor II

Dear Pros 😉

I would like to calculate the zonal mean (for areas specified in a one-dimensional tif) for all raster slices of a multidimensional raster; resorting to the Zonal Statistics (ZS) and Zonal Statistics as Table (ZSaT) tools two problems arose:

  1. Although the correct number of rows are written to the summary table produced by the ZSaT-Tool, the calculated means and other calculated summary statistics are not correct. The values in the multidimensional input raster are negative floats, but all summary statistics are positive.
  2. The ZS-Tool does not accept the same input files as under (1) (process_as_multidimensional cannot be checked without error), correct values (i.e. negative values) seem to be assigned to the zones in the output raster for a single slice.

I would be thankful for suggestions on how to resolve the first and work around the second issue respectively.

Regards, Daniel

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

What is the null value of the raster? was it ignored in the zone file?

Does it provide correct results for one raster layer?

How the zonal statistics tools work—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
dazu
by
New Contributor II

Thank you again for your reply, DanPatterson. 

The 64bit raster is saved in CRF format, NoData value is 1,79e+308, they were ignored in the calculation. For a single slice, the results are plausible since smaller than 0.

I attached a sample project, which illustrates the problem.

0 Kudos
SarmisthaChatterjee
Esri Contributor

Thank you @dazu for reporting this issue and for attaching the project. Please let me know which software version you are using; I have used Pro 2.7.1 to test your cases.

Zonal Statistics:
From your project I see that you could successfully run the Zonal Statistics tool processing as multidimensional (1st run of Zonal Statistics from History), creating the correct output ZonalSt_asMulti.CRF.
However, when you see the result in Contents, it shows the statistics of the tp variable, which is positive. The other 2 variables (e and evaow) has negative values, as you can see from the input value raster, era5_subset.CRF data.
To view the other variables, from the Multidimensional tab, choose the variable you want to view to see the values. These values seem correct to me.

SarmisthaChatterjee_0-1620762901413.png

 

Zonal Statistics as Table:
Based on the inputs you have used, the output from Zonal Statistics as Table seems incorrect, I am investigating it further.

Please let me know if that answers your question.
Thanks,
Sarmistha

0 Kudos
SarmisthaChatterjee
Esri Contributor

On further investigation, it seems like the problem is related to using a multidimensional raster with multiple variables as input to zonal tools.

The workaround is to create another multidimensional raster with only one variable and use it as an input to the Zonal Statistics and Zonal Statistics as Table tools.

You can create a multidimensional raster with one variable in multiple ways:

  1. You can use the Make Multidimensional Raster Layer tool and specify the variable you want and use the output as input to zonal tools. This will not create a new multidimensional raster file on disk.
  2. You can also use the Subset Multidimensional Raster tool, however, it will create a new multidimensional raster file on disk. Creating a new file may not be required for your analysis.
  3. If you want to automate the workflow in Python using arcpy, you can use the Subset function to create a temporary multidimensional raster with only one variable.
0 Kudos