cinema_python.adaptors¶
cinema_python.adaptors.explorers module¶
module for generating cinema databases from arbitrary codes. Essentially this provides a way to runs over all possible combinations of values in database and call out to arbitrary codes so that they have a chance to make corresponding changes before inserting the result into the database.
-
class
cinema_python.adaptors.explorers.Explorer(store, parameters, tracks)[source]¶ Bases:
objectMiddleman that connects an arbitrary producing codes to the CinemaStore. The purpose of this class is to run through the parameter sets, and tell a set of tracks (in order) to do something with the parameter values it cares about.
-
explore(fixedargs=None, progressObject=None)[source]¶ Explore the problem space to populate the store being careful not to hit combinations where dependencies are not satisfied. Fixed arguments are the parameters that we want to hold constant in the exploration.
-
list_parameters()[source]¶ parameters is an ordered list of parameters that the Explorer varies over
-
store¶
-
-
class
cinema_python.adaptors.explorers.Layer(layer, objectlist)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a layer to the set of objects in the scene that it controls.
-
class
cinema_python.adaptors.explorers.LayerControl(name, showFunc, hideFunc)[source]¶ Bases:
objectPrototype for something that Layer track can control
cinema_python.adaptors.vtk¶
cinema_python.adaptors.vtk.vtk_explorers module¶
Module consisting of explorers and tracks that connect arbitrary VTK pipelines to cinema stores.
-
class
cinema_python.adaptors.vtk.vtk_explorers.ActorInLayer(parameter, actor)[source]¶ Bases:
cinema_python.adaptors.explorers.LayerControlA track that turns on and off an actor in a layer
-
class
cinema_python.adaptors.vtk.vtk_explorers.Camera(center, axis, distance, camera)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a VTK script’s camera to the phi and theta tracks. This allows the creation of spherical camera stores where the user can view the data from many points around it.
-
class
cinema_python.adaptors.vtk.vtk_explorers.Clip(argument, clip)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects clip filters to a scalar valued parameter.
-
class
cinema_python.adaptors.vtk.vtk_explorers.ColorActors(parameter, colorlist, actors)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a parameter to a choice of surface rendered color maps.
-
class
cinema_python.adaptors.vtk.vtk_explorers.ColorList[source]¶ A helper that creates a dictionary of color controls for VTK. The Color track takes in a color name from the Explorer and looks up into a ColorList to determine exactly what needs to be set to apply the color.
-
class
cinema_python.adaptors.vtk.vtk_explorers.Contour(argument, filter, method)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects clip filters to a scalar valued parameter.
-
class
cinema_python.adaptors.vtk.vtk_explorers.ImageExplorer(store, parameters, engines, rw)[source]¶ Bases:
cinema_python.adaptors.explorers.ExplorerAn explorer that connects a VTK program’s render window to a store and makes it save new images into the store.
cinema_python.adaptors.paraview¶
cinema_python.adaptors.paraview.pv_explorers module¶
Module consisting of explorers and tracks that connect arbitrary paraview pipelines to cinema stores.
-
class
cinema_python.adaptors.paraview.pv_explorers.Camera(center, axis, distance, view)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a ParaView script’s camera to the phi and theta tracks. This allows the creation of spherical camera stores where the user can view the data from many points around it.
-
class
cinema_python.adaptors.paraview.pv_explorers.Clip(argument, clip)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a clip filter to a scalar valued parameter.
-
class
cinema_python.adaptors.paraview.pv_explorers.Color(parameter, colorlist, rep)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a parameter to color controls.
-
class
cinema_python.adaptors.paraview.pv_explorers.ColorList[source]¶ A helper that creates a dictionary of color controls for ParaView. The Color track takes in a color name from the Explorer and looks up into a ColorList to determine exactly what needs to be set to apply the color.
-
class
cinema_python.adaptors.paraview.pv_explorers.Contour(parameter, filt)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a contour filter to a scalar valued parameter.
-
class
cinema_python.adaptors.paraview.pv_explorers.ImageExplorer(store, parameters, tracks, view=None, iSave=True)[source]¶ Bases:
cinema_python.adaptors.explorers.ExplorerAn Explorer that connects a ParaView script’s views to a store. Basically it iterates over the parameters and for each unique combination it tells ParaView to make an image and saved the result into the store.
-
insert(document)[source]¶ overridden to use paraview to generate an image and create a the document for it
-
-
class
cinema_python.adaptors.paraview.pv_explorers.PoseCamera(view, camType, store)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a ParaView script’s pose track which has 3x3 camera orientations in it. Also takes in camera_eye, _at and _up arrays, which designate the initial position at each timestep, from which the camera moves according to each pose.
-
class
cinema_python.adaptors.paraview.pv_explorers.Slice(parameter, filt)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects a slice filter to a scalar valued parameter.
-
class
cinema_python.adaptors.paraview.pv_explorers.SourceProxyInLayer(parameter, representation, proxy)[source]¶ Bases:
cinema_python.adaptors.explorers.LayerControlA track that turns on and off an source proxy in a layer
-
class
cinema_python.adaptors.paraview.pv_explorers.Templated(parameter, filt, methodName)[source]¶ Bases:
cinema_python.adaptors.explorers.TrackA track that connects any type of filter to a scalar valued parameter. To use pass in a source proxy (aka filter) and the name of method (aka property) to be called on it.
cinema_python.adaptors.paraview.pv_introspect module¶
Module that looks at a ParaView pipeline and automatically creates a cinema store that ranges over all of the variables that we know how to control and later show.
-
cinema_python.adaptors.paraview.pv_introspect.add_control_and_colors(name, cs, userDefined, arrayRanges, disableValues)[source]¶ add parameters that change the settings and color of a filter
-
cinema_python.adaptors.paraview.pv_introspect.add_customized_array_selection(sourceName, source, fields, userDefined, arrayRanges, disableValues)[source]¶
-
cinema_python.adaptors.paraview.pv_introspect.add_filter_value(name, cs, userDefinedValues)[source]¶ creates controls for the filters that we know how to manipulate
-
cinema_python.adaptors.paraview.pv_introspect.explore(cs, proxies, iSave=True, currentTime=None, userDefined={}, specLevel='A', camType='phi-theta', tracking={}, floatValues=True, arrayRanges={}, disableValues=False, progressObject=None)[source]¶ Runs a pipeline through all the changes we know how to make and saves off images into the store for each one.
-
cinema_python.adaptors.paraview.pv_introspect.explore_customized_array_selection(sourceName, source, colorList, userDefined, disableValues)[source]¶
-
cinema_python.adaptors.paraview.pv_introspect.export_scene(baseDirName, viewSelection, trackSelection, arraySelection)[source]¶ This explores a set of user-defined views and tracks. export_scene is called from vtkCinemaExport. The expected order of parameters is as follows:
- viewSelection (following the format defined in Wrapping/Python/paraview/cpstate.py):
Directory of the form {‘ViewName’ : [parameters], ...}, with parameters defined in the order: Image filename, freq, fittoscreen, magnification, width, height, cinema).
- trackSelection:
Directory of the form {‘FilterName’ : [v1, v2, v3], ...}
- arraySelection:
- Directory of the form {‘FilterName’ : [‘arrayName1’, ‘arrayName2’, ...],
- ... }
Note: baseDirName is used as the parent directory of the database generated for each view in viewSelection. ‘Image filename’ is used as the database directory name.
-
cinema_python.adaptors.paraview.pv_introspect.extend_range(arrayRanges, name, minmax)[source]¶ This updates the data ranges in the data base meta file. Throughout a time varying data export ranges will vary. Here we accumulate them as we go so that by the end we get the min and max values over for each array component over all time.
This version happens in catalyst, where we recreate the database file every timestep.
-
cinema_python.adaptors.paraview.pv_introspect.filter_has_parameters(name)[source]¶ see if this proxy is one we know how to make controls for
-
cinema_python.adaptors.paraview.pv_introspect.float_limiter(x)[source]¶ a shame, but needed to make sure python, javascript and (directory/file)name agree. TODO: This can go away now that we use name=index instead of name=value filenames.
-
cinema_python.adaptors.paraview.pv_introspect.inspect(skip_invisible=True)[source]¶ Produces a representation of the pipeline that is easier to work with. Thanks Scott Wittenburg and the pv mailing list for this gem
-
cinema_python.adaptors.paraview.pv_introspect.make_cinema_store(proxies, ocsfname, view, forcetime=False, userDefined={}, specLevel='A', camType='phi-theta', arrayRanges={}, extension='.png', disableValues=False)[source]¶ Takes in the pipeline, structured as a tree, and makes a cinema store definition containing all the parameters we will vary.
-
cinema_python.adaptors.paraview.pv_introspect.make_workspace_file(basedirname, cinema_dirs)[source]¶ This writes out the top level json file that says that there are child cinema stores inside. The viewer sees this and opens up in the children in separate panels.
-
cinema_python.adaptors.paraview.pv_introspect.max_bounds()[source]¶ returns conservative min and max (over x y and z) bounds
-
cinema_python.adaptors.paraview.pv_introspect.optimize_traversal_order(params)[source]¶ An optimization that reduces generation time by better amortizing setup costs. With this rendering state changes (cheap) are late and in particular camera (~free) is the innermost loop.
It also makes generation easier to watch. With camera innermost it iunderstand and prevents rapidly cycling between bright colors.
-
cinema_python.adaptors.paraview.pv_introspect.prepare_selection(trackSelection, arraySelection)[source]¶ The rest of pv_introspect expects to receive user-defined values in the structure:
- {proxy_reference: {‘ControlName’: [value_1, value_2, ..., value_n],
- ‘arraySelection’: [‘ArrayName_1’, ..., ‘ArrayName_n’]}}
This structure is necessary for catalyst to correctly reference the created proxies. Although this is not necessary in the menu->export case (proxies could be accessed by name directly), we comply for compatibility.
-
cinema_python.adaptors.paraview.pv_introspect.project_to_at(eye, fp, cr)[source]¶ project center of rotation onto focal point to keep gaze direction the same while allowing both translate and zoom in and out to work
-
cinema_python.adaptors.paraview.pv_introspect.range_epsilon(minmax)[source]¶ ensure that min and max have some separation to assist rendering
-
cinema_python.adaptors.paraview.pv_introspect.record_visibility()[source]¶ at start of run, record the current paraview state so we can return to it
-
cinema_python.adaptors.paraview.pv_introspect.restore_visibility(proxies)[source]¶ at end of run, return to a previously recorded paraview state
-
cinema_python.adaptors.paraview.pv_introspect.track_source(proxy, eye, at, up)[source]¶ an animation mode that follows a specific object input camera position is in eye, at, up returns same, moved to follow the input proxy
-
cinema_python.adaptors.paraview.pv_introspect.update_all_ranges(cs, arrayRanges)[source]¶ This updates the data ranges in the data base meta file. Throughout a time varying data export ranges will vary. Here we accumulate them as we go so that by the end we get the min and max values over for each array component over all time.
This version happens in paraview export for time varying data where we recreate the database file once, and afterward only output new rasters.
cinema_python.adaptors.paraview.cinemareader module¶
cinemareader is used by vtkCinemaDatabaseReader.
-
class
cinema_python.adaptors.paraview.cinemareader.FileStoreAPI(fs, qt)[source]¶ Bases:
object-
get_control_values(controlparametername)[source]¶ returns sorted list of available values for a control parameter
-
-
class
cinema_python.adaptors.paraview.cinemareader.FileStoreSpecA(fs)[source]¶ Bases:
cinema_python.adaptors.paraview.cinemareader.FileStoreAPI
-
class
cinema_python.adaptors.paraview.cinemareader.FileStoreSpecB(fs)[source]¶ Bases:
cinema_python.adaptors.paraview.cinemareader.FileStoreAPI-
get_all_parents()[source]¶ builds a map with key is object name, and value is a list of objectname for its parents.
-