Skip to content

Instantly share code, notes, and snippets.

View venabled's full-sized avatar
😻

Don Venable venabled

😻
  • Veth Research Associates
  • Dayton, OH
View GitHub Profile
@venabled
venabled / pyramid_dask.py
Created August 14, 2015 17:43
scikit-image + dask pyramid reduction
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dask.array as da
import numpy as np
import argparse
from skimage.transform import resize, pyramids
import h5py
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-289-233f4f2e1f24> in <module>()
3 dimg = da.from_array(img, chunks=chunkshape)
4 gray = dimg.map_blocks(lambda arr: arr.mean(axis=2), chunks=(256, 256))
----> 5 grayimg = gray.compute()
/Users/venabled/anaconda/lib/python2.7/site-packages/dask/array/core.pyc in compute(self, **kwargs)
721 @wraps(compute)
722 def compute(self, **kwargs):