简体   繁体   中英

How can i compute spatial statistics in grid space of two NetCDF files?

I have two files with the same spatial and temporal dimension, with ERA5_w1 being the observation and CCMP_w1 being the forecast file.

I wonder how I can calculate the RMSE to get a spatial distribution of the RMSE over the 28 timesteps in a 3-dimensional field?

File information and download link are below:

ERA5_w1

CCMP_w1

I would like to generate an RMSE plot like the image below:

在此处输入图像描述

Link to download the files: Files

One option for doing this is my package nctoolkit. The following code will calculate RSME for your data.

import nctoolkit as nc
# load the two files as datasets
ds1 = nc.open_data("CCMP_w1")
ds2 = nc.open_data("ERA5_w1")
# subtract the data in one dataset from the other
ds1.subtract(ds2)
#square the differences
ds1.power(2)
# sum up over all time steps
ds1.tsum()
# divide by the number of time steps
ds1.divide(28)
#square the results
ds1.sqrt()
# view the results
ds1.plot("WS10")

At present there isn't an explicit rsme method in nctoolkit, but I plan to add one in an upcoming release.

More details about the package here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM