[Paraview] Saving data plotted using PlotOverLine
Stephen Molloy
stephen.molloy at rhul.ac.uk
Mon Mar 8 16:47:41 EST 2010
Thanks for the tip. That writes a CSV file, but it's much shorter than
the one written by "Save Data".
The following is my python file. Perhaps someone could comment on how
it should be altered so as to correctly save the entire PlotOverLine
dataset? (One thing I notice is that the settings controling the number
of points in the line don't seem to appear in the trace either --
perhaps this is the cause of my troubles?)
Steve
try: paraview.simple
except: from paraview.simple import *
BETA1_gen_ncdf = SLACDataReader(
MeshFileName='/home/smolloy/scratch/cryomodule/cavs-4/BETA1.gen.ncdf' )
BETA1_gen_ncdf.ReadMidpoints = 1
BETA1_gen_ncdf.ModeFileName =
['/home/smolloy/scratch/cryomodule/cavs-4/modes.l0.7.042935E+08.m17']
BETA1_gen_ncdf.ReadInternalVolume = 1
PlotOverLine1 = PlotOverLine( Source=[] )
XYPlotView1 = CreateRenderView()
DataRepresentation3 = Show()
DataRepresentation3.add_attribute('XArrayName','arc_length')
DataRepresentation3.add_attribute('SeriesVisibility',['efield (0)', '0',
'efield (1)', '0', 'efield (2)', '0', 'bfield (0)', '0', 'bfield (1)',
'0', 'bfield (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0',
'Points (0)', '0', 'Points (1)', '0', 'Points (2)', '0', 'Points
(Magnitude)', '0', '', '1', 'htmag', '0', 'bfield (Magnitude)', '0',
'efield (Magnitude)', '1'])
DataRepresentation3.add_attribute('UseIndexForXAxis',0)
w = DataSetCSVWriter(Filename = "foo.csv")
w.UpdatePipeline()
Utkarsh Ayachit wrote:
> You can use the following:
>
> w = DataSetCSVWriter(FileName="foo.csv")
> w.UpdatePipeline()
>
>
> On Mon, Mar 8, 2010 at 5:50 AM, Stephen Molloy
> <stephen.molloy at rhul.ac.uk> wrote:
>
>> Hi all,
>> I am using Paraview 3.7.0 to view a large number of data files, each with
>> the same geometry. I need to load the geometry and volume data, use
>> PlotOverLine to extract the magnitude of a variable along a particular line,
>> and then save this data to a CSV file.
>>
>> Due to the large number of data sets I am dealing with, I have been trying
>> to use the Python Trace functionality to automate this, and I am able to do
>> everything except for saving the CSV file at the end. I have browsed around
>> quite a bit over the past few days, and I understand that the trace
>> functionality does not work for save data commands, but I was wondering if
>> someone could help me find the Python object that contains the relevant data
>> so that I can write my own little routine to dump it to a CSV file.
>>
>> Many thanks for any help you can offer.
>>
>> Steve
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
More information about the ParaView
mailing list