cftime._cftime.DatetimeGregorian'对象没有属性'ndim'

问题描述

我的问题:

cftime._cftime.DatetimeGregorian”对象没有属性“ ndim”。

我使用netCDF4读取了带有(time_coord,lat,lon)的NC数据集。带有以下内容的Timestamp_utc

information:double ddm_timestamp_utc(sample=3568,x=50,y=50);
:long_name = "DDM sample timestamp - UTC";
:standard_name = "time";
:calendar = "gregorian";
:comment = "DDM sample time. The number of seconds since time_coverage_start with nanosecond resolution. Its position relative to the DDM sampling period is determined by ddm_time_type_selector. Some Metadata required for DDM calibration are generated relative to pvt_timestamp_utc or att_timestamp_utc. These Metadata are interpolated to ddm_timestamp_utc before being used for DDM calibration. Note that the DDM sampling period is not synchronized with the UTC change of second and can occur at any time relative to the UTC change of second.";
:units = "seconds since 2016-01-01 00:00:00.0"

我尝试阅读以下代码

nc_time = nc.variables['ddm_timestamp_utc'][:,i,j]
units = nc.variables['ddm_timestamp_utc'].units
calendar = nc.variables['ddm_timestamp_utc'].calendar
tt =[np.datetime64(num2date(t,units,calendar=calendar)).astype(datetime)
for t in nc_time] time = np.ma.array(tt,mask=nc_time.mask)

我遇到了一个归属错误

cftime._cftime.DatetimeGregorian”对象没有属性“ ndim”

在以下行中:

tt =[np.datetime64(num2date(t,calendar=calendar)).astype(datetime) for t in nc_time].

我想这个问题可能是由netCDF(1.5.3)或python版本(我尝试过3.7和3.8)引起的

解决方法

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

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

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

相关问答

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