gpt4 book ai didi

netcdf - 修改netcdf文件的变量属性

转载 作者:行者123 更新时间:2023-12-04 00:56:38 24 4
gpt4 key购买 nike

我正在尝试修改 netcdf 文件中时间变量的日历类型,以将 GREGORIAN 更改为 gregorian,因为我认为这会在我尝试时引起问题在以后的分析中访问时间变量。

        double Time(Time) ;
Time:long_name = "Time" ;
Time:units = "days since 1979-01-01 00:00:00" ;
Time:cartesian_axis = "T" ;
Time:calendar_type = "GREGORIAN" ;
Time:calendar = "GREGORIAN" ;
Time:bounds = "Time_bounds" ;
Time:_ChunkSizes = 1 ;

        double Time(Time) ;
Time:long_name = "Time" ;
Time:units = "days since 1979-01-01 00:00:00" ;
Time:cartesian_axis = "T" ;
Time:calendar_type = "gregorian" ;
Time:calendar = "gregorian" ;
Time:bounds = "Time_bounds" ;
Time:_ChunkSizes = 1 ;

我曾尝试使用 nco 函数 nccat,但我似乎无法获得正确的语法。我试过:

ncatted -a 'calendar,time,o,c,"gregorian"' Ocean_v_1994_01.nc out.nc

最佳答案

您在 ncatted 参数周围放置的单引号导致双引号变成文字,这不是您想要的。您的论点中没有文字、空格或特殊字符,因此只需删除所有引号:

ncatted -a calendar,time,o,c,gregorian Ocean_v_1994_01.nc out.nc

关于netcdf - 修改netcdf文件的变量属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61994624/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com