This notebooks contains a demonstration of reading and visulizing data from the NAS ECCO Data Portal. It makes use of the following software libraries:
llcreadermodule which makes all of this work
We start by importing the necessary libraries
import xmitgcm.llcreader as llcreader %matplotlib inline import holoviews as hv from holoviews.operation.datashader import regrid hv.extension('bokeh')
model = llcreader.ECCOPortalLLC2160Model() model
model object can generate xarray datasets for us.
In this example, we generate a dataset which contains the SST for the full model integration.
type='latlon' keyword tells xmitgcm to just show us the "Lat Lon" (LL) part of the LLC grid.
ds_sst = model.get_dataset(varnames=['Theta'], k_levels=, type='latlon') ds_sst
This dataset is "lazy"; it doesn't actually load any data from the server until required for computation or plotting. That's a good thing, because it represents over 4 TB of data.
ds_sst.nbytes / 1e12
Here we create an interactive map of SST which automatically resamples the fields at a resolution appropriate for our screen.
dataset = hv.Dataset(ds_sst.Theta.isel(k=0).astype('f4')) hv_im = (dataset.to(hv.Image, ['i', 'j'], dynamic=True) .options(cmap='Magma', width=950, height=600, colorbar=True)) %output holomap='scrubber' fps=3 regrid(hv_im, precompute=True)