2

I am using Paraview to display well log information stored in csv files.

Upon loading the csv data file and adding the "Table to Points" filter, I manually specify which columns should be used for the X Column, Y Column and Z Column (e.g. I am using a column called "Easting" for the "X Column").

Is there a way to automate this step? Maybe some kind of configuration file that could be fed into Paraview to indicate the column mapping?

Sheldon
  • 4,084
  • 3
  • 20
  • 41

1 Answers1

3

You can use python macro to do that. Macros in ParaView are python script you can trigger from the toolbar.

You can use this one to create and configure a TableToPoints filter (with modif according to your column names):

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'Table To Points'
tableToPoints1 = TableToPoints(registrationName='TableToPoints1')

# configure column names
tableToPoints1.XColumn = 'y1'
tableToPoints1.YColumn = 'y2'
tableToPoints1.ZColumn = 'y26'

# get active view
spreadSheetView1 = GetActiveViewOrCreate('SpreadSheetView')

# show data in view
tableToPoints1Display = Show(tableToPoints1, spreadSheetView1, 'SpreadSheetRepresentation')

# hide data in view
Hide(sineWavescsv, spreadSheetView1)

# update the view to ensure updated data information
spreadSheetView1.Update()

Store it on your disk and go to menu Macros / Import new macro

Note that you can easily create your own with the Python Trace:

  1. menu Tools / Start Trace (with default options)
  2. perform the actions you want to replay later (load file, create filters, edit color map, ...)
  3. Tools / Stop Trace. It opens an editor with python code, you can save it as a macro.
  4. The macro is a new button in the toolbar.
Nico Vuaille
  • 2,310
  • 1
  • 6
  • 14