如何从 ERA5 每小时 netCDF 数据计算每日平均值? [英] How to calculate daily average from ERA5 hourly netCDF data?

查看:607
本文介绍了如何从 ERA5 每小时 netCDF 数据计算每日平均值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我很抱歉重复这个问题.我已经从哥白尼网络平台下载并合并了 ERA5 每小时露点温度数据 (d2m_wb.nc).现在,我想根据每小时 d2m_wb.nc 数据计算每日平均值.时间戳为 00、01、02...23.ECMWF 提供了计算每日总降水量的示例(https://confluence.ecmwf.int/display/CKB/ERA5%3A+How+to+calculate+daily+total+precipitation).它说要涵盖 2017 年 1 月 1 日的总降水量,我们需要两天的数据.(a) 2017 年 1 月 1 日时间 = 01 - 23 将为您提供涵盖 2017 年 1 月 1 日 00 - 23 UTC 的总降水数据(b) 2017 年 1 月 2 日时间 = 00 将为您提供涵盖 2017 年 1 月 1 日 23 - 24 UTC 的总降水数据

I do apologize for repeating the question. I have downloaded and merged the ERA5 hourly dew-point temperature data (d2m_wb.nc) from the Copernicus web platform. Now, I want to calculate the daily mean from the hourly d2m_wb.nc data. The timestamps are 00, 01, 02...23. The ECMWF provided an example for the calculation of daily total precipitation (https://confluence.ecmwf.int/display/CKB/ERA5%3A+How+to+calculate+daily+total+precipitation). It said to cover total precipitation for 1st January 2017, we need two days of data. (a) 1st January 2017 time = 01 - 23 will give you total precipitation data to cover 00 - 23 UTC for 1st January 2017 (b) 2nd January 2017 time = 00 will give you total precipitation data to cover 23 - 24 UTC for 1st January 2017

这意味着我需要移动 -1hour 时间戳以考虑步骤 (b).因此,我使用了气候数据运营商 (CDO).

That means I need to shift the -1hour timestamp to account for step (b). Accordingly, I did it using Climate Data Operators (CDO).

cdo daymean -shifttime,-1hour in.nc out.nc

并得到以下结果.

cdo sinfo d2m_wb.nc
   File format : NetCDF2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter ID
     1 : unknown  unknown  v instant       1   1       475   1  F64  : -1
   Grid coordinates :
     1 : lonlat                   : points=475 (19x25)
                              lon : 85.5 to 90 by 0.25 degrees_east
                              lat : 21.5 to 27.5 by 0.25 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :  25904 steps
     RefTime =  1900-01-01 00:00:00  Units = hours  Calendar = gregorian  Bounds = true
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  1949-12-31 23:00:00  1950-01-01 11:00:00  1950-01-02 11:00:00  1950-01-03 11:00:00
  1950-01-04 11:00:00  1950-01-05 11:00:00  1950-01-06 11:00:00  1950-01-07 11:00:00
  1950-01-08 11:00:00  1950-01-09 11:00:00  1950-01-10 11:00:00  1950-01-11 11:00:00
  1950-01-12 11:00:00  1950-01-13 11:00:00  1950-01-14 11:00:00  1950-01-15 11:00:00
  1950-01-16 11:00:00  1950-01-17 11:00:00  1950-01-18 11:00:00  1950-01-19 11:00:00
  1950-01-20 11:00:00  1950-01-21 11:00:00  1950-01-22 11:00:00  1950-01-23 11:00:00
  1950-01-24 11:00:00  1950-01-25 11:00:00  1950-01-26 11:00:00  1950-01-27 11:00:00
  1950-01-28 11:00:00  1950-01-29 11:00:00  1950-01-30 11:00:00  1950-01-31 11:00:00
  1950-02-01 11:00:00  1950-02-02 11:00:00  1950-02-03 11:00:00  1950-02-04 11:00:00
  1950-02-05 11:00:00  1950-02-06 11:00:00  1950-02-07 11:00:00  1950-02-08 11:00:00
  1950-02-09 11:00:00  1950-02-10 11:00:00  1950-02-11 11:00:00  1950-02-12 11:00:00
  1950-02-13 11:00:00  1950-02-14 11:00:00  1950-02-15 11:00:00  1950-02-16 11:00:00
  1950-02-17 11:00:00  1950-02-18 11:00:00  1950-02-19 11:00:00  1950-02-20 11:00:00
  1950-02-21 11:00:00  1950-02-22 11:00:00  1950-02-23 11:00:00  1950-02-24 11:00:00
  1950-02-25 11:00:00  1950-02-26 11:00:00  1950-02-27 11:00:00  1950-02-28 11:00:00
   ................................................................................
   ................................................................................
   ................................................................................
   .................
  2020-10-03 11:00:00  2020-10-04 11:00:00  2020-10-05 11:00:00  2020-10-06 11:00:00
  2020-10-07 11:00:00  2020-10-08 11:00:00  2020-10-09 11:00:00  2020-10-10 11:00:00
  2020-10-11 11:00:00  2020-10-12 11:00:00  2020-10-13 11:00:00  2020-10-14 11:00:00
  2020-10-15 11:00:00  2020-10-16 11:00:00  2020-10-17 11:00:00  2020-10-18 11:00:00
  2020-10-19 11:00:00  2020-10-20 11:00:00  2020-10-21 11:00:00  2020-10-22 11:00:00
  2020-10-23 11:00:00  2020-10-24 11:00:00  2020-10-25 11:00:00  2020-10-26 11:00:00
  2020-10-27 11:00:00  2020-10-28 11:00:00  2020-10-29 11:00:00  2020-10-30 11:00:00
  2020-10-31 11:00:00  2020-11-01 11:00:00  2020-11-02 11:00:00  2020-11-03 11:00:00
  2020-11-04 11:00:00  2020-11-05 11:00:00  2020-11-06 11:00:00  2020-11-07 11:00:00
  2020-11-08 11:00:00  2020-11-09 11:00:00  2020-11-10 11:00:00  2020-11-11 11:00:00
  2020-11-12 11:00:00  2020-11-13 11:00:00  2020-11-14 11:00:00  2020-11-15 11:00:00
  2020-11-16 11:00:00  2020-11-17 11:00:00  2020-11-18 11:00:00  2020-11-19 11:00:00
  2020-11-20 11:00:00  2020-11-21 11:00:00  2020-11-22 11:00:00  2020-11-23 11:00:00
  2020-11-24 11:00:00  2020-11-25 11:00:00  2020-11-26 11:00:00  2020-11-27 11:00:00
  2020-11-28 11:00:00  2020-11-29 11:00:00  2020-11-30 11:00:00  2020-12-31 23:00:00
cdo    sinfo: Processed 1 variable over 25904 timesteps [6.03s 37MB

在这种情况下,时间步长显示为 11:00:00(从 1950-01-01 开始).我想应该是 12:00:00.我在这里做错了什么?任何建议将不胜感激?谢谢.

In this case, the timestep shows 11:00:00 (from 1950-01-01 onwards). I guess it should be 12:00:00. What wrong I've done here? Any suggestions will highly be appreciated? Thank you.

推荐答案

Robert Wilson 的回答是正确的,我只是想快速澄清一下,这里的混淆是由于

Robert Wilson's answer is correct, I just wanted to quickly clarify that the confusion here is due to the difference between

  • 瞬时场:例如云、水蒸气、温度、风等,这些是对瞬时有效的场
  • 累积场:如辐射通量、潜热和感热通量、降水量等,这些是在一段时间内累积的,时间戳放在窗口的末尾.

因此,对于即时字段,如果您认为 00Z 是在后一天,罗伯特是正确的,您不想转移,但您同样可以有效地争辩说午夜应该包括在前一天(因此您需要shift),因为它位于边界上.约定俗成说你不换班,把 00...23 算作一天...

Thus for instant fields Robert is correct that you don't want to shift, if you consider 00Z to be in the subsequent day, but you could equally validly argue that midnight should be included in the previous day (thus you would need shift), as it lies on the border. Convention says you don't shift, and count 00...23 as one day...

关于通量,这篇文章中还有更多细节:计算ERA5使用 CDO 的每日总降水量

Concerning the fluxes, there are also more details in this post: Calculating ERA5 Daily Total Precipitation using CDO

这篇关于如何从 ERA5 每小时 netCDF 数据计算每日平均值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆