data_exploration Module

This module is made to provide a set of tools and helper classes for data exploration for Web deployment.

class paraview.data_exploration.AnalysisManager(work_dir, title, description, **kwargs)[source]

Bases: object

This class provide mechanism to keep track of a full data analysis and exploration so the generated analysis can be processed and viewed on the web.

add_meta_data(key, value)[source]

Update analysis metadata with additional information.

begin()[source]

Start the analysis time recording.

begin_work(key)[source]

Record the time that a given work is taking. If begin/end_work is called multiple time, a count will be kept but the time will just sum itself.

If 2 begin_work with the same key, the second one will override the first one.

end()[source]

End the analysis time recording and write associated metadata

end_work(key)[source]

Record the time that a given work is taking. If begin/end_work is called multiple time, a count will be kept but the time will just sum itself.

If 2 end_work with the same key, the second one will be ignore as no begin_work will be done before.

get_file_name_generator(key)[source]

Retreive an analysis FileNameGenerator based on the key of a registered analysis.

get_time(key)[source]

Return the number of second for a given task

register_analysis(key, title, description, file_pattern, data_type)[source]

Register a managed analysis.

write()[source]

Write metadata file in the work directory that describe all the analysis that have been performed.

class paraview.data_exploration.CameraHandler(file_name_generator, view)[source]

Bases: object

apply_position()[source]
get_camera_focal_point()[source]
get_camera_keys()[source]
get_camera_position()[source]
get_camera_view_up()[source]
next()[source]
reset()[source]
set_callback(callback)[source]
set_view(view)[source]
class paraview.data_exploration.CompositeImageExporter(file_name_generator, data_list, colorBy_list, luts, camera_handler, view_size, data_list_pipeline, axisVisibility=1, orientationVisibility=1, format='jpg')[source]

Bases: object

Class use to dump an image stack for a given view position so it can be recomposed later on in the web. We assume the RGBZView plugin is loaded.

UpdatePipeline(time=0)[source]

Change camera position and dump images to the disk

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]

‘/path/{camera_handlers}/{filename}’ + ‘/path/info.json’ Where filename = [‘composite.json’, ‘rgb.jpg’]

set_analysis(analysis)[source]
class paraview.data_exploration.ContourExplorer(file_name_generator, data, contourBy, scalarRange=[0.0, 1.0], steps=10)[source]

Bases: object

Class used to explore data. This Explorer won’t dump any images but can be used along with the ThreeSixtyImageStackExporter() like in the following example.

w = simple.Wavelet()

dataRange = [40.0, 270.0] arrayName = (‘POINT_DATA’, ‘RTData’) fileGenerator = FileNameGenerator(‘/tmp/iso’, ‘{time}_{contourBy}_{contourValue}_{theta}_{phi}.jpg’)

cExplorer = ContourExplorer(fileGenerator, w, arrayName, dataRange, 25) proxy = cExplorer.getContour() rep = simple.Show(proxy)

lut = simple.GetLookupTableForArray( “RTData”, 1, RGBPoints=[43.34006881713867, 0.23, 0.299, 0.754, 160.01158714294434, 0.865, 0.865, 0.865, 276.68310546875, 0.706, 0.016, 0.15] ) rep.LookupTable = lut rep.ColorArrayName = arrayName view = simple.Render()

time = 0.0 exp = ThreeSixtyImageStackExporter(fileGenerator, view, [0,0,0], 100, [0,0,1], [30, 45]) for progress in cExplorer:

exp.UpdatePipeline(time) print (progress)
add_attribute(name, value)[source]
getContour()[source]

Return the contour proxy.

static get_data_type()[source]
static list_arguments()[source]
next()[source]
reset()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.DataProber(file_name_generator, data_to_probe, points_series, fields)[source]

Bases: object

UpdatePipeline(time=0)[source]

Write a file (x_{time}_{field}_{serie}.csv => x_134.0_temperature_X_Axis.csv) with the following format:

idx,X_axis 0,3.56 1,3.57 ... 100,5.76

idx,Y_axis 0,5.6 1,7.57 ... 100,10.76

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.FileNameGenerator(working_dir, name_format)[source]

Bases: object

This class provide some methods to help build a unique file name which map to a given simulation state.

add_file_cost()[source]
add_image_width(width)[source]
add_meta_data(key, value)[source]

Add aditional metadata information for the analysis

add_time_cost(ts)[source]
get_cost()[source]
get_directory()[source]
get_filename()[source]

Return the name of the file based on the current active arguments

get_fullpath()[source]

Return the full path of the file based on the current active arguments

get_nth_directory(n)[source]
set_active_arguments(**kwargs)[source]

Overide all active arguments.

update_active_arguments(store_value=True, **kwargs)[source]

Update active arguments and extend arguments range.

update_label_arguments(**kwargs)[source]

Update label arguments, but argument must exist first

write_metadata()[source]

Write the info.json file in the working directory which contains the metadata of the current file usage with the arguments range.

class paraview.data_exploration.FixCameraHandler(file_name_generator, view, focal_point, view_up, camera_position)[source]

Bases: paraview.data_exploration.CameraHandler

apply_position()[source]
class paraview.data_exploration.ImageResampler(file_name_generator, data_to_probe, sampling_dimesions, array_colors, nanColor=[0, 0, 0, 0], custom_probing_bounds=None)[source]

Bases: object

Class used to explore data. This Explorer will resample the original dataset and produce a stack of images that correspond to XY slice along with numerical data so 2D chart can be use to plot along a line on X, Y or Z.

data_to_probe = simple.Wavelet()

fileGenerator = FileNameGenerator(‘/tmp/probe-slice’, ‘{time}/{field}/{slice}.{format}’) array_colors = {

“RTData”: simple.GetLookupTableForArray( “RTData”, 1, RGBPoints=[43.34006881713867, 0.23, 0.299, 0.754, 160.01158714294434, 0.865, 0.865, 0.865, 276.68310546875, 0.706, 0.016, 0.15] ),

}

exp = ImageResampler(fileGenerator, data_to_probe, [21,21,21], array_colors) exp.UpdatePipeline()

UpdatePipeline(time=0)[source]

Probe dataset and dump images + json files to the disk

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.LineProber(file_name_generator, data_to_probe, points_series, number_of_points)[source]

Bases: object

UpdatePipeline(time=0)[source]

Write a file (x_{time}_{serie}.csv => x_134.0_X_Axis.csv) with the following format:

idx,fieldA,fieldB,fieldC,fieldD,point0, point1, point2 0,3.56,234,2565,5678,678,0,0,0 1,3.57,234,2565,5678,678,1,2,4 ... 100,5.76,234,2565,5678,678,5,7,8

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.SliceExplorer(file_name_generator, view, data, colorByArray, steps=10, normal=[0.0, 0.0, 1.0], viewup=[0.0, 1.0, 0.0], bound_range=[0.0, 1.0], parallelScaleRatio=1.5)[source]

Bases: object

Class use to dump image stack of a data exploration. This data exploration is slicing the input data along an axis and save each slice as a new image keeping the view normal using parallel projection to disable the projection scaling.

UpdatePipeline(time=0)[source]

Probe dataset and dump images to the disk

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.ThreeSixtyCameraHandler(file_name_generator, view, phis, thetas, center, axis, distance)[source]

Bases: paraview.data_exploration.CameraHandler

apply_position()[source]
get_camera_keys()[source]
class paraview.data_exploration.ThreeSixtyImageStackExporter(file_name_generator, view_proxy, focal_point=[0.0, 0.0, 0.0], distance=100.0, rotation_axis=[0, 0, 1], angular_steps=[10, 15])[source]

Bases: object

Class use to dump image stack of geometry exploration. This exporter will use the provided view to create a 360 view of the visible data.

UpdatePipeline(time=0)[source]

Change camera position and dump images to the disk

add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.TimeSerieDataProber(file_name_generator, data_to_probe, point_series, fields, time_to_write)[source]

Bases: object

UpdatePipeline(time=0)[source]

Write a file (x_{field}.csv => x_temperature.csv + x_salinity.csv) with the following format:

time, Origin, Center, Random 0.0, 3.56, 6.67, 2.4765 0.5, 3.57, 6.65, 2.4755 ... 100.5, 5.76, 10.45, 5.567

WriteToDisk()[source]
add_attribute(name, value)[source]
static get_data_type()[source]
static list_arguments()[source]
set_analysis(analysis)[source]
class paraview.data_exploration.WobbleCameraHandler(file_name_generator, view, focal_point, view_up, camera_position, wobble_angle=5.0)[source]

Bases: paraview.data_exploration.CameraHandler

apply_position()[source]
get_camera_keys()[source]
paraview.data_exploration.test(basePath)[source]
paraview.data_exploration.test2(basePath)[source]
paraview.data_exploration.test3(basePath)[source]
paraview.data_exploration.testDynamicLighting()[source]