Presentation is loading. Please wait.

Presentation is loading. Please wait.

Working with Time in ParaView 03/06/2008.

Similar presentations


Presentation on theme: "Working with Time in ParaView 03/06/2008."— Presentation transcript:

1 Working with Time in ParaView 03/06/2008

2 These slides are incomplete and are provided for the IEEE Vis 08 DVD.
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 And in the event of broken/changed link, from the ParaView3 Wiki

3 Contents Data Formats for time-dependent data Brief overview of
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.

4 Data Import

5 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 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)

6 Vtk (XML based) file format
VTK Collection - Easy to create by hand if necessary A 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.

7 Animating with Time

8 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

9 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).

10 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

11 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

12 Time Modes in Animation Inspector
Sequence Mode The 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

13 Time Modes in Animation Inspector
Worked example interval=(end/start)/(numFrames-1) = 10 Num Frames = 10 We should get our original time steps back (1s per step) In fact we get 10/(numFrames-1) = s/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.

14 Time Modes in Animation Inspector
Real Time Animates 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)

15 Comparative visualization

16 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 for the view to operate Solution TemporalShiftScale with Normalize flag set

17 Same Data at multiple T Data source (time aware) TemporalShiftScale
(T between 0,1) Filter 1 Filter 2 Display/GUI Renderer

18 Time Dependent Algorithms/Filters Pipeline Introduction

19 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 Data source filter(s) Display/GUI Renderer Info

20 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

21 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)

22 Side note : Information Keys
During Updates, the pipeline makes 4 request passes… DataObject, Information, UpdateExtent, Data Keys exported by time aware sources TIME_RANGE (continuous), TIME_STEPS (discrete) Time aware reader will declare N steps 0.0, 0.1, 0.2…..etc Keys used during requests UPDATE_TIME_STEPS (Filter says ‘I want these’) Interpolator says I need times 0.1 and 0.2 for example Keys set during execution DATA_TIME_STEPS (Source says ‘I made these’) Data generator says I generated times 0.1 and 0.2 Keys used internally by executives REQUIRES_TIME_DOWNSTREAM (looping will be needed) CONTINE_EXECUTING (multiple passes inside algorithm)

23 Time Dependent Algorithms/Filters
Interpolation

24 (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

25 (Linear) Interpolation
Continuous mode Input data (left) has N discrete time steps Output data (right) has no time steps It does report a TIME_RANGE So the GUI knows that any time between min/max can be requested

26 (Linear) Interpolation
Discrete mode Example : 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.

27 (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

28 (Linear) Interpolation
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

29 (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

30 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 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) TemporalDataSet Cache Display/GUI Renderer Interpolator

31 Interpolation Example : Particles
Data source (time aware) TemporalDataSet Cache Interpolator Time To Text Display/GUI Renderer Snap To TimeStep Time To Text Data Courtesy : David Graham, Plymouth UK.

32 Interpolation Example : Big mesh with missing data
Interpolated over 1 missing time step, and smoothed the whole thing nicely

33 Time Shifting

34 (modifies time values)
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 time seems 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/GUI Renderer Filter 1(b)

35 Comparative Vis (using Time shift)
Time shift + Interpolation + Trails 3 time dependent features in 1 go

36 Temporal Cache

37 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/GUI Renderer

38 Plotting Data over Time

39 Iterative operation Plotting of data over Time
Extract one or more variables at a point or region over time GUI not driving the iteration process Filter manually sets CONTINUE_EXECUTING

40 Particle Tracing In Vector fields TemporalStreamTracer

41 Particle Tracing Input must have vector field
If input dataset has N time steps Particle tracer will generate N-1 output steps Output step 0 time value corresponds to input step 1 time Nothing can be generated until 1 time period has passed Seed points are supplied as separate inputs Data source (time aware) TemporalDataSet Cache Display/GUI Renderer Temporal Stream Tracer Seed point geometry (can be animated with keyframes) Could generate seed points from time dependent data

42 Particle Tracing Source (seedpoints) Time Step resolution Time Step
LineSource 100 points Time Step resolution Leave 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 etc) Time Step Set 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)

43 Particle Tracing Force re-injection Input vectors
every 1 or 2 time steps Particles will be injected at the seed points every N steps Input vectors Usually a velocity field, but could be another Initial Integration step Used by Runge-Kutta integration to make incremental velocity field approximations Can be smaller but 0.25 usually OK

44 Particle Tracing Ignore pipeline time Particle filename (not shown)
This 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.

45 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

46 Pipeline for Interpolation
Data Reader Temporal Cache (2 steps) Temporal Interpolator t=1/80 Pathlines from point trajectories Animation

47 Selection+Time 03/06/2008

48 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

49 Extract Selection over time
Which Point to display Which field(s) 03/06/2008

50 03/06/2008 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

51 Adding a new Reader 03/06/2008

52 What to add Request Information TIME_STEPS TIME_RANGE Code example

53 What to add Request Data Code example

54 What to add Request UpdateExtent Code example

55 What to add XML Required for integration of filter Code example

56 Tips’n Tricks To do 03/06/2008


Download ppt "Working with Time in ParaView 03/06/2008."

Similar presentations


Ads by Google