Source

yt.web_interactors / simple_test.py

from yt.mods import *
from var_types import variable_types as vt
from disp_types import display_types as dt
from interact import Interactor

pf = load("/home/mturk/data/DD0039/output_0039")

@Interactor(coord = vt['float_range'](0.0, 1.0),
            axis = vt['item_list']('x', 'y', 'z'),
            field = vt['item_list'](*pf.h.field_list),
            return_value = dt['image_array']())
def slice_image(coord, axis, field):
    ax = {'x':0,'y':1,'z':2}
    sl = pf.h.slice(ax[axis], coord)
    frb = sl.to_frb(1.0, 512)
    return na.log10(frb[field])

slice_image.serve()