<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I would stick to the CSV file if you’ve got all the information you need inside it<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">… but instead of using a table to points filter, create your own custom filter which takes the CSV table as input, and outputs just a small polydata object
which has the current positions (+scalars) encoded for the given time.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">All you need to do is create a RequestData function which looks at UPDATE_TIME, and fetches the corresponding rows/columns for each planet/point for that time
and adds them to the output.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For added fun, you can export a multi-block dataset, and/or have a treeview which allows you to enable/disable certain planets/points. This way you can<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Reader -> ExtractPlanetFilter1 ->Render (use textureA)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> ExtractPlanetFilter2->Render (use tectureB)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[Or other combinations with ExtractBlockFilter if you use multiblock ].<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The Reader would simply subclass polydataalgorithm, but take a vtkTable as input. Couple of hours work is all you’d need and you can leave the data in its current
form.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">$0.02<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">JB<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> paraview-bounces@paraview.org [mailto:paraview-bounces@paraview.org]
<b>On Behalf Of </b>John.CTR.Mick@faa.gov<br>
<b>Sent:</b> 22 March 2012 17:13<br>
<b>To:</b> paraview@paraview.org<br>
<b>Subject:</b> [Paraview] Assistance/Suggestion With Animating Relatively Small Datasets Over Many Timesteps<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""> This is my first experience posting to the ParaView Mailing List; as well as my first project I am exploring with ParaView. I hope I am posting this question to the correct audience.</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""> I am attempting to create an animation of our Solar System - at an extremely high update interval - perhaps plotting the position and velocity of significant solar system bodies over 165 Earth
years at</span> <br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">a one day interval. Initially I thought I would be able to work with CSV files to define a dataset which includes time, positional coordinates, and velocity vectors. While testing this approach
I managed to use the TableToPoints filter to create a visualization of a sample dataset; but I was not able to sequence over the individual timesteps. So in effect you see all the positions a particular planet was at for the entire duration of the dataset.</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I created a video of this test and made it available online:</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><a href="http://www.youtube.com/watch?v=XLPxx-2Zc9Q">http://www.youtube.com/watch?v=XLPxx-2Zc9Q</a>
<br>
<br>
Next I thought perhaps the CSV format was a little too general for what I needed, so I read the VTK file format document and migrated over to the XML VTK format. It seems like there is no way to define time sequenced data natively within the file format
itself? ParaView expects the user to break the timesteps into individual files - with a numeric indicator in the filename to define the sequence. If I were to take this approach, I could be looking at creating nearly 500,000 individual files to represent
the entire duration of time I'm interested in plotting. I feel like there must be a better way to do this.
<br>
<br>
As a small improvement I thought I could at least combine all of the unique solar system bodies (Earth, Sun, etc.), into a single timestep file such as this:
<br>
(filename: timeseries_2455562.vtu) <br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""><?xml version="1.0"?></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""><VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <UnstructuredGrid></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <Piece NumberOfPoints="2" NumberOfCells="2"></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <PointData Vectors="Velocity" Scalars="Radius"></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="Time" type="Float32" format="ascii">2455562 2455562</DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="Radius" type="Float32" format="ascii">6371 696000</DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="Velocity" type="Float32" NumberOfComponents="3" format="ascii"></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> -2.982651603443954E+01 -5.304542013817379E+00 -7.226846229160870E-04</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> 0 0 0</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </PointData></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <Points></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray type="Float32" NumberOfComponents="3" format="ascii"></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> -2.567030301930377E+07 1.448508985971261E+08 -3.607762965630511E+03</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> 0 0 0</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </Points></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <Cells></span> <br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="connectivity" type="Int32" format="ascii">0 1</DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="offsets" type="Int32" format="ascii">1 2</DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> <DataArray Name="types" type="UInt8" format="ascii">1 1</DataArray></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </Cells></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </Piece></span> <br>
<span style="font-size:10.0pt;font-family:"Lucida Console""> </UnstructuredGrid></span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""></VTKFile></span> <br>
<br>
The idea of this approach was to list all of the scalars and vectors for each corresponding body in a single file. In this example the first listed scalar, vector, or coordinate point, is the Earth while the second set of values indicates the Sun's data. By
combining the bodies into a single file I could reduce the 500,000 files required down to some 60,000 files....still undesirable but better.
<br>
<br>
However I would also like to segment the Points once inside the ParaView environment; so I can create a distinct pipeline for each body in the dataset. One application for this would be to allow different Glyph rendering rules for the Sun and the Earth so
I can make the Sun...have a Sun texture - and the Earth an Earth texture. <br>
<br>
After experimenting with this for awhile I found myself trying to implement a Programmable Filter. The filter would take the Unstructured Grid for the given timestep, and given an index, extract the Point, Scalar, and Vector data from its input - then set
only those values to the Output Unstructured Grid. I currently have a script that looks something like this:
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># CELLID 0 = EARTH</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">cellId = 0</span> <br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Obtain References To Input/Output Data</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">gridI = self.GetUnstructuredGridInput()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">gridO = self.GetUnstructuredGridOutput()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">dataI = self.GetInput()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">dataO = self.GetOutput()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">scalarI = dataI.GetPointData().GetScalars()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">vectorI = dataI.GetPointData().GetVectors()</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Initialize Local Storage Arrays</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newVector = vtk.vtkFloatArray()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newVector.SetName(vectorI.GetName())</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newVector.SetNumberOfComponents(3)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newScalar = vtk.vtkFloatArray()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newScalar.SetName(scalarI.GetName())</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newPoint = vtk.vtkPoints()</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newPoint.SetNumberOfPoints(1)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newCell = vtk.vtkCellArray()</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Lookup CellId References</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">idCell = gridI.GetCell(cellId)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">idCellType = gridI.GetCellType(cellId)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">idPoint = gridI.GetPoints().GetPoint(cellId)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">idScalar = scalarI.GetTuple(cellId)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">idVector = vectorI.GetTuple(cellId)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Populate New Local Cell Array with CellId Cell</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newCell.InsertNextCell(idCell)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Populate New Local Point Array With CellId Point</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newPoint.SetPoint(0, idPoint)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Populate New Local Scalars with CellId Scalar Tuples</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newScalar.InsertNextTuple(idScalar)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Populate New Local Vectors with CellID Vector Tuples</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">newVector.InsertNextTuple(idVector)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console""># Copy Local Cells, Scalars, Vectors, and Points Into Output Pipeline Data</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">gridO.SetPoints(newPoint)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">gridO.SetCells(idCellType, newCell)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">dataO.GetPointData().SetScalars(newScalar)</span>
<br>
<span style="font-size:10.0pt;font-family:"Lucida Console"">dataO.GetPointData().SetVectors(newVector)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">The filter does achieve the desired effect for the cellID 0 - but when I switch the value of cellID to 1 (which should refer to the Sun's index) ParaView crashes hard - where I assume I am missing
something, possibly requesting something out of bounds in memory.</span> <br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I've been struggling with this problem for a little while now and thought to share my progress here; hopefully there is somebody out there with a little more insight that could help guide me towards
either a conclusion with this implementation or a suggestion for a better approach.</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Essentially - How can one give ParaView Point and Velocity vectors over a vast sequence of time without creating potentially hundreds of thousands of files on disc? Does this Programmable Filter
seem like a reasonable approach? Is there a native feature I am missing that does this already? Is there some other file format other than VTK I could use to have ParaView understand this format of data?</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Any thoughts, comments, or questions will be greatly appreciated. :)</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Thanks,</span> <br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""> John</span> <o:p>
</o:p></p>
</div>
</body>
</html>