- 积分
- 9418
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-7-3
- 最后登录
- 1970-1-1
|
发表于 2021-9-12 18:37:42
|
显示全部楼层
搜到用命令尝试着转过但出错了。用以下命令试过
from xgrads import open_CtlDataset
open_CtlDataset('E:/Study/Data_assimilation/paper/model2data/DATA_back200/nature/t30.ctl').to_netcdf('output.nc')
但Hi出错信息显示如下:
Traceback (most recent call last):
File "e:/Study/Data_assimilation/paper/JGR/DATA_back200/result/grd2nc.py", line 3, in <module>
open_CtlDataset('E:/Study/Data_assimilation/paper/model2data/DATA_back200/nature/t30.ctl').to_netcdf('output.nc')
File "D:\ProgramData\Anaconda3\lib\site-packages\xarray\core\dataset.py", line 1784, in to_netcdf
return to_netcdf(
File "D:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\api.py", line 1035, in to_netcdf
_validate_attrs(dataset, invalid_netcdf=invalid_netcdf and engine == "h5netcdf")
File "D:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\api.py", line 172, in _validate_attrs
check_attr(k, v, valid_types)
File "D:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\api.py", line 164, in check_attr
raise TypeError(
TypeError: Invalid value for attr 'pdef': None. For serialization to netCDF files, its value must be of one of the following types: str, Number, ndarray, number, list, tuple |
|