Extract the data from .zidv bundles into Python xarray¶
[3]:
def load_from_zidv(url=None,outdir=None):
assert url.startswith('http:'),'only urls supported at this time'
remote_file=request.urlopen(url)
alldata=[]
with ZipFile(BytesIO(remote_file.read())) as zip_file:
for contained_file in zip_file.namelist():
if str(contained_file).startswith('data_'):
data=xr.open_dataset(zip_file.extract(contained_file,outdir))
alldata.append(data)
return xr.merge(alldata)
[ ]: