使用 CDO 合并每个时间步具有不同数量变量的两个数据集

发布于 2025-01-19 03:09:27 字数 854 浏览 3 评论 0原文

我正在分析一个时间序列数据,该数据按时间分为两个 NetCDF 文件(infiles)。根据设计,这些文件具有不同数量的变量/字段。传统上,我一直使用气候数据运算符(CDO)在终端中使用以下命令轻松合并按时间排序的两个数据集:

cdo mergetime <infiles> <outfile>

此命令合并按时间排序的任意数量的文件“infiles”,并写入一个包含时间的新“outfile”每个中所有数据的系列;然而,默认情况下,这似乎不适用于 cdo,因为它会返回以下内容:

cdo    select (Abort): Input streams have different number of variables per timestep!

该语句是正确的,每个文件每个时间步都有不同数量的变量。但它阻止我从整体上查看数据集。我还尝试对用于合并时间序列的 cdo 命令进行以下修改,但没有成功:

cdo mergetime -select,name=<variable> <infiles> <outfile>
cdo -select,name=<variable> <infiles> <outfile>

我已通读 CDO 用户指南,尚未找到任何替代解决方案。如果有人能够提供一种解决方法,将这两个文件连接到一个数据时间序列中(最好是在 cdo 中,但不一定),因为我已经没有想法了,我将非常感激。

I am analyzing a time series of data that is split by time into two NetCDF files (infiles). These files have a different number of variables/fields, by design. Traditionally I have been using Climate Data Operators (CDO) to easily merge two datasets sorted by time using the following command in a terminal:

cdo mergetime <infiles> <outfile>

this command merges any number of files "infiles" sorted by time and writes a new "outfile" containing a time series of all the data in each ; however this doesn't appear to work by default with cdo, as it kicks back the following:

cdo    select (Abort): Input streams have different number of variables per timestep!

the statement is true, each file does have a different number of variables per timestep. But it prevents me from looking at the dataset as a whole. I have also tried the following modifications to the cdo command I use to merge the time series, without success:

cdo mergetime -select,name=<variable> <infiles> <outfile>
cdo -select,name=<variable> <infiles> <outfile>

I have read through the CDO Userguide and have not found any alternative solutions yet. I would be very grateful if anyone could offer a workaround for joining the two files into a single time-series of data (preferably in cdo but not necessarily) as I am running out of ideas.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请止步禁区 2025-01-26 03:09:27

在手机上,但您可以像这样使用 nco 从文件中删除额外烦人的新变量

ncks -x -v var1,var2 in.nc out.nc

,然后像往常一样合并。我认为您可以使用 cdo 删除运算符来执行相同的操作。

On phone but you could delete the extra annoying new variables from files with nco like this

ncks -x -v var1,var2 in.nc out.nc

And then merge as usual. I think you can use the cdo delete operator to do the same thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文