Data Visualization with Processing


Data Visualization, Processing, Scripting

Generated 3D visualization of beam data from RAW text file. Visualization shows energy distribution of electron particles after passing through wedge shape material.

Below is a general visualization of a beam targeting a wedge shaped material. The simulation was processed in G4beamline where parameters such as the material type and distance (z) were entered to generate results for the scattered particles (beam spot).

data-viz1

Sample output data from G4beamline:

#BLTrackFile VirtualDetector/Det1
#x y z Px Py Pz t PDGid EventID TrackID ParentID Weight
#mm mm mm MeV/c MeV/c MeV/c ns - - - - -
-95.9382 -44.7721 999.5 -17.7026 -5.77994 196.767 3.79736 -13 1 1 0 1
-159.029 -137.193 999.5 -31.8793 -27.0444 198.315 3.84246 -13 2 1 0 1
8.09999 -23.4178 999.5 -2.44748 -7.29911 199.866 3.77336 -13 3 1 0 1
-161.919 -72.8214 999.5 -33.1064 -15.1311 204.072 3.80114 -13 4 1 0 1
110.386 -26.7592 999.5 23.0336 -6.1675 193.241 3.82199 -13 5 1 0 1
-61.1453 -10.5156 999.5 -10.1056 -2.82046 198.153 3.78244 -13 6 1 0 1
-24.8392 202.785 999.5 -3.77367 38.7459 197.059 3.83988 -13 7 1 0 1
281.543 27.8308 999.5 55.6392 6.23801 198.353 3.89293 -13 8 1 0 1
16.2839 178.522 999.5 2.09084 34.8078 190.723 3.85983 -13 9 1 0 1
127.482 -92.7624 999.5 23.7654 -17.641 191.607 3.84195 -13 10 1 0 1

I wrote a script in Processing that parsed the data from the RAW text file (containing data for 100,000 particles) and generated a 3D graph that showed the energy distribution.

data-viz2

The 3D representation of data could be zoomed in and rotated by changing the cursor position in the Processing window. A vector screenshot (PDF) could be obtained at anytime by pressing “P”.

LANL-beam data

Leave a Reply