[Paraview] Saving a slice of data for later visualization
Tim Gallagher
tim.gallagher at gatech.edu
Tue Oct 27 15:33:40 EDT 2015
Thanks guys,
As always, it was a nice combination of user error and unexpected behavior. My slice origin was [1.0, 1.0, 0.0] and when I used the CSV writer, it happily wrote out data files for me so I assumed everything worked fine. But when I used any other writer, the slice didn't actually exist (that's why there was the error about no output port). When I moved my slice to [1.0, 1.0, 0.1] then I could get other writers to work. I went with the XdmfWriter just because we're used to dealing with Xdmf files anyway.
SaveData() also works (once my slice is in the right place) on later versions, but doesn't exist in 4.1. I should upgrade, but it's such a pain to build on clusters that I like to avoid it as long as possible!
Thanks again,
Tim
----- Original Message -----
From: "Ganesh Vijayakumar" <ganesh.iitm at gmail.com>
Cc: "ParaView list" <paraview at paraview.org>
Sent: Tuesday, October 27, 2015 3:11:54 PM
Subject: Re: [Paraview] Saving a slice of data for later visualization
I use this. Has worked for me fairly well.
SaveData('fileName.vtm', proxy=Clip1, Writealltimestepsasfileseries=0, DataMode='Binary', HeaderType='UInt64', EncodeAppendedData=0, CompressorType='None')
On Tue, Oct 27, 2015 at 7:55 AM Andy Bauer < andy.bauer at kitware.com > wrote:
Hi Tim,
I believe that the writer you want is the XML multiblock data writer -- XMLMultiBlockDataWriter(). The extension for that is .vtm. The reason for this is that a slice through a multiblock data set outputs a multiblock of polydata. You can use the Merge Blocks filter to reduce it to an unstructured grid.
Cheers,
Andy
On Mon, Oct 26, 2015 at 8:21 PM, Tim Gallagher < tim.gallagher at gatech.edu > wrote:
<blockquote>
Hi,
I'm struggling to write a script for Paraview that will let me take a slice through my vtkMultiblockDataSet and save just the slice (so all of the data on the slice and all of the points that make up the slice) in a format that I can look at later. I can get it to dump all of the data to a set of CSV files, but I can't look at those again in paraview.
My function is very simple (see below). I have tried to use CreateWriter directly with the .vtk file extension like is shown on http://www.paraview.org/Wiki/ParaView/Python_Scripting#Writing_Data_Files_.28ParaView_3.9_or_later.29 but that says the vtk file format is unknown and so it doesn't work.
I have tried virtually every writer that would make sense in that writer line and none of them work properly. As it is, the one that is there now says:
vtkCompositeDataPipeline (0x9ac9380): Can not execute simple alorithm without output ports
and I don't know what that means or why it fails to write. (Side note -- algorithm is spelled wrong in that error message, comes from vtkCompositeDataPipeline.cxx line 168).
Anybody have any suggestions or advice on how to save the datasets that results from a slice so I can look at just that slice later?
Thanks,
Tim
def run(out_dir, file_num, spreadsheet_name, slice_origin, slice_normal, triangulate=False):
restart_file = XDMFReader(FileName=out_dir+'/RESTS/rest_%05i.xmf' % file_num)
restart_file_dr = Show()
if triangulate:
tri = 1
else:
tri = 0
my_slice = Slice(SliceOffsetValues=[0.0], Triangulatetheslice=tri, SliceType="Plane" )
my_slice.SliceType.Origin = slice_origin
my_slice.SliceType.Normal = slice_normal
slice_dr = Show()
writer = XMLUnstructuredGridWriter(Input=my_slice)
writer.FileName = out_dir+"/post/"+"%s_data_%05i_.vtu" % (spreadsheet_name, file_num)
writer.UpdatePipeline()
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview
</blockquote>
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151027/d5502680/attachment.html>
More information about the ParaView
mailing list