netcdf4 - 从哥白尼读取 NetCDF4 LST 文件的问题
问题描述
我有一系列来自哥白尼的每小时 LST 数据。这些可以在 Panopoly(Windows 版本 4.10.6)中很好地阅读和显示,但是:
- 使用“NetCDF4 Browser”插件(V0.3)打开时崩溃 QGIS 2.18.13
- 使用 R ncdf4 代码错误地读取 LST 变量:
*
file1 <- nc_open('g2_BIOPAR_LST_201901140400_E114.60S35.43E119.09S30.22_GEO_V1.2.nc')
file2 <- nc_open('g2_BIOPAR_LST_201901140500_E114.60S35.43E119.09S30.22_GEO_V1.2.nc')
# attributes(file1)$names
# Just for one variable for now
dat_new <- cbind(
ncvar_get(file1, 'LST'),
ncvar_get(file2, 'LST'))
dim(dat_new)
print(dim(dat_new))
var <- file1$var['LST']$LST
# Create a new file
file_new <- nc_create(
filename = 'Copernicus_LST.nc',
# We need to define the variables here
vars = ncvar_def(
name = 'LST',
units = var$units,
dim = dim(dat_new)))
# And write to it
ncvar_put(
nc = file_new,
varid = 'LST',
vals = dat_new)
# Finally, close the file
nc_close(file_new)
回报:
[1] "Error, passed variable has a dim that is NOT of class ncdim4!"
[1] "Error occurred when processing dim number 1 of variable LST"
Error in ncvar_def(name = "LST", units = var$units, dim = dim(dat_new)) :
This dim has class: integer
同样,使用 python netCDF4 方法
compiled = netCDF4.MFDataset(['g2_BIOPAR_LST_201901140400_E114.60S35.43E119.09S30.22_GEO_V1.2.nc','g2_BIOPAR_LST_201901140500_E114.60S35.43E119.09S30.22_GEO_V1.2.nc']))
退货
ValueError: MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4
我假设这是哥白尼文件格式的问题......还有其他人遇到过这个吗?将这两个示例文件放在这里。
谢谢!
解决方案
推荐阅读
- flask - 如何使用 pytest 测试 Flask 视图上下文和模板?
- php - 使用 post 方法在 db 表上使用 select 并在同一页面中获取结果
- dart - 如何关闭 receivePort 以使 .toList() 方法正常工作?
- javascript - 已经在服务器上呈现的页面具有 Jquery 事件处理在 React 中不起作用
- javascript - Rails/Webpack:无法访问 JS 库
- python-3.x - 在 Windows 10 上构建 Azure-iot-Hub Python-SDk。如何设置 BOOST 和 cmake 的路径
- java - 417 使用 RestTemplate 进行 POST 请求时期望失败
- python - 在多列上施加层次结构,根据其他列更改列值的随机数
- xquery - 转换十进制数字结果中的值
- salesforce - 如何获取 Salesforce 中特定对象的所有审批流程名称