首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用NCO实现standard_name和long_name

用NCO实现standard_name和long_name
EN

Stack Overflow用户
提问于 2022-01-07 14:11:19
回答 1查看 178关注 0票数 0

我从一个电位温度文件中计算出了NetCDF。我想用standard_namelong_name修改NCO。我尝试过一些没有成功的命令,例如:

代码语言:javascript
复制
> 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.

当前文件属性:

代码语言:javascript
复制
$ cdo showattsvar pt_19891020-19891022.nc 
 pt:
   standard_name = "air_temperature"
   long_name = "Temperature"
   units = "K"
   missing_value = -32767

期望的属性:

代码语言:javascript
复制
 pt:
   standard_name = "air_potential_temperature"
   long_name = "Potential_Temperature"
   units = "K"
   missing_value = -32767
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-07 21:29:23

这些都是属性,因此ncatted是正确的工具,文档是这里,有正确语法的示例:

代码语言:javascript
复制
ncatted -a standard_name,pt,o,c,air_potential_temperature -a long_name,pt,o,c,Potential_temperature pt_19891020-19891022.nc
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70622457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档