简体   繁体   English

如何使用 CDO(气候数据操作员)删除“冗余”维度?

[英]How to remove a "redundant" dimension with CDO (climate data operators)?

The ERA5 climate dataset is, in general, defined as a [lat, lon, time] matrix. ERA5 气候数据集通常定义为 [lat, lon, time] 矩阵。 Except for recent data, where it adds the exp_ver variable that indicate if the data is provisory (recent data, up to 3 months until the present, coded as "05") or old (stable version, coded as "01"), so the matrix are defined [lat, lon, time, exp_ver] only for recent data.除了最近的数据,它在其中添加了exp_ver变量,该变量指示数据是暂时的(最近的数据,直到现在为止 3 个月,编码为“05”)或旧的(稳定版本,编码为“01”),所以矩阵仅针对最近的数据定义 [lat, lon, time, exp_ver]。

The exp_ver variable only has two values: "01" (old data) and "05" (recent data), and if there is data in "01" so the corresponding time has missing values in the "05" field, and viceversa. exp_ver变量只有两个值:“01”(旧数据)和“05”(最新数据),如果“01”有数据则对应的时间在“05”字段中有缺失值,反之亦然。 I'm looking for merge both "01" and "05" in a unique [lat, lon, time] matrix (so, remove the exp_ver variable), but I dont' know how to conduct this procedure.我正在寻找将“01”和“05”合并到一个独特的 [lat, lon, time] 矩阵中(因此,删除 exp_ver 变量),但我不知道如何执行此过程。 This is maybe an option:这可能是一个选项:

A. Split the file with cdo splitlevel obtaining the "01" and "05" exp_ver separate files. A. 使用cdo splitlevel拆分文件,获得“01”和“05”exp_ver 单独的文件。

B. Remove the missing values segment, or only select the segment with data, from both files (I don't know how to to this!) B. 从两个文件中删除缺失值段,或仅删除 select 包含数据的段(我不知道该怎么做!)

C. Remove the redundant variable "exp_ver" from both files (with cdo reduce_dim ) C。从两个文件中删除冗余变量“exp_ver”(使用cdo reduce_dim

Any help with this?有什么帮助吗? Thank you in advance!先感谢您!

Diego迭戈

Can you use ncwa to average over and remove the dimension in step two and then use merge time?您可以使用 ncwa 平均并删除第二步中的维度,然后使用合并时间吗?

cdo splitlevel # as you were suggesting

ncwa -a exp_ver v1.nc v1rd.nc
ncwa -a exp_ver v5.nc v5rd.nc 

cdo mergetime v1rd.nc v5rd.nc out.nc

Or thinking about it what if you use ncwa directly on the original file?或者想想直接在原文件上使用ncwa会怎样? It averages over that dimension.它在该维度上取平均值。 I don't recall how missing+value is handled though.我不记得如何处理 missing+value 了。

ncwa -a exp_ver era5.nc out.nc

Check out this link too which could be relevant Can ncwa (NCO) understand missing_value也查看此链接,它可能是相关的Can ncwa (NCO) understand missing_value

( Preliminary answer posted from phone, will revise tomorrow) (初步电话回复,明天修改)

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

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