CDO - 其他操作
本篇随笔将介绍 CDO 的其他功能,如:滤波、平滑、统计等功能
其他操作 Miscellaneous Operators
时间序列滤波
<operator>,parameter infile outfile
| Operators | Description |
|---|---|
| bandpass,fmin,fmax | 带通滤波(通过 fmin 和 fmax 之间的频率) |
| lowpass,fmax | 低通滤波(通过低于 fmax 的频率) |
| highpass,fmin | 高通滤波(通过高于 fmin 的频率) |
例子
假设数据是每小时的,时间周期为 5 年,但日历为 365/366 天,过滤掉 大于等于一年 的时间尺度的变化:1
cdo highpass,1 -del29feb infile outfile
假设数据是每小时的,时间周期为 5 年,但日历为 365/366 天,过滤掉 小于等于一年 的时间尺度的变化:
1
cdo lowpass,1 -del29feb infile outfile
假设数据是每小时的,时间周期为 5 年,但日历为 365/366 天,过滤掉季节循环和年际变化:
1
cdo bandpass,0.25,1 -del29feb infile outfile
空间网格平滑
<operator>[,options] infile outfile
| Operators | Description |
|---|---|
| smooth[,options] | 对所有输入域进行 nsmooth 点平滑,使用的点的数量取决于参数搜索半径 radius 和最大点的数量 maxpoints |
| Options | Type | Description |
|---|---|---|
| nsmooth | INTEGER | 平滑次数,默认为 nsmooth=1 |
| radius | STRING | 搜索半径,默认为 radius=1deg ;(单位:deg,rad,km,m) |
| maxpoints | INTEGER | 搜索最大点数,默认为 maxpoints=<gridsize> |
| form | STRING | 曲线形式,默认为 form=linear |
| weight0 | FLOAT | 距离为 0 的权重,默认为 weight0=0.25 |
| weightR | FLOAT | 距离为搜索半径的权重,默认为 weightR=0.25 |
<operator> infile outfile
| Operators | Description |
|---|---|
| smooth9 | 九点平滑,每个格点的结果是格点加上周围8个点的加权平均值; 中心点的权重为 1.0,两侧及上下各点的权重为 0.5,角点的权重为 0.3 |
计算时间步之间的步长
<operator> infile outfile
| Operators | Description |
|---|---|
| deltat | 计算每个时间步之间的差值 |
Timsort 时间排序
<operator> infile outfile
| Operators | Description |
|---|---|
| timsort | 对每个字段位置的所有时间步按升序对元素进行排序: |
Generate a field 生成字段
<operator>,parameter outfile
| Operators | Description |
|---|---|
| const,const,grid | 创建一个常量字段,网格中的所有字段元素都具有相同的值 const |
| random,grid[,seed] | 创建一个 [0, 1] 区间内随机分布的字段 |
| topo[,grid] | 创建一个地形数据的字段,默认网格为全球 0.5° 分辨率 |
| seq,start,end[,inc] | 创建一个一维的时间序列 |
| stdatm,levels | 创建 流体静力大气 的气压和温度值字段;这是流体静力学方程的解,只对对流层有效 |
例子
要在给定的水平网格上创建标准大气数据集:1
cdo enlarge,gridfile -stdatm,10000,8000,5000,3000,2000,1000,500,200,0 outfile
Derived model parameters 推导海平面气压和位势高度
<operator> infile outfile
| Operators | Description |
|---|---|
| sealevelpressure | 根据变量 surface_air_pressure , surface_geopotential 和 air_temperature 计算海平面气压 air_pressure_at_sea_level |
| gheight | 根据变量 surface_air_pressure , surface_geopotential , specific_humidity 和 air_temperature 计算位势高度 geopotential_height |
Histogram
<operator>,bounds infile outfile
| Operators | Description |
|---|---|
| histcount,bounds | 统计 bin 范围中的元素数量 ; 参数 bounds 为用逗号分隔的 bin 边界的列表 |
| histsum,bounds | 统计 bin 范围中的元素的和 |
| histmean,bounds | 统计 bin 范围中的元素的均值 |
| histfreq,bounds | 统计 bin 范围中的元素的相对频率 |