使用python pydap下载的数据未显示

2024-07-02 11:34:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用pydap从特定URL下载数据,我想显示其中一个数据集,但出现以下错误:

ValueError: string size must be a multiple of element size

下面是节目。你能帮我调整一下程序,以便我能成功地显示所需的数据吗

#!/bin/python

from pydap.client import open_url
from datetime import *
import datetime
import pickle

now = datetime.datetime.now()

hycomdata = open_url('http://tds.hycom.org/thredds/dodsC/GLBv0.08/expt_93.0/data/forecasts/runs/FMRC_RUN_2019-06-02T12:00:00Z?depth[1:1:14],lat[0:1:3250],lon[0:1:4499],time[0:1:56],water_temp[0:1:56][0:1:14][0:1:3250][0:1:4499],water_u[0:1:56][1:1:14][0:1:3250][0:1:4499],water_v[0:2:56][0:1:14][0:1:3250][0:1:4499],time_offset[0:1:56]')

u = hycomdata['water_u']
v = hycomdata['water_v']
sst = hycomdata['water_temp']

print u[:][:]

Tags: 数据fromimporturlsizedatetimetime错误