Skip to content

HoloViews and Lancet

J.L Stevens edited this page Apr 6, 2015 · 3 revisions
# In[1]:

import lancet
import imagen
from holoviews import HoloMap
from holoviews.core.io import Unpickler, Pickler
%load_ext holoviews.ipython


# In[2]:

Pickler.save(imagen.Gaussian()[:]+imagen.Disk()[:], 
             'example1', key={'time':1})
Pickler.save(imagen.Disk()[:]+imagen.Gaussian()[:], 
             'example2', key={'time':2})


# In[3]:

filetype = lancet.filetypes.CustomFile(
    data_fn= lambda f: {e: Unpickler.load(f, [e]) 
                                for e in Unpickler.entries(f)},
    metadata_fn=lambda f: Unpickler.key(f))

files = lancet.FilePattern('files', '*.hvz')
loaded = lancet.FileInfo(files, 'files', filetype=filetype)


# In[4]:

print filetype.data('example1.hvz')
print filetype.metadata('example1.hvz')


# In[5]:

loaded.table


# In[6]:

%output size=250
loaded.load(loaded.table)


# In[7]:

HoloMap(t[:,'Pattern.Disk'])


# In[8]:

HoloMap(t[:,'Pattern.Gaussian'])


# In[9]:

HoloMap(t)


# In[10]:

t[1, 'Pattern.Gaussian']
Clone this wiki locally