[英]chanaging standard_name and long_name with NCO
我从 NetCDF 文件计算了潜在温度。 我想用NCO
更改standard_name
和long_name
。 我尝试了一些没有成功的命令,例如:
> ncatted -a name,Temperature,o,c,"Potential_Temperature" pt_19891020-19891022.nc
ncatted: ERROR File contains no variables or groups that match name Temperature so attribute name cannot be changed
> ncrename -a air_temperature,air_potential_temperature -a Temperature,Potential_Temperature pt_19891020-19891022.nc
ncrename: ERROR Required attribute 'air_temperature' not present in group '/'.
HINT: If attribute presence is intended to be optional, then prefix attribute name with the period character '.', e.g., .air_temperature. With this syntax ncrename would succeed even when no variables or groups contain the attribute. If the attribute is intended to be renamed only in a specific variable, then prepend the variable name plus an at-sign '@' to the attribute name, e.g., var_nm@att_nm. If attribute presence is required only for root group (i.e., a global attribute), then prefix attribute name with "global" and an at-sign, e.g., global@att_nm. If attribute presence is required for all groups, then prefix attribute name with "group" and an at-sign, e.g., group@att_nm.
当前文件属性:
$ cdo showattsvar pt_19891020-19891022.nc
pt:
standard_name = "air_temperature"
long_name = "Temperature"
units = "K"
missing_value = -32767
所需属性:
pt:
standard_name = "air_potential_temperature"
long_name = "Potential_Temperature"
units = "K"
missing_value = -32767
这些是属性,因此ncatted
是正确的工具,并且文档在此处包含正确语法的示例:
ncatted -a standard_name,pt,o,c,air_potential_temperature -a long_name,pt,o,c,Potential_temperature pt_19891020-19891022.nc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.