glucifer.lavavu module

LavaVu python interface: viewer utils & wrapper

NOTE: regarding sync of state between python and library - sync from python to lavavu is immediate,

property setting must always trigger a sync to lavavu
  • sync from lavavu to python is lazy, always need to call _get()
    before using state data
#TODO:
  • zoom to fit in automated image output broken, initial timestep differs, margins out
  • translation setting different if window aspect ratio changes

Module Summary

functions:

glucifer.lavavu.cubeHelix Create CubeHelix spectrum colourmap with monotonically increasing/descreasing intensity
glucifer.lavavu.getVariableName Attempt to find the name of a variable from the main module namespace
glucifer.lavavu.printH5 Print info about HDF5 data set (requires h5py)
glucifer.lavavu.convert_keys Recursively converts dictionary keys and unicode values to utf-8 strings.
glucifer.lavavu.is_ipython
glucifer.lavavu.loadCPT Create a colourmap from a CPT colour table file
glucifer.lavavu.is_notebook

classes:

glucifer.lavavu.GeomData The GeomData class provides an interface to a single object data element
glucifer.lavavu.Geometry The Geometry class provides an interface to a drawing object’s internal data
glucifer.lavavu.Object The Object class provides an interface to a LavaVu drawing object
glucifer.lavavu.Viewer The Viewer class provides an interface to a LavaVu session
glucifer.lavavu.Objects The Objects class is used internally to manage and synchronise the drawing object list
glucifer.lavavu.Fig The Fig class wraps a figure

Module Details

functions:

glucifer.lavavu.cubeHelix(samples=16, start=0.5, rot=-0.9, sat=1.0, gamma=1.0, alpha=None)[source]

Create CubeHelix spectrum colourmap with monotonically increasing/descreasing intensity

Implemented from FORTRAN 77 code from D.A. Green, 2011, BASI, 39, 289. “A colour scheme for the display of astronomical intensity images” http://adsabs.harvard.edu/abs/2011arXiv1108.5083G

Parameters:
  • samples (int) – Number of colour samples to produce
  • start (float) – Start colour [0,3] 1=red,2=green,3=blue
  • rot (float) – Rotations through spectrum, negative to reverse direction
  • sat (float) – Colour saturation grayscale to full [0,1], >1 to oversaturate
  • gamma (float) – Gamma correction [0,1]
  • alpha (list,tuple) – Alpha [min,max] for transparency ramp
Returns:

colours – List of colours ready to be loaded by colourmap()

Return type:

list

glucifer.lavavu.getVariableName(var)[source]

Attempt to find the name of a variable from the main module namespace

Parameters:var (object) – The variable in question
Returns:name – Name of the variable
Return type:str
glucifer.lavavu.printH5(h5)[source]

Print info about HDF5 data set (requires h5py)

Parameters:h5 (hdf5 object) – HDF5 Dataset loaded with h5py
glucifer.lavavu.convert_keys(dictionary)[source]

Recursively converts dictionary keys and unicode values to utf-8 strings.

glucifer.lavavu.is_ipython()[source]
glucifer.lavavu.loadCPT(fn, positions=True)[source]

Create a colourmap from a CPT colour table file

Parameters:positions (boolean) – Set this to false to ignore any positional data and load only the colours from the file
Returns:colours – Colour string ready to be loaded by colourmap()
Return type:string
glucifer.lavavu.is_notebook()[source]

classes:

class glucifer.lavavu.GeomData(data, instance)[source]

Bases: object

The GeomData class provides an interface to a single object data element GeomData instances are created internally from the Geometry class

copy(), get() and set() methods provide access to the data types

Example

Get the most recently used object data element

>>> data = obj.data()
>>> el = data[-1]

Get a copy of the rgba colours (if any)

>>> colours = el.copy("rgba")

Get a view of the vertex data

>>> verts = el.get("vertices")

WARNING: this reference may be deleted by other calls, only use get() if you are processing the data immediately and not relying on it continuing to exist later

Get a copy of some value data by label >>> verts = el.copy(“colourvals”)

Load some new values for these vertices

>>> el.set("sampledfield", newdata)
copy(typename)[source]

Get a copy of a data element from a set of geometry data

This is a safe version of get() that copies the data before returning so can be assured it will remain valid

Parameters:typename (str) – Type of data to be retrieved (vertices/normals/vectors/indices/colours/texcoords/luminance/rgb/values)
Returns:data – Numpy array containing a copy of the data set requested
Return type:array
get(typename)[source]

Get a data element from a set of geometry data

Warning... other than for internal use, should always immediately make copies of the data there is no guarantee memory will not be released!

Parameters:typename (str) – Type of data to be retrieved (vertices/normals/vectors/indices/colours/texcoords/luminance/rgb/values)
Returns:data – Numpy array view of the data set requested
Return type:array
set(typename, array)[source]

Set a data element in a set of geometry data

Parameters:
  • typename (str) – Type of data to set (vertices/normals/vectors/indices/colours/texcoords/luminance/rgb/values)
  • array (array) – Numpy array holding the data to be written
class glucifer.lavavu.Geometry(obj, filter=None)[source]

Bases: list

The Geometry class provides an interface to a drawing object’s internal data Geometry instances are created internally in the Object class with the data() method

Example

Get all object data

>>> data = obj.data()

Get only triangle data

>>> data = obj.data("triangles")

Loop through data

>>> data = obj.data()
>>> for el in obj.data:
>>>     print(el)
class glucifer.lavavu.Object(idict, instance, *args, **kwargs)[source]

Bases: dict

The Object class provides an interface to a LavaVu drawing object Object instances are created internally in the Viewer class and can be retrieved from the object list

New objects are also created using viewer methods

Parameters:**kwargs – Initial set of properties passed to the created object

Example

Create a viewer, load some test data, get objects

>>> import lavavu
>>> lv = lavavu.Viewer()
>>> lv.test()
>>> print(lv.objects)

Object properties can be passed in when created or set by using as a dictionary:

>>> obj = lv.points(pointtype="sphere")
>>> obj["pointsize"] = 5

A list of available properties can be found here: https://github.com/OKaluza/LavaVu/wiki/Property-Reference or by using the online help:

>>> obj.help('opacity')
append()[source]

Append a new data element to the object

Object data is sometimes dependant on individual elements to determine where one part ends and another starts, eg: line segments, grids

This allows manually closing the active element so all new data is loaded into a new element

clear()[source]

Clear all visualisation data from this object

cleardata(typename='')[source]

Clear specific visualisation data/values from this object

Parameters:typename (str) –

Optional filter naming type of data to be cleared, Either a built in type:

(vertices/normals/vectors/indices/colours/texcoords/luminance/rgb/values)

or a user defined data label

colourbar(**kwargs)[source]

Create a new colourbar using this object’s colourmap

Returns:colourbar – The colourbar object created
Return type:Object
colourmap(data, reverse=False, monochrome=False, **kwargs)[source]

Load colour map data for object

Parameters:
  • data (list,str) – Provided colourmap data can be - a string, - list of colour strings, - list of position,value tuples - or a built in colourmap name Creates a colourmap named objectname_colourmap if object doesn’t already have a colourmap
  • reverse (boolean) – Reverse the order of the colours after loading
  • monochrome (boolean) – Convert to greyscale
colours(data)[source]

Load colour data for object

Parameters:data (str,list,array) – Pass a list or numpy uint32 array of colours if a string or list of strings is provided, colours are parsed as html colour string values if a numpy array is passed, colours are loaded as 4 byte ARGB unsigned integer values
data(filter=None)[source]

Return internal geometry data Returns a Geometry() object that can be iterated through containing all data elements Elements contain vertex/normal/value etc. data as numpy arrays

Parameters:filter (str) – Limit the data returned to this type (labels, points, grid, triangles, vectors, tracers, lines, shapes, volume)
Returns:data – An object holding the data elements retrieved
Return type:Geometry

Example

>>> data = obj.data()
>>> for el in obj.data:
>>>     print(el)
datasets()[source]

Retrieve available data sets on this object

Returns:data – A string representation of the data objects available
Return type:str
exclude(*args, **kwargs)[source]

Filter data by excluding a range of values shortcut for:

filter(... , out=True)
Parameters:
  • label (str) – Data label to filter on
  • values (number,list,tuple) – value range single value, list or tuple if a single value the filter applies to only this value: x == value if a list eg: [0,1] range is inclusive 0 <= x <= 1 if a tuple eg: (0,1) range is exclusive 0 < x < 1
Returns:

filter – The filter id created

Return type:

int

excludemap(*args, **kwargs)[source]

Filter data by excluding a range of mapped values shortcut for:

filter(... , out=True, map=True)
Parameters:
  • label (str) – Data label to filter on
  • values (number,list,tuple) – value range single value, list or tuple if a single value the filter applies to only this value: x == value if a list eg: [0,1] range is inclusive 0 <= x <= 1 if a tuple eg: (0,1) range is exclusive 0 < x < 1
Returns:

filter – The filter id created

Return type:

int

file(*args, **kwargs)[source]

Load data from a file into this object

Parameters:filename (str) – Name of the file to load
files(*args, **kwargs)[source]

Load data from a series of files into this object (using wildcards or a list)

Parameters:files (str) – Specification of the files to load
filter(label, values, out=False, map=False)[source]

Filter data by including a range of values

Parameters:
  • label (str) – Data label to filter on
  • values (number,list,tuple) – value range single value, list or tuple if a single value the filter applies to only this value: x == value if a list eg: [0,1] range is inclusive 0 <= x <= 1 if a tuple eg: (0,1) range is exclusive 0 < x < 1
  • out (boolean) – Set this flag to filter out values instead of including them
  • map (boolean) – Set this flag to filter by normalised values mapped to [0,1] instead of actual min/max of the data range
Returns:

filter – The filter id created

Return type:

int

getcolourmap(string=True)[source]

Return the colour map data from the object as a string or list Either return format can be used to create/modify a colourmap with colourmap()

Parameters:string (boolean) – The default is to return the data as a string of colours separated by semi-colons To instead return a list of (position,[R,G,B,A]) tuples for easier automated processing in python, set this to False
Returns:mapdata – The formatted colourmap data
Return type:str/list
help(cmd='')[source]

Get help on an object method or property

Parameters:cmd (str) – Command to get help with, if ommitted displays general introductory help If cmd is a property or is preceded with ‘@’ will display property help
include(*args, **kwargs)[source]

Filter data by including a range of values shortcut for:

filter(... , out=False)
Parameters:
  • label (str) – Data label to filter on
  • values (number,list,tuple) – value range single value, list or tuple if a single value the filter applies to only this value: x == value if a list eg: [0,1] range is inclusive 0 <= x <= 1 if a tuple eg: (0,1) range is exclusive 0 < x < 1
Returns:

filter – The filter id created

Return type:

int

includemap(*args, **kwargs)[source]

Filter data by including a range of mapped values shortcut for:

filter(... , out=False, map=True)
Parameters:
  • label (str) – Data label to filter on
  • values (number,list,tuple) – value range single value, list or tuple if a single value the filter applies to only this value: x == value if a list eg: [0,1] range is inclusive 0 <= x <= 1 if a tuple eg: (0,1) range is exclusive 0 < x < 1
Returns:

filter – The filter id created

Return type:

int

indices(data)[source]

Load index data for object

Parameters:data (list,array) – Pass a list or numpy uint32 array of indices indices are loaded as 32 bit unsigned integer values
isosurface(name=None, convert=False, updatedb=False, compress=True, **kwargs)[source]

Generate an isosurface from a volume data set using the marching cubes algorithm

Parameters:
  • name (str) – Name of the created object, automatically assigned if not provided
  • convert (bool) – Setting this flag to True will replace the existing volume object with the newly created isosurface by deleting the volume data and loading the mesh data into the preexisting object
  • updatedb (bool) – Setting this flag to True will write the newly created/modified data to the database when done
  • compress (boolean) – Use zlib compression when writing the geometry data
  • **kwargs – Initial set of properties passed to the created object (Must include “isovalues=[]”)
Returns:

obj – The isosurface object created/converted

Return type:

Object

labels(data)[source]

Load label data for object

Parameters:data (list,str) – Pass a label or list of labels to be applied, one per vertex
name

Get the object’s name property

Returns:name – The name of the object
Return type:str
normals(data)[source]

Load normal data for object

Parameters:data (list,array) – Pass a list or numpy float32 array of normals
reload()[source]

Fully reload the object’s data, recalculating all parameters such as colours that may be cached on the GPU, required after changing some properties so the changes are reflected in the visualisation

select()[source]

Set this object as the selected object

texture(data, width, height, channels=4, flip=True)[source]

Load raw texture data for object

Parameters:
  • data (list,array) – Pass a list or numpy uint32 or uint8 array texture data is loaded as raw image data
  • width (int) – image width in pixels
  • height (int) – image height in pixels
  • channels (int) – colour channels/depth in bytes (1=luminance, 3=RGB, 4=RGBA)
  • flip (boolean) – flip the texture vertically after loading (default is enabled as usually required for OpenGL but can be disabled)
triangles(data, split=0)[source]

Load triangle data,

This is the same as loading vertices into a triangle mesh object but allows decomposing the mesh into smaller triangles with the split option

Parameters:split (int) – Split triangles this many times on loading
update(filter=None, compress=True)[source]

Write the objects’s visualisation data back to the database

Parameters:
  • filter (str) – Optional filter to type of geometry to be updated, if omitted all will be written (labels, points, grid, triangles, vectors, tracers, lines, shapes, volume)
  • compress (boolean) – Use zlib compression when writing the geometry data
values(data, label='default')[source]

Load value data for object

Parameters:
  • data (list,array) – Pass a list or numpy float32 array of values
  • label (str) – Label for this data set
vectors(data)[source]

Load vector data for object

Parameters:data (list,array) – Pass a list or numpy float32 array of vectors
vertices(data=None)[source]

Load vertex data for object

Parameters:data (list,array) – Pass a list or numpy float32 array of vertices
class glucifer.lavavu.Viewer(arglist=None, database=None, figure=None, timestep=None, port=0, verbose=False, interactive=False, hidden=True, cache=False, quality=2, writeimage=False, resolution=None, script=None, initscript=False, usequeue=False, binpath='/home/docs/checkouts/readthedocs.org/user_builds/underworld2/checkouts/v2.4.1b/glucifer/bin', omegalib=False, *args, **kwargs)[source]

Bases: dict

The Viewer class provides an interface to a LavaVu session

Parameters:
  • arglist (list) – list of additional init arguments to pass
  • database (str) – initial database (or model) file to load
  • figure (int) – initial figure id to display
  • timestep (int) – initial timestep to display
  • port (int) – web server port
  • verbose (boolean) – verbose output to command line for debugging
  • interactive (boolean) – begin in interactive mode, opens gui window and passes control to event loop immediately
  • hidden (boolean) – begin hidden, for offscreen rendering or web browser control
  • cache (boolean) – cache all model timesteps in loaded database, everything loaded into memory on startup (assumes enough memory is available)
  • quality (integer) – Render sampling quality, render 2^N times larger image and downsample output For anti-aliasing image rendering where GPU multisample anti-aliasing is not available
  • writeimage (boolean) – Write images and quit, create images for all figures/timesteps in loaded database then exit
  • resolution (list, tuple) – Window/image resolution in pixels [x,y]
  • script (list) – List of script commands to run after initialising
  • initscript (boolean) – Set to False to disable loading any “init.script” file found in current directory
  • usequeue (boolean) – Set to True to add all commands to a background queue for processing rather than immediate execution
  • **kwargs – Remaining keyword args will be passed to the created viewer and parsed into the initial set of global properties

Example

Create a viewer, setting the initial background colour to white

>>> import lavavu
>>> lv = lavavu.Viewer(background="white")

Objects can be added by loading files:

>>> obj = lv.file('model.obj')

Or creating empty objects and loading data:

>>> obj = lv.points('mypoints')
>>> obj.vertices([0,0,0], [1,1,1])

Viewer commands can be called as methods on the viewer object:

>>> lv.rotate('x', 45)

Viewer properties can be set by using it like a dictionary:

>>> lv["background"] = "grey50"

A list of available commands and properties can be found in the wiki: https://github.com/OKaluza/LavaVu/wiki/Scripting-Commands-Reference https://github.com/OKaluza/LavaVu/wiki/Property-Reference

or by using the online help:

>>> lv.help('rotate')
>>> lv.help('opacity')
Figure(name, objects=None, **kwargs)[source]

Create a figure

Parameters:
  • name (str) – Name of the figure
  • objects (list) – List of objects or object names to include in the figure, others will be hidden
Returns:

figure – Figure object

Return type:

Figure

Object(identifier=None, **kwargs)[source]

Get or create a visualisation object

Parameters:
  • identifier (str,int,Object (Optional)) – If a string, lookup an object by name If a number, lookup object by index If an object reference, lookup the Object by reference If omitted, return the last object in the list If no matching object found and string identifier provided, creates an empty object
  • **kwargs – Set of properties passed to the object
Returns:

obj – The object located

Return type:

Object

__call__(cmds)[source]

Run a LavaVu script

Parameters:cmds (str) – String containing commands to run, separate commands with semi-colons”

Example

>>> lv('reset; translate -2')
__init__(arglist=None, database=None, figure=None, timestep=None, port=0, verbose=False, interactive=False, hidden=True, cache=False, quality=2, writeimage=False, resolution=None, script=None, initscript=False, usequeue=False, binpath='/home/docs/checkouts/readthedocs.org/user_builds/underworld2/checkouts/v2.4.1b/glucifer/bin', omegalib=False, *args, **kwargs)[source]

Create and init viewer instance

Parameters:
  • Viewer class docs for setup args) ((see) –
  • binpath (str) – Override the executable path
  • omegalib (boolean) – For use in VR mode, disables some conflicting functionality and parsed into the initial set of global properties
add(name, **kwargs)[source]

Add a visualisation object

Parameters:name (str) – Name to apply to the created object If an object of this name exists, it will be returned instead of created
Returns:obj – The object created
Return type:Object
addstep(step=-1)[source]

Add a new time step

Parameters:step (int (Optional)) – Time step number, default is current + 1
camera()[source]

Get the current camera viewpoint

Displays camera in python code form that can be pasted and executed to restore the same camera view

clear(objects=True, colourmaps=True)[source]

Clears all data from the visualisation Including objects and colourmaps by default

Parameters:
  • objects (boolean) – including all objects, if set to False will clear the objects but not delete them
  • colourmaps (boolean) – including all colourmaps
colourbar(obj=None, **kwargs)[source]

Create a new colourbar

Parameters:obj (Object (optional)) – Vis object the colour bar applies to
Returns:colourbar – The colourbar object created
Return type:Object
colourmap(name, data, reverse=False, monochrome=False, **kwargs)[source]

Load or create a colour map

Parameters:
  • name (str) – Name of the colourmap, if this colourmap name is found the data will replace the existing colourmap, otherwise a new colourmap will be created
  • data (list,str) – Provided colourmap data can be - a string, - list of colour strings, - list of position,value tuples - or a built in colourmap name
  • reverse (boolean) – Reverse the order of the colours after loading
  • monochrome (boolean) – Convert to greyscale
Returns:

colourmap – The name of the colourmap loaded/created

Return type:

int

colourmaps

Returns the list of active colourmaps

Returns:colourmaps – An dictionary containing the list of available colourmaps
Return type:(dict)
commands(cmds)[source]

Execute viewer commands https://github.com/OKaluza/LavaVu/wiki/Scripting-Commands-Reference These commands can also be executed individually by calling them as methods of the viewer object

Parameters:cmds (list, str) – Command(s) to execute
defaultcolourmap(name)[source]

Get content of a default colour map

Parameters:name (str) – Name of the built in colourmap to return
Returns:data – Colourmap data formatted as a string
Return type:str
defaultcolourmaps()[source]

Get the list of default colour map names

Returns:colourmaps – Names of all predefined colour maps
Return type:list of str
display(resolution=(0, 0), transparent=False)[source]

Show the current display as inline image within an ipython notebook.

If IPython is installed, displays the result image content inline

If IPython is not installed, will save the result with a default filename in the current directory

Parameters:
  • resolution (list, tuple) – Image resolution in pixels [x,y]
  • transparent (boolean) – Creates a PNG image with a transparent background
figures

Retrieve the saved figures from loaded model Dict returned contains Fig objects which can be used to modify the figure

Returns:figures – A dictionary of all available figures by name
Return type:dict
file(filename, obj=None, **kwargs)[source]

Load a database or model file

Parameters:
  • filename (str) – Name of the file to load
  • obj (Object) – Vis object to load the file data into, if not provided a default will be created
files(filespec, obj=None, **kwargs)[source]

Load data from a series of files (using wildcards or a list)

Parameters:
  • files (str) – Specification of the files to load
  • obj (Object) – Vis object to load the data into, if not provided a default will be created
frame(resolution=None)[source]

Get an image frame, returns current display as base64 encoded jpeg data url

Parameters:resolution (list, tuple) – Image resolution in pixels [x,y]
Returns:image – encoded image as string data
Return type:str
getcolourmap(mapid, string=True)[source]

Return colour map data as a string or list Either return format can be used to create/modify a colourmap with colourmap()

Parameters:
  • mapid (string/int) – Name or index of the colourmap to retrieve
  • string (boolean) – The default is to return the data as a string of colours separated by semi-colons To instead return a list of (position,[R,G,B,A]) tuples for easier automated processing in python, set this to False
Returns:

mapdata – The formatted colourmap data

Return type:

str/list

getview()[source]

Get current view settings

Returns:view – json string containing saved view settings
Return type:str
help(cmd='', obj=None)[source]

Get help on a command or property

Parameters:cmd (str) – Command to get help with, if ommitted displays general introductory help If cmd is a property or is preceded with ‘@’ will display property help
image(filename='', resolution=None, transparent=False)[source]

Save or get an image of current display

Parameters:
  • filename (str) – Name of the file to save (should be .jpg or .png), if not provided the image will be returned as a base64 encoded data url
  • resolution (list, tuple) – Image resolution in pixels [x,y]
  • transparent (boolean) – Creates a PNG image with a transparent background
Returns:

image – filename of saved image or encoded image as string data

Return type:

str

imageBytes(width=640, height=480, channels=3)[source]

Return raw image data

Parameters:
  • width (int) – Image width in pixels
  • height (int) – Image height in pixels
  • channels (int) – colour channels/depth in bytes (1=luminance, 3=RGB, 4=RGBA)
Returns:

image – Numpy array of the image data requested

Return type:

array

init()[source]

Re-initialise the viewer window

objects

Returns the active objects

Returns:objects – An dictionary wrapper containing the list of available visualisation objects Can be printed, iterated or accessed as a dictionary by object name
Return type:Objects(dict)
redisplay()[source]

Update the display of any interactive viewer

This is required after changing vis properties from python so the changes are reflected in the viewer

render()[source]

Render a new frame, explicit display update

restore(filename='state.json')[source]

Restore visualisation state from a json file (Includes all properties, colourmaps and defined objects but not their geometry data)

Parameters:filename (str) – Name of the file to load
serve()[source]

Run a web server in python (experimental) This uses server.py to launch a simple web server Not threaded like the mongoose server used in C++ to is limited

Currently recommended to use threaded web server by supplying port=#### argument when creating viewer instead

setup(arglist=None, database=None, figure=None, timestep=None, port=0, verbose=False, interactive=False, hidden=True, cache=False, quality=2, writeimage=False, resolution=None, script=None, initscript=False, usequeue=False, **kwargs)[source]

Execute the viewer, initialising with provided arguments and entering event loop if requested

Parameters:__init__ docs (see) –
setview(view)[source]

Set current view settings

Parameters:view (str) – json string containing saved view settings
step

step (int) – Returns current timestep

steps

Retrieve the time step data from loaded model

Returns:timesteps – A list of all available time steps
Return type:list
store(filename='state.json')[source]

Store current visualisation state as a json file (Includes all properties, colourmaps and defined objects but not their geometry data)

Parameters:filename (str) – Name of the file to save
testimage(expfile, outfile, tolerance=0.0001)[source]

Compare two images

Parameters:
  • expfile (str) – Expected result image
  • outfile (str) – Test output image
  • tolerance (float) – Tolerance level of difference before a comparison fails, default 0.0001
Returns:

result – True if test passes, difference <= tolerance False if test fails, difference > tolerance

Return type:

boolean

testimages(imagelist=None, tolerance=0.0001, expectedPath='expected/', outputPath='./', clear=True)[source]

Compare a list of images to expected images for testing

Parameters:
  • imagelist (list) – List of test images to compare with expected results If not provided, will process all jpg and png images in working directory
  • tolerance (float) – Tolerance level of difference before a comparison fails, default 0.0001
  • expectedPath (str) – Where to find the expected result images (should have the same filenames as output images)
  • outputPath (str) – Where to find the output images
  • clear (boolean) – If the test passes the output images will be deleted, set to False to disable deletion
timesteps()[source]

Retrieve the time step data from loaded model

Returns:timesteps – A list of all available time steps
Return type:list
update(filter=None, compress=True)[source]

Write visualisation data back to the database

Parameters:
  • filter (str) – Optional filter to type of geometry to be updated, if omitted all will be written (labels, points, grid, triangles, vectors, tracers, lines, shapes, volume)
  • compress (boolean) – Use zlib compression when writing the geometry data
video(filename='', fps=10, resolution=(0, 0))[source]

Shows the generated video inline within an ipython notebook.

If IPython is installed, displays the result video content inline

If IPython is not installed, will save the result in the current directory

Parameters:
  • filename (str) – Name of the file to save, if not provided a default will be used
  • fps (int) – Frames to output per second of video
  • resolution (list, tuple) – Video resolution in pixels [x,y]
webgl(resolution=(640, 480))[source]

Shows the generated model inline within an ipython notebook.

If IPython is installed, displays the result WebGL content inline

If IPython is not installed, will save the result with a default filename in the current directory

Parameters:resolution (list, tuple) – Display window resolution in pixels [x,y]
window()[source]

Create and display an interactive viewer instance

This shows an active viewer window to the visualisation that can be controlled with the mouse or html widgets

class glucifer.lavavu.Objects(instance)[source]

Bases: dict

The Objects class is used internally to manage and synchronise the drawing object list

class glucifer.lavavu.Fig(instance, name)[source]

Bases: dict

The Fig class wraps a figure