In [5]:
%%time
import datashader as ds
import datashader.transfer_functions as tf
import pandas as pd
#df = pd.read_hdf('TEST.hdf5', '/coordinates/csv', columns=['x', 'y'])
df = pd.read_csv('TEST.csv', usecols= ['x', 'y'])
df.tail()
Wall time: 378 ms
In [12]:
%%time
World = (( -180,  180), (-90, 90))
x_range,y_range = World
plot_width  = int(1700)
#plot_height = int(plot_width*7.0/12)
plot_height = int(1000)
background = "black"
Wall time: 0 ns
In [13]:
%%time
from functools import partial
from datashader.utils import export_image
from datashader.colors import colormap_select, Greys9
from colorcet import fire
from IPython.core.display import HTML, display
export = partial(export_image, background = background, export_path="export")
cm = partial(colormap_select, reverse=(background!="black"))
display(HTML("<style>.container { width:100% !important; }</style>"))
Wall time: 2 ms
In [14]:
%%time
cvs = ds.Canvas(plot_width, plot_height, *World)
agg = cvs.points(df, 'x', 'y')
Wall time: 20 ms
In [15]:
%%time
export(tf.shade(agg, cmap = cm(fire,0.2), how='eq_hist'),"TEST")
Wall time: 280 ms
Out[15]: