Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含 8 个变量和 4 个维度的 netCDF 文件:纬度(dim:26)、经度(dim:17)、时间(dim:很多)和级别(dim:1,压力级别)。为了在特定程序中使用它,我只需要 3 个维度:纬度、经度和时间。
有没有一种简单的方法可以删除每个变量中的级别维度?
我发现ncwa -a old_dim ifile.nc ofile.nc但有时它将类型从短转换为浮点。当它保持短类型时,属性“比例因子”和“add.offset”被删除。问题是我想保留带有比例因子的短类型并添加偏移量。
ncwa -a old_dim ifile.nc ofile.nc
您的方法是正确的,但是,您的输入数据是“打包”的。在使用ncwa平均级别维度后,使用ncpdq重新打包输出文件:
ncpdq ofile.nc ofile2.nc
你就完成了。请参阅此处的文档。