[Paraview] Find Data in Python
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Apr 19 10:45:09 EDT 2010
Does your data have time? If not, you don't need to specify the
time=10000 attribute at all. So SelectionWriter is the thing that's
coming from your plugin? Does it support writing empty datasets? Can
you attach a debugger and see where is crashes? Are you sure it's not
crashing in the writer? I dont' see why UpdatePipeline() on extract
selection would crash. Instead of using a macro, try manually typing
the text in the python shell to see exactly what line causes the
segfault.
BTW, ExtractSelection needs two inputs: 'Input" and "Selection" where
Selection is set to the SelectionQuerySource proxy.
Utkarsh
On Mon, Apr 19, 2010 at 10:34 AM, Christian Werner
<christian.werner at rwth-aachen.de> wrote:
> I am afraid UpdatePipeline doesn't help, even if I set the time to some high
> value. Paraview crashes right in the moment where I start this macro:
>
> extract=ExtractSelection(Input=ConnectivityFilter)
>
> UpdatePipeline(time= 10000, proxy=extract)
>
> mFilename = destPath + str( time() )
>
> swriter=SelectionWriter(Input=extract)
>
> swriter.FileName=mFilename
>
> swriter.UpdatePipeline()
>
>
> When I manually select Fiters->ExtractSelection and then do:
>
> mFilename = destPath + str( time() )
>
> swriter=SelectionWriter()
>
> swriter.FileName=mFilename
>
> swriter.UpdatePipeline()
>
>
> everything works fine.
>
>
>
> Utkarsh Ayachit schrieb:
>>
>> You can simply call UpdatePipeline() as follows:
>>
>> from paraview.simple import *
>> ....
>> UpdatePipeline(proxy=extractSelectionSource)
>>
>> This will update the extract selection filter explicitly. Look at
>> help(UpdatePipeline) for details.
>>
>> Utkarsh
>>
>>
>> On Sun, Apr 18, 2010 at 3:38 PM, Christian Werner
>> <christian.werner at rwth-aachen.de> wrote:
>>
>>>
>>> Hi Utkarsh,
>>>
>>> these are great news. I tried the python trace but not in combination
>>> with
>>> the extraction (what I acutally do need anyway....)
>>>
>>> As you might remember I am working around the "lack" of possibilty to
>>> select
>>> whole objects (cells with same RegionID). With the given
>>> SelectionQuerySource this workaround is complete.
>>>
>>> There remains one issue: At some point I call an ExtractSelection() in
>>> Python that is followed by a call to a vtk-Plugin (which writes the point
>>> data of the selected points to disk). The resulting file is empty,
>>> because
>>> the Extraction takes a few seconds and obviously the plugin has no valid
>>> input when being executed. Paraview also crashes as a consequence. When I
>>> am
>>> doing this manually (trigger ExtractSelection, wait until it's done, call
>>> the vtk Plugin to write the point data) everything works fine. I could
>>> just
>>> go ahead and do a dull time.sleep(3) between the extraction and the call
>>> to
>>> the plugin, but this certainly isn't good programming style.
>>>
>>> What can I do instead?
>>>
>>>
>>> Best regards,
>>> Christian
>>>
>>>
>>> Utkarsh Ayachit wrote:
>>>
>>>>
>>>> Yes, you can use the "SelectionQuerySource" to construct your query as
>>>> follows:
>>>>
>>>> selection_source_540 = SelectionQuerySource( InsideOut=0,
>>>> ArrayName='', HierarchicalLevel=-1, ProcessID=-1, ContainingCells=0,
>>>> DoubleValues=None, HierarchicalIndex=-1, FieldType='CELL',
>>>> ArrayComponent=0, Operator='IS_ONE_OF', TermMode='ID',
>>>> CompositeIndex=-1, IdTypeValues=0 )
>>>>
>>>> You can use the python trace recorder functionality to determine how
>>>> to create the query. You will, however have to "Extract Selection"
>>>> from the query (and hit apply) before the selection_source object will
>>>> appear in the trace.
>>>>
>>>> Utkarsh
>>>>
>>>>
>>>> On Sat, Apr 17, 2010 at 9:32 AM, Christian Werner
>>>> <christian.werner at rwth-aachen.de> wrote:
>>>>
>>>>
>>>>>
>>>>> Hello!
>>>>>
>>>>> Is there any chance that the new Edit->Find Data functionality is
>>>>> available
>>>>> in Python-Scripting?
>>>>>
>>>>>
>>>>> Best regards,
>>>>> Christian
>>>>> _______________________________________________
>>>>> 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