scipy.io.savemat模块保存错误的结构垫

时间:2015-04-28 11:20:56

标签: matlab python-2.7 numpy scipy netcdf

我的环境:window7 32bit anaconda spyder。

这是我的脚本,

from netCDF4 import Dataset
import matplotlib.pyplot as plt
import scipy.io as sio 

s = 'http://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_19.1/2012/3hrly'
f = Dataset(s, 'r')
v = f.variables

u = v['water_u'][0:1, 0:1, 1413:1651, 3838:4034]
u_xy = u[0,0,:,:]

sio.savemat('savemat.mat', {'mat_u': u})
loadmat_u = sio.loadmat('savemat.mat')['mat_u']
mat_u_xy = loadmat_u[0,0,:,:]

plt.figure(1)
plt.imshow(u_xy)
plt.colorbar()

plt.figure(2)
plt.imshow(mat_u_xy)
plt.colorbar()

figure(1)figure(2)彼此不同。我觉得有些事 错误scipy.io.savemat

数字:

http://i59.tinypic.com/mx1qiu.png

http://i60.tinypic.com/2d0z7mx.png

0 个答案:

没有答案