如何在不修改其他变量的情况下从 netcdf 文件中删除/删除维度?

问题描述

需要帮助。请看一看并提出解决方案。请注意,我是初学者。

I have a netcdf file named 'Lw_15_21.nc' 
netcdf Lw_15_21 {
dimensions:
        longitude = 135 ;
        latitude = 129 ;
        expver = 2 ;
        time = 54247 ;
variables:
        float longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        float latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        int expver(expver) ;
                expver:long_name = "expver" ;
        int time(time) ;
                time:units = "hours since 1900-01-01 00:00:00.0" ;
                time:long_name = "time" ;
                time:calendar = "gregorian" ;
        short str(time,expver,latitude,longitude) ;
                str:scale_factor = 22.4949414798651 ;
                str:add_offset = -574761.74747074 ;
                str:_FillValue = -32767s ;
                str:missing_value = -32767s ;
                str:units = "J m**-2" ;
                str:long_name = "Surface net thermal radiation" ;
                str:standard_name = "surface_net_upward_longwave_flux" ;

我想删除变量 expver(因为它会阻止与其他 *.nc 文件合并)。 即使在删除之后(使用 nco 的命令 ncks -C -O -x -v expver Lw_15_21.nc test.nc),expver 仍然保留在维度和变量 str 中。

netcdf test {
dimensions:
        latitude = 129 ;
        longitude = 135 ;
        time = 54247 ;
        expver = 2 ;
variables:
        float latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        float longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        short str(time,longitude) ;
                str:scale_factor = 22.4949414798651 ;
                str:add_offset = -574761.74747074 ;
                str:_FillValue = -32767s ;
                str:missing_value = -32767s ;
                str:units = "J m**-2" ;
                str:long_name = "Surface net thermal radiation" ;
                str:standard_name = "surface_net_upward_longwave_flux" ;
        int time(time) ;
                time:units = "hours since 1900-01-01 00:00:00.0" ;
                time:long_name = "time" ;
                time:calendar = "gregorian" ;

如何从维度和变量 str 中删除 expver,同时保持其他不变。我也尝试过 ncwa -a,但遇到了分段错误(核心转储)错误。 这意味着我想得到以下输出

假设文件test1.nc

netcdf test1 {
dimensions:
        latitude = 129 ;
        longitude = 135 ;
        time = 54247 ;
variables:
        float latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        float longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        short str(time,longitude) ;
                str:scale_factor = 22.4949414798651 ;
                str:add_offset = -574761.74747074 ;
                str:_FillValue = -32767s ;
                str:missing_value = -32767s ;
                str:units = "J m**-2" ;
                str:long_name = "Surface net thermal radiation" ;
                str:standard_name = "surface_net_upward_longwave_flux" ;
        int time(time) ;
                time:units = "hours since 1900-01-01 00:00:00.0" ;
                time:long_name = "time" ;
                time:calendar = "gregorian" ;

谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...