Extracting a Galaxy from a Cosmological simulation.
Description:
The result of a Cosmological N-Body-SPH simulation is a set
of millions (sometimes billions) of particles. From this
complex distribution, we show how we can identify a galaxy and extract
the corresponding data for furthe investigation
1. Lunch VisIVO Desktop
- Load data (attention to your laptop performance)
-File Menu- >Import->Binary
- Open "small10M.bin" file (not the .head file, the .bin file with this demo you load 10 millions particles, quite a lot so you need a good computer. Otherwise use "small5M.bin" with 5 million particles or "small1M.bin", just 1 million particles
- however some of the next settings could be slightly different)
- Select all listed fields (3D coordinates, density, temperature and tipical size of each particle)
- OK
- The data node on the control tree panel (hereafter "tree") appears
2. Visualize all particles
- Select the "small10M node", clicking on it
- Open the "Create Visual Object" panel clicking on the icon with three small spheres
(or, equivalently, Operations->Table Data->Create Visual Object)
- X, Y, Z should be already selected as cartesian coordinates (if not,
select them)
- OK
- At this point the Render Window will open, with all the points visualized.
- At this stage you get a just monocromatic spot on the screen. You must
work on it!!!
3. Improving rendering
- Select "Visual Points - 3D" in the tree
- Click on "Rendering" in the lower panel
- Play with the Opacity slider. The response could be slow depending on your PC. You will see particles become transparent
and structures appear (Opacity 0.01)
- Go to "Object Fields" panel, clicking on the corresponding tab
- Select "temperature" as Active Scalar (which will be used to colour points)
- Go back to "Rendering" panel
- Click on Use LUT and Log. Scale. The points will be coloured by the
temperature
At this point the image is again quite fuzzy. Let's improve it!!!
- Click on the colour bar in the "Rendering" panel. The LUT editor will open
- On the top, select the "temperature" from the colours menu (at the beginning "default" is active)
- set the "mapped value range" between 20000 (min.) and 2e6 (max.)
- "Apply"
Now let's set the transparency of each colour
- select the first (white) square on the top left of the colours array (click on it)
- drag the round selector in the vertical coloured rectangle (below "Fade colours" button) to the base of the rectangle (max transparency)
- select all the squares on the colour array, passing on them with the mouse with the left button pushed
- When all squares are selected, click on "Fade ONLY alpha". The transparency of each colour will be linearly interpolated between 0 and 1
- OK
At this point you should have a nice image where low density regions are blue and galaxies are red and yellow.
At this point, you can have fun,
- moving the volume,
- rotating it (move the mouse keeping the left button pushed),
- zooming (move the mouse keeping the right button pushed),
- translating (move
the mouse keeping the central button pushed).
- If you get lost,
select the "View Settings" tab on the top, and reposition the volume
with the small cube buttons. The number of visualized points
will decrease during motion to be faster.
4. Calculate particles' masses
Galaxies are identified as regions with higher masses. To do that
we need the mass of the particles. We must derive them from the available
fields as density*volume(=smooth^3).
- Select "small10M" in the tree
- Select the "f(x)" button on the top (or Operations->Table Data->Math Op.)
- In the "Expression" field write: density*smooth*smooth*smooth
- Set the Name to "Mass" (or whatever you like)
- OK
- Select "Visual Points - 3D" in the tree
- Select "Object Fields"
- In the scalars list, the new "Mass" field is now present
5. Identify galaxies
- Select "Visual Points - 3D" in the tree
- Calculate the continuous mass field by smoothing the mass on a support computational mesh by selecting Operations->Point Functions->Point Distribute
- select "mass" as Field
- Set Resolution to 64 64 64
- OK
The "Distributed points" field appears in the tree. Let's define galaxies
as regions in which the mass is above a given threshold (in arbitrary
units).
To visualize these regions, we use isosurfaces. Volumes inside the surfaces
are above the given threshold.
- Select "Distributed points"
- Select Operations->Volume Functions->Extract IsoSurface
- Set "contour value" to 5000
- OK
- The "Distributed points Isosurface 5000" field appears in the tree, visualize it by clicking on the square to the left
- Galaxies are points clusters inside the isosurfaces
- Find one you like and go close to it
6. Extract the galaxy
- Remove the point visibility: click on the cross in the square box near "Visual Points - 3D" in the tree
- Select "Distributed points Isosurface 5000" in the tree
- Select Operations->Surface Functions->Extract Cluster
- Click on the selected isosurface (galaxy) which will change colour (this operation could take some time)
- OK
Points inside the surface will be identified and extracted, a
new dataset ("Sampled Cluster Points") appears on the tree.
You can treat it as the initial dataset, visualizing it in a new
render window, that you can open from View->Add View->3D View
7. Play with the galaxy
Since the points of the galaxy are few, you can visualize them
as coloured spheres.
- Select "Visual Points" associated to the new dataset
- Go to "Object Fields" panel
- select "temperature"
- Go to "Rendering"
- Click on "Use LUT"
- Click on Sphere
- Set the "Scale" field to 200
- Select "Sampled Cluster Points"
- Save the new dataset in a file: File->Export
At this point you can go on playing with your data, exploring
the different functionalities of VisIVO.