【问题标题】:chanaging standard_name and long_name with NCO使用 NCO 更改标准名称和长名称
【发布时间】:2022-01-07 14:11:19
【问题描述】:

我从 NetCDF 文件中计算了 potential temperaure。我想将standard_namelong_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

【问题讨论】:

    标签: netcdf cdo-climate nco


    【解决方案1】:

    这些是属性,所以 ncatted 是正确的工具,文档是 here 并带有正确语法的示例:

    ncatted -a standard_name,pt,o,c,air_potential_temperature -a long_name,pt,o,c,Potential_temperature pt_19891020-19891022.nc
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-05
      • 1970-01-01
      • 2019-07-14
      • 2018-06-10
      • 1970-01-01
      • 1970-01-01
      • 2021-05-28
      • 1970-01-01
      相关资源
      最近更新 更多