CDO - 信息查询操作

CDO (Climate Data Operator) 是用于标准处理气候和模式数据的操作集合,包括简单的统计和算术、数据选择以及空间插值等操作,从而将 GRIB 和 NetCDF4 数据集相同的处理功能集放在一个包中

本篇随笔将介绍 CDO 信息查询的功能

语法

进行 CDO 操作的基本语法结构:

1
cdo [Options] Operator1 [ –Operator2 [ –OperatorN ] ]

选项 Options

所有的选项必须放在第一个操作符之前,以下的所有选项适用于所有的操作:

OptionsDescription
-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帮助信息
-MIndicate 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 szipSZIP compression of GRIB1 records

信息操作 Information Operators

Information and simple statistics

<operator> infiles

OperatorsDescription
info根据 Parameter ID ,打印所有输入数据集每个字段的信息和简单统计数据
infon根据 Parameter Name ,打印所有输入数据集每个字段的信息和简单统计数据
map打印所有输入数据集的每个字段的信息、简单统计数据和地图
sinfo根据 Parameter ID ,列出简短信息(Short Information)
sinfon根据 Parameter Name ,列出简短信息

Compare two datasets field by field

<operator> infile1 infile2

OperatorsDescription
diff根据 Parameter ID ,打印两个数据集之间差异的统计信息
diffn根据 Parameter Name ,打印两个数据集之间差异的统计信息

<operator> infile

OperatorsDescription
npar打印变量的数量
nlevel打印每个变量的层数
nyear打印年数
nmon打印月数
ndate打印日期数
ntime打印时间数
ngridpoints打印每个变量的格点数
ngrids打印 number of horizontal grids

Show variables, levels or times

<operator> infile

OperatorsDescription
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

OperatorsDescriptionParameter
showattribute,atts打印全局属性 attsatts,STRING,逗号分隔的属性列表
showattribute,打印变量 var 的属性 att,STRING,

<operator> infile

OperatorsDescription
partab列出所有变量的具体信息
codetab列出所有变量的 ID 、名称、描述和单位
griddes打印水平网格(longitude、latitude)的具体信息
zaxisdes打印 Z 轴(level)的信息
vct打印 Vertical Coordinate Table