Topological Optimization DarkSky¶
Pipeline description¶
This example simplifies all the persistence pairs below 25% of the maximum persistence of the density of dark matter in an astrophysics simulation.
This example first loads the point cloud then applies a gaussian resampling to create a scalar field defined on a regular grid. Then the scalar field is smoothed with ScalarFieldSmoother (with 5 iterations). The persistence diagram is computed using PersistenceDiagram and then thresholded to create a target diagram where the persistence pairs having persistence below 25% of the maximum persistence are removed. Finally, using the topological optimization backend of TopologicalSimplification, it optimizes the scalar field to remove, as much as possible, the pairs which are not in the target diagram.
The python script computes the topological optimization and saves the optimized scalar field.
Note that the optimization will take a long time (typically, around 40 minutes). For interactive visualization purposes, we suggest to first run the optimization in batch mode with pvpython
(see instructions below) and then run the post-process visualization state topologicalOptimization_darkSky_postProcess.pvsm
(see instructions below).
ParaView¶
To reproduce the above screenshot (and run the optimization online, around 40 minutes), go to your ttk-data directory and enter the following command:
paraview states/topologicalOptimization_darkSky.pvsm
If you have already computed the optimization with pvpython
(see instructions below), simply enter:
paraview states/topologicalOptimization_darkSky_postProcess.pvsm
Python code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
To run the above Python script, go to your ttk-data directory and enter the following command (around 40 minutes of runtime):
pvpython python/topologicalOptimization_darkSky.py
Inputs¶
- ds14_scivis_0128_e4_dt04_1.0000.vtp: A point cloud dataset representing a simulation of the density of dark matter in the universe.
Outputs¶
darkSky_optimized.vti
: the optimized dataset.