用 NCO 改变 standard_name 和 long_name
chanaging standard_name and long_name with NCO
我从 NetCDF 文件计算了 potential temperaure。我想将 standard_name
和 long_name
更改为 NCO
。
我尝试了一些命令但没有成功,例如:
> 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
是正确的工具,文档 here 包含正确语法的示例:
ncatted -a standard_name,pt,o,c,air_potential_temperature -a long_name,pt,o,c,Potential_temperature pt_19891020-19891022.nc
我从 NetCDF 文件计算了 potential temperaure。我想将 standard_name
和 long_name
更改为 NCO
。
我尝试了一些命令但没有成功,例如:
> 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
是正确的工具,文档 here 包含正确语法的示例:
ncatted -a standard_name,pt,o,c,air_potential_temperature -a long_name,pt,o,c,Potential_temperature pt_19891020-19891022.nc