简体   繁体   English

前日12UTC至12UC之间的累计降水量

[英]Accumulated precipitation between 12UTC to 12UC of the other day

I have a.nc file that contains data every 6 hours of precipitation for 1 full year, my interest is to calculate the daily precipitation and compare with observed data, for this I must make them coincide temporally.我有一个 .nc 文件,其中包含一整年每 6 小时降水量的数据,我的兴趣是计算每日降水量并与观测数据进行比较,为此我必须使它们在时间上重合。 To achieve this, the precipitation should accumulate between 12 utc of one day and 12 utc of the next day.为此,降水应在一天的 12 点到第二天的 12 点之间累积。 Does anyone have a suggestion on how to achieve this with CDO?有人对如何使用 CDO 实现这一目标有建议吗?

Thank you!谢谢!

Well if the first slice covers 12-18 UTC, then essentially you want to average the timeseries 4 slices at a time, (right?) in which case you can use this好吧,如果第一个切片涵盖 12-18 UTC,那么基本上你想一次平均时间序列 4 个切片,(对吗?)在这种情况下你可以使用这个

cdo timselmean,4 infile.nc outfile.nc  

If the timeseries starts instead at 00, you may need to remove the first two timeslices before you start ( cdo seltimestep )如果时间序列从 00 开始,您可能需要在开始之前删除前两个时间片 ( cdo seltimestep )

Another method is a bit more of a fudge, in that you can shift the series by 12 hours, and then use the day mean function. This would have the advantage of working for any frequency of data (ie you don't hardwire the factor "4" based on the data frequency)另一种方法更像是一种软糖,因为您可以将系列移动 12 小时,然后使用日均值 function。这将具有适用于任何数据频率的优势(即您不硬连线因子“4”基于数据频率)

cdo daymean -shifttime,-12hours infile.nc outfile.nc 

The answer Adrian Tompkins gives should work well. Adrian Tompkins 给出的答案应该很有效。 One additional point to note is that you can remove time steps in CDO.需要注意的另一点是您可以删除 CDO 中的时间步长。 So, if your time starts at 0 UTC ands at 24 UTC, you do not want the first and last time step of Adrian's first answer, but you could modify it as follows:因此,如果您的时间从 0 UTC 开始,在 24 UTC 开始,您不希望 Adrian 的第一个答案的第一个和最后一个时间步长,但您可以按如下方式修改它:

cdo -timselmean,4 -delete,timestep=-1,-2,1,2 infile.nc outfile.nc

This will require a 2.x version of CDO.这将需要 2.x 版本的 CDO。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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