[Paraview] Plot over line CSV export python script not working
Luca Giannelli
bilogo at gmail.com
Thu Sep 29 21:50:10 EDT 2011
Andy,
thank you for your quick reply.
I am using Paraview 3.8.0 which is the latest binary in the Ubuntu repos. I
chose to install that without compiling from source as I was rushing (I
know, it sounds weird... but). Do you believe that the problem is
build-related?
However, reading the errors that you get I don't see anything that I can
visualize in my output which is as follows (Python shell)
Traceback (most recent call last):
File "/usr/lib/paraview/site-packages/paraview/servermanager.py", line 2922,
in _proxyDefinitionsUpdated
if vtkSMObject.GetProxyManager().GetProxyDefinitionsUpdated():
AttributeError: GetProxyDefinitionsUpdated
Traceback (most recent call last):
File "/usr/lib/paraview/site-packages/paraview/servermanager.py", line 2922,
in _proxyDefinitionsUpdated
if vtkSMObject.GetProxyManager().GetProxyDefinitionsUpdated():
AttributeError: GetProxyDefinitionsUpdated
Traceback (most recent call last):
File "/usr/lib/paraview/site-packages/paraview/servermanager.py", line 2922,
in _proxyDefinitionsUpdated
if vtkSMObject.GetProxyManager().GetProxyDefinitionsUpdated():
AttributeError: GetProxyDefinitionsUpdated
Traceback (most recent call last):
File "/usr/lib/paraview/site-packages/paraview/servermanager.py", line 2922,
in _proxyDefinitionsUpdated
if vtkSMObject.GetProxyManager().GetProxyDefinitionsUpdated():
AttributeError: GetProxyDefinitionsUpdated
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/usr/lib/paraview/site-packages/paraview/servermanager.py", line 201,
in __setattr__
"to add this attribute.")
AttributeError: Attribute XArrayName does not exist. This class does not
allow addition of new attributes to avoid mistakes due to typos. Use
add_attribute() if you really want to add this attribute.
It looks like a complain about the server, not about my script though.... in
fact, if comment out the writer part, leaving only the "trace" recorded set
of operations, it spits out the very same error. Moreover, the Paraview
output doesn't show any output at all (except for the usual a complain about
the qt4 that is not related).
Do you see any evident problem in the script syntax in the writer section?
For example references to the wrong source, etc?
Or do you believe that it is a problem related to the Paraview/Python
installation (or whatever..).
Another point.... does the "PlotOverLine2" influence the results? I recorded
the trace making a second POL that automatically got labeled as #2... if I
run it at startup it executes perfectly fine so I don't think that the
problem is here too.
I'm sorry for my pretty low level in Python as I am an absolute beginner
Thanks again
Luca
2011/9/29 Andy Bauer <andy.bauer at kitware.com>
> If you're running the python script in the paraview gui sometimes the
> messages are printed out to the python shell. What version of paraview are
> you using?
>
> I'm running paraview from the head of the repo. The output I get from the
> OutputMessages window is:
> ================
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> ERROR: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDemandDrivenPipeline.cxx,
> line 727
>
> vtkPVCompositeDataPipeline (0x493bbd0): Input port 1 of algorithm
> vtkPProbeFilter(0x493dab0) has 0 connections but is not optional.
>
> Warning: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDataObject.cxx, line
> 920
>
> vtkMultiBlockDataSet (0x4da0e00): Attempted to ShallowCopy from null.
>
> Warning: In
> /home/acbauer/CODE/ParaView/ParaView/VTK/Filtering/vtkDataObject.cxx, line
> 920
>
> vtkMultiBlockDataSet (0x4da3af0): Attempted to ShallowCopy from null.
>
> ================
>
> The output I get from the python shell is:
> ===============
>
> Traceback (most recent call last):
>
> File "<string>", line 17, in <module>
>
> File
> "/media/ssddrive/BUILDS/ParaView/release-parallel/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 209, in __setattr__
>
> "to add this attribute.")
>
> AttributeError: Attribute XArrayName does not exist. This class does not
> allow addition of new attributes to avoid mistakes due to typos. Use
> add_attribute() if you really want to add this attribute.
>
> ======================
>
> On Thu, Sep 29, 2011 at 5:57 AM, Luca Giannelli <bilogo at gmail.com> wrote:
>
>> Hello everybody,
>>
>> I've been using Paraview for quite a long time but I didn't need the
>> python scripting up to now.
>> I want to execute a series of plot over line in numerous points and
>> different time steps so it is nothing
>> I can afford to do manually.
>> Looking on the net I was able to find out how to record a macro and how to
>> create a writer so I
>> ended up with this script:
>>
>> --------------------------------------------------------------------
>> try: paraview.simple
>> except: from paraview.simple import *
>> paraview.simple._DisableFirstRenderCameraReset()
>>
>> fotobioreattore_foam = GetActiveSource()
>> PlotOverLine2 = PlotOverLine( Source="High Resolution Line Source" )
>>
>> PlotOverLine2.Source.Point1 = [-0.035100001841783524,
>> -0.03509980067610741, 0.0]
>> PlotOverLine2.Source.Point2 = [0.035100001841783524, 0.035100001841783524,
>> 0.4300000071525574]
>>
>> DataRepresentation7 = Show()
>>
>> PlotOverLine2.Source.Point1 = [-0.0, 0.0, 0.0]
>> PlotOverLine2.Source.Point2 = [0.0, 0.0, 0.4300000071525574]
>>
>> XYChartView4 = GetRenderView()
>> DataRepresentation7.XArrayName = 'arc_length'
>> DataRepresentation7.SeriesVisibility = ['U (0)', '0', 'U (1)', '0', 'U
>> (2)', '0', 'vtkValidPointMask', '0', 'arc_length', '0', 'Points (0)', '0',
>> 'Points (1)', '0', 'Points (2)', '0', 'Points (Magnitude)', '0']
>> DataRepresentation7.UseIndexForXAxis = 0
>>
>> Render()
>>
>> #= create writer
>> source = PlotOverLine2 #PlotOverLine2.Source
>> writer = CreateWriter("/home/piota/csv.csv", source)
>> #writer = CreateWriter("/home/piota/csv.csv")
>> writer.FieldAssociation = "Points" # or "Cells"
>> writer.UpdatePipeline()
>> del writer
>> --------------------------------------------------------------------------
>>
>> If I'm not mistaken, this should write a csv.csv file in my home folder
>> but it doesn't write anything. No error is reported when I run the script
>> but still I get no output.
>> I'm still a bit confused on which source I should specify, so I'm pretty
>> sure that the writer part is incorrect.
>>
>> Can somebody help me filling it out properly?
>>
>> Thx in advance.
>>
>> Luca
>>
>> _______________________________________________
>> 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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110930/81458522/attachment-0001.htm>
More information about the ParaView
mailing list