CDO - 信息查询操作
CDO (Climate Data Operator) 是用于标准处理气候和模式数据的操作集合,包括简单的统计和算术、数据选择以及空间插值等操作,从而将 GRIB 和 NetCDF4 数据集相同的处理功能集放在一个包中
本篇随笔将介绍 CDO 信息查询的功能
语法
进行 CDO 操作的基本语法结构:
1 | cdo [Options] Operator1 [ –Operator2 [ –OperatorN ] ] |
选项 Options
所有的选项必须放在第一个操作符之前,以下的所有选项适用于所有的操作:
| Options | Description |
|---|---|
| -a | 生成一个绝对时间轴 |
| -b <nbits> | 设置打印精度的位数,如 I8 , I16 , I32 , F32 , F64 |
| -f <format> | 打印文件格式,如 grb2 , nc4 等 |
| -g <grid> | Define the default grid description by grid name or from file |
| -h, --help | 帮助信息 |
| -M | Indicate that the I/O streams have missing values |
| -m <missval> | 设置默认缺失值(默认值:-9e+33) |
| -O | 覆盖现有文件 |
| -R, --regular | 将 GRIB1 数据从简化网格转换为规则网格 |
| -r | 生成一个绝对时间轴 |
| -s, --silent | 无声模式 |
| -t <table> | Set the GRIB1 (cgribex) default parameter table name or file |
| -V, --version | 打印版本号 |
| -v, --verbose | 为某些操作打印额外的细节 |
| -z szip | SZIP compression of GRIB1 records |
信息操作 Information Operators
Information and simple statistics
<operator> infiles
| Operators | Description |
|---|---|
| info | 根据 Parameter ID ,打印所有输入数据集每个字段的信息和简单统计数据 |
| infon | 根据 Parameter Name ,打印所有输入数据集每个字段的信息和简单统计数据 |
| map | 打印所有输入数据集的每个字段的信息、简单统计数据和地图 |
| sinfo | 根据 Parameter ID ,列出简短信息(Short Information) |
| sinfon | 根据 Parameter Name ,列出简短信息 |
Compare two datasets field by field
<operator> infile1 infile2
| Operators | Description |
|---|---|
| diff | 根据 Parameter ID ,打印两个数据集之间差异的统计信息 |
| diffn | 根据 Parameter Name ,打印两个数据集之间差异的统计信息 |
Print the number of parameters, levels or times
<operator> infile
| Operators | Description |
|---|---|
| npar | 打印变量的数量 |
| nlevel | 打印每个变量的层数 |
| nyear | 打印年数 |
| nmon | 打印月数 |
| ndate | 打印日期数 |
| ntime | 打印时间数 |
| ngridpoints | 打印每个变量的格点数 |
| ngrids | 打印 number of horizontal grids |
Show variables, levels or times
<operator> infile
| Operators | Description |
|---|---|
| showformat | 打印输入数据集的文件格式 |
| showcode | 打印所有变量的 ID |
| showname | 打印所有变量的 name |
| showstdname | 打印所有变量的 standard_name |
| showlevel | 打印每个变量的 levels |
| showltype | 打印 GRIB level type for all z-axes |
| showyear | 打印所有的年份 |
| showmon | 打印所有的月份 |
| showdate | 打印所有的日期信息(格式:YYYY-MM-DD) |
| showtime | 打印所有的时刻信息(格式:hh:mm:ss) |
| showtimestamp | 打印所有的时间信息(格式:YYYY-MM-DDThh:mm:ss) |
Show attributes
<operator>,attributes infile
| Operators | Description | Parameter |
|---|---|---|
| showattribute,atts | 打印全局属性 atts | atts,STRING,逗号分隔的属性列表 |
| showattribute,var@att | 打印变量 var 的属性 att | var@att,STRING,变量名@属性名 |
Print description of dataset
<operator> infile
| Operators | Description |
|---|---|
| partab | 列出所有变量的具体信息 |
| codetab | 列出所有变量的 ID 、名称、描述和单位 |
| griddes | 打印水平网格(longitude、latitude)的具体信息 |
| zaxisdes | 打印 Z 轴(level)的信息 |
| vct | 打印 Vertical Coordinate Table |