Upload
billie
View
46
Download
0
Embed Size (px)
DESCRIPTION
Working with Time in ParaView. Attention. These slides are incomplete and are provided for the IEEE Vis 08 DVD. The complete and full set of slides will be available from the CSCS web site under the following link http://www.cscs.ch/index.php?option=com_content&task=view&id=98&Itemid=135 - PowerPoint PPT Presentation
Citation preview
03/06/2008
Working with Timein ParaView
Attention
These slides are incomplete
and are provided for the IEEE Vis 08 DVD.
• The complete and full set of slides will be available from the CSCS web site under the following linkhttp://www.cscs.ch/index.php?option=com_content&task=view&id=98&Itemid=135
• And in the event of broken/changed link, from the ParaView3 Wikihttp://www.paraview.org/Wiki/ParaView
Contents
• Data Formats for time-dependent data• vtk-XML, HDF(Xdmf), Ensight, Exodus etc
• Brief overview of • Time controls, Time keeper modes• Animation inspector/viewer, Keyframes
• Comparative Visualization• Built in vis mode for time series data
• Time Dependent Filters• Cache, Interpolator• Shift-Scale + Annotation• Particle Tracer + Pathlines
• Manipulating Time in Filters• How to make your custom reader work etc• Tips’n’Tricks : How to override time, avoiding multiple updates• Things to watch out for.
Data Import
Formats Supported
• vtkPVDReader (vtk XML Collection)
• filename.pvd + Filename-00.vtu/vti/vtp etc• vtkXML * Reader
• PolyData, UnstructuredGrid, StructuredGrid, ImageData, RectilinearGrid, Multiblock, Heirarchical etc.
• Legacy VTK files with 001, 002, 003 filenames (not well)• Ensight (case files, ASCII/Binary data)• OpenFOAM, SpyPlot, Phasta, STL, MFIX (untested@CSCS)• Xdmf (extensible data model format)
• XML light data with geometry/time information inside
• Hdf5 – heavy – big data containing scalars/fields• Exodus (used by several US research facilities)• (CSCS) custom readers include
• netCDF, H5Part (from CSCS web site)
Vtk (XML based) file format
VTK Collection - Easy to create by hand if necessaryA General purpose holder for vtk XML files of all types
vtu=unstructured, vtp=polydata, vtr=rectilinear, vti=imagedata
Each individual file can be binary/text, compressed or not<VTKFile type="Collection" version="0.1" byte_order="LittleEndian">
<Collection>
<DataSet timestep="0.01" group="" part="0" file="Foo_001.vtu"/>
<DataSet timestep=“0.02" group="" part="0" file=“Foo_002.vtu"/>
<DataSet timestep=“0.03" group="" part="0" file=“Foo_003.vtu"/>
</Collection>
</VTKFile>
The VTK Collection is in fact a generic holder for MultiBlock and MultiGroup composite datasets and can store time information too.
The vtkXMLReader family is responsible for loading this kind of data.
User can use vtkXML_xxx_Writer to write N time steps of any kind of data and then add a little XML meta data to describe it.
Animating with Time
Animation Intro
GUI Controls
Time value displayed in toolbar –
Time step mode – user can change step
Sequence mode – user can change time freely
VCR style toolbar has play controls
(play, step forward/back, jump to start/end)
Data with Time support shows the timesteps in the information tab. (Lacks ability to click on timestep and jump to it)
Animation control has settings for time stepping and keyframes
Abort button to stop movie generation not obvious
SideNote : Old and New Time in ParaView
In PV2.x Time was usually animated by changing the TimeStep value of a reader (or filter).
In PV3.x Time is an information variable/object passed down the pipeline which makes it possible for filters to modify time before passing it to their source. For this reason, the GUI sets the time inside the Rendering/Mapping code and not via a TimeStep variable.
Some older readers may still have a TimeStep variable, but this is being phased out and its use is not encouraged – unless you are trying to do something ‘a bit special’ (see slides near end).
Time Modes in Animation Inspector
Snap to TimeSteps When you click ‘play’ the animation will
begin at whatever time step you are on and continue until it either reaches the end (or is stopped manually).
When stopped the animation will continue from where it left off if restarted.
Each frame played represents a single time step of the input data
There is no need to set any keyframes or specify any particular property to animate.
The Track selection is used to select or create keyframes
Time Modes in Animation Inspector
Snap to TimeSteps : * * * Warning * * *When dataset 1 is loaded it may have time values
0, 1, 2, 3, …..N
When dataset 2 is loaded it may have time values
0.5, 1.5, 2.5, 3.5, …..M
Playing an animation in Snap To TimeSteps mode will traverse ALL KNOWN Timesteps – which means
0, 0.5, 1, 1.5, 2, 2.5 …..max(M,N)
This can cause unexpected results!
Future time support will allow you to ‘Snap to active pipeline steps’ so that only the times exported for a particular dataset/filter will be traversed. (In development).
Fix : Use Sequence mode and ‘lock’ the start and end times to prevent changes
Time Modes in Animation Inspector
Sequence ModeThe start and end times correspond to the
max and min values of time in the data you loaded.
If you manually change the start/end times you can ‘Lock’ the new times – this prevents them being reset to the default start/end times if new data is loaded.
Animation will now ignore the Time steps present in the data and use interval=(end/start)/(numFrames-1)
This is frequently NOT WHAT YOU WANT
Time Modes in Animation Inspector
Worked example interval=(end/start)/(numFrames-1)
60.001424 - 50.001424 = 10
Num Frames = 10
We should get our original time steps back (1s per step)
In fact we get 10/(numFrames-1) = 1.11111111s/frame
Need to use 11 frames to get 0,1,2,3,4,5,6,7,8,9,10
Note : In the some versions of PV3 selecting time values which are not exactly the same as those present will produce no update. It should snap to the nearest time step, but does not. See SnapToTimeSteps for a fix.
Time Modes in Animation Inspector
Real TimeAnimates using the ‘Wall time’
Not always useful for the majority of filters/data sources that we use
Useful to animate ‘as fast as we can’ if data was stored with time representing a real clock value and we wish to ‘play back’ data in real time.
In this mode not all times may be displayed. Some will be skipped or some may be on screen for ages.
Also very handy for integrating generators of data (eg sensor equipment) into the gui and displaying the real time update of the sensor (no examples of this yet though)
Comparative visualization
Comparative View Inspector
• Allows MxN array of views on the same data• Allows a variable to be changed along the X axis.• Severe limitation is that time must be between 0.0-1.0 for the view to
operate
• SolutionTemporalShiftScale with
Normalize flag set
Same Data at multiple T
Data source(time aware)
TemporalShiftScale(T between 0,1)
Display/GUIRenderer
Filter 1 Filter 2
Time Dependent Algorithms/Filters
Pipeline Introduction
Pipeline Introduction
• Most users know nothing about the internals• Users just say ‘Give me data’• Contour it/Colour it/Tweak it• Save my picture
• The pipeline is demand driven with data flowing downstream
Information flowing up and down stream
In PV3 Time is part of the Information flow.
Data source filter(s)Display/GUI
Renderer
Data
Info
How does it work
• How does the pipeline actually fit together• All filters are connected together by Executives which receive
information from downstream (and upstream) and decide• Are the data inputs valid• Are the data outputs valid• Is everything else valid• Has anything changed since I last updated
In PV3 Time is passed as information and the executives can LOOP portions of the pipeline over multiple time steps
This means that filters can request multiple time steps
This enables us to implement Time Dependent Algorithms
Pipeline Looping
• vtkTemporalDataSet• When the pipeline is looped to generate multiple time steps, the executive
generates a dataset collection• The collection is passed to the temporal algorithm• The algorithm can request any number of time steps• But usually 2 (linear interpolation)
• In order to make looping work, some information keys are used internally• A brief overview is presented in the next slide, as it useful to understand
how things work if you need to implement your own custom filter (time dependent)
Side note : Information Keys
During Updates, the pipeline makes 4 request passes…DataObject, Information, UpdateExtent, Data
Keys exported by time aware sourcesTIME_RANGE (continuous), TIME_STEPS (discrete)
Time aware reader will declare N steps 0.0, 0.1, 0.2…..etc
Keys used during requestsUPDATE_TIME_STEPS (Filter says ‘I want these’)
Interpolator says I need times 0.1 and 0.2 for example
Keys set during executionDATA_TIME_STEPS (Source says ‘I made these’)
Data generator says I generated times 0.1 and 0.2
Keys used internally by executivesREQUIRES_TIME_DOWNSTREAM (looping will be needed)
CONTINE_EXECUTING (multiple passes inside algorithm)
Time Dependent Algorithms/Filters
Interpolation
(Linear) Interpolation
• vtkTemporalInterpolator• Linearly interpolates between 2 time steps• When Time T.5 is requested it requests times T and T+1
• 2 Modes of Operation• Continuous• Discrete
• Continuous Mode• DiscreteTimeStepInterval=0.0• Filter generates no TIME_STEPS on output – just a TIME_RANGE• GUI can request any time between min/max
• Discrete Mode• DiscreteTimeStepInterval>0• Filter generates (max-min)/DiscreteTimeStepInterval steps• GUI sees discrete data with new TIME_STEPS values
(Linear) Interpolation
Continuous modeInput data (left) has N discrete time stepsOutput data (right) has no time stepsIt does report a TIME_RANGESo the GUI knows that any time between min/max can be requested
(Linear) Interpolation
Discrete modeExample :DiscreteTimeStepInterval=0.01
New time steps are generated and the output data ‘looks’ like it has 10x as many time steps.
Note that no interpolation of the data has been performed yet, only when something is actually rendered/requested will the interpolation take place.
(Linear) Animation Interpolation
• Continuous mode• Given input data with any time steps, we can
generate an animation using ‘sequence mode’• Animate using as many time steps as you wish
between min/max• In this example we set Num Frames to 1000• NB. Should use 1001 frames if we want output
steps to coincide with input steps resampled by 10
• Animation property is ‘Discrete Time Step interval’
• Get a very smooth output
• Discrete mode• Given an input with N time steps, but a few are
accidentally missing (lost of never generated)• Set DiscreteTimeStep Interval to the original time
step size (say 0.1 or 0.01 etc)• Output now seems to be exactly the same as the
input – except that the steps that were missing from the input are recreated using interpolation when requested on the output
• Animate using ‘Snap To TimeSteps’ mode• Animation property is ‘Discrete Time Step interval’
• Animation will look like intended original
(Linear) Interpolation
(Linear) Interpolation
• What can be interpolated• Any Dataset which does not change topology between time steps• Point positions are interpolated
• Connectivity (cells are copied)• Point Data is interpolated• Cell Data is interpolated• ImageData/PolyData/Rectilinear/Unstructured
• All can be interpolated if cell connectivity and number of cells remains the same
• MultiBlock/MultiGroup/Heirarchical/AMR
• If the tree structure remains the same between time steps and the individual leaves satisfy above conditions
Interpolation - ALWAYS USE A CACHE!
• If animation from 0->t is performed using a TemporalInterpolator, the interpolator will request 2 time steps each time it updates
• We do not want it to request the same time step(s) again and again and again....
• Interpolating at 0.1 spacing between 2 steps causes
Step 0 + Step 1 : Output Step 0.1
Step 0 + Step 1 : Output Step 0.2 Each step N times!
Step 0 + Step 1 : Output Step 0.3• Use a TemporalDataSetCache to store 2 timesteps and prevent this
repeated re-execution of the pipeline
Data source(time aware)
TemporalDataSetCache
Display/GUIRenderer
Interpolator
Interpolation Example : Particles
Data Courtesy : David Graham, Plymouth UK.
Data source(time aware)
TemporalDataSetCache
Display/GUIRenderer
Interpolator
Snap To TimeStep
Time To Text
Time To Text
Interpolation Example : Big mesh with missing data
Interpolated over 1 missing time step, and smoothed the whole thing nicely
Time Shifting
Time Shifting
• Temporal Shift Scale• Changes time between the input and output of a filter• Can be used to compare the same data at 2 different values of T• See example pipeline below• Tout = Tin*scale + shift• Using
• Scale = 1
• Shift N (seconds or other units depending on data)
• Gives simple linear translation of time
• NB. +ve Shift produces +ve delay of output timeseems the wrong way around, but time 0 is now time N, so it takes N seconds to get to it
Data source(time aware)
Filter 1(a)
TemporalShiftScale(modifies time values)
Display/GUIRenderer
Filter 1(b)
Comparative Vis (using Time shift)
• Time shift + Interpolation + Trails• 3 time dependent features in 1 go
Temporal Cache
Cache Filter : Sidenote
• TemporalDataSetCache•Forms a bridge between a simple and a temporal section of a pipeline. •Consider the case where a pipeline branches and different T values
are requested. The cache prevents updates from one section propagating too far upstream and forcing the other branch to be re-executed needlessly. •In addition, the cache prevents a filter such as the particle tracer
requesting the same T multiple times as it iterates.
Data source(time aware)
Simple filter(s) (no special time requirements)
Temporal DataSetCache
TemporalFilter(requires multiple time
steps, e.g.. Particle tracer)
TemporalShiftScale(modifies time values)
Display/GUIRenderer
Plotting Data
over Time
Particle Tracing In Vector fields
TemporalStreamTracer
Particle Tracing
Input must have vector field
If input dataset has N time stepsParticle tracer will generate N-1 output steps
Output step 0 time value corresponds to input step 1 timeNothing can be generated until 1 time period has passed
Seed points are supplied as separate inputs
Data source(time aware)
TemporalDataSetCache
Display/GUIRenderer
Temporal Stream Tracer
Seed point geometry (can be
animated with keyframes)
Could generate seed points from time dependent
data
Particle Tracing
Source (seedpoints)LineSource 100 points
Time Step resolutionLeave as 1 – this can be used to scale time if the input time was not stored correctly (e.g. it goes 0…N but should be 0.1 0.2 0.3 etc)
Time StepSet to zero initially – this will request steps, (0,1) from the input and the time actually corresponds to T=1 (but it will be the 0th step on the output)
Particle Tracing
Force re-injectionevery 1 or 2 time steps
Particles will be injected at the seed points every N steps
Input vectorsUsually a velocity field, but could be another
Initial Integration stepUsed by Runge-Kutta integration to make incremental velocity field approximations
Can be smaller but 0.25 usually OK
Particle Tracing
Ignore pipeline timeThis is very important – the particle tracer generates less output steps than the input (-1) and so we cannot (yet) use the default animation controls due to bug mentioned earlier.
We therefore instruct the particle tracer to ignore pipeline time and instead animate the Timestep property from 0 to N-2 (if the input has N steps, the Particle tracer has N-1 steps output, so we go from 0 to N-2 to get the correct number)
Particle filename (not shown)An option to store particles to disk will be included at a future date.
Particle Tracing
• To generate animation of particles• Use Sequence Mode Animation• Use N-1 Frames (because there will be N-1
steps generated – this data had 51 steps on the input indexed as 0-50), so we use 50 frames for output
• Create a Keyframe on ParticleTracer TimeStep.
• Set Keyframe index 0 • Time to start time = 0.0 here• Value to TimeStep 0
• Set Keyframe index 1 • Time to end time = 7.99 here • Value to 49 (last index = 51-2)
• Animation can now be played or saved as movie
Pipeline for Interpolation
46
Data ReaderTemporal
Cache(2 steps)
Temporal Interpolator
t=1/80
Pathlines from point trajectories
Animation
03/06/2008
Selection+Time
Selection over time
• The same procedure can be used to query a particle over all available time
• Extract Selection over time filter builds a spreadsheet of values for the selected IDs over all time steps • NB: Can’t set a sub region of time using the animation controls yet, but
this feature will be coming
03/06/2008
Extract Selection over time
03/06/2008
Which Point
to display
Which field(s)
• Extract selection over time• Selection is based on point IDs• Works if every point is the same in each time step• Global IDs
03/06/2008
03/06/2008
Adding a new Reader
What to add
• Request Information• TIME_STEPS TIME_RANGE• Code example
What to add
• Request Data• Code example
What to add
• Request UpdateExtent• Code example
What to add
XML Required for integration of filter• Code example
03/06/2008
Tips’n TricksTo do