#!/usr/bin/env python # coding: utf-8 # In[1]: import azarr # In[2]: # see https://pangeo-forge.org/dashboard/feedstock/88 url = 'https://ncsa.osn.xsede.org/Pangeo/pangeo-forge/pangeo-forge/EOBS-feedstock/eobs-surface-downwelling.zarr' # In[3]: z = azarr.open_consolidated(url) # In[4]: list(z) # In[5]: z.latitude # In[6]: z.latitude[:] # In[7]: # get two three arrays with a single context switch to async # and only one latency wait import asyncio import time t0 = time.time() lat, lot, t = await asyncio.gather( z.latitude[:], z.longitude[:], z.time[:] ) t1 = time.time() t1 - t0 # In[8]: lat[:100] # In[9]: z.qq.shape, z.qq.chunks # In[10]: # or opposite ends of the same array slice1, slice2 = await asyncio.gather( z.qq[:2, 200:250, 300:350], z.qq[-1, 200:250, 300:350] ) # In[11]: slice2 # In[ ]: