This project provides a streamlined pipeline for visualizing collision events simulated in UrQMD (Ultra-relativistic Quantum Molecular Dynamics) v3.4.
The pipeline consists of four primary stages:
- File Reduction: Processes the
filename.f14
output file from UrQMD, removes unnecessary whitespace, and saves it asfilename_reduced.csv
. - Data Parsing: Extracts detailed event information, calculates necessary parameters, and stores the processed data in Parquet format in the same folder as the input file.
- Conversion to CSV: Converts the Parquet data by grouping it into time snapshots, with each snapshot saved as a separate CSV file.
- Visualization: Uses the generated CSV files as input for the ParaView template
paraViewState-massVar.pvsm
to visualize the events.
f14reducer.py
: Contains theF14Reducer
class, which reduces a.dat
file by cleaning up extra spaces and outputs a concise.csv
file.urqmdParser.py
: Contains theUrqmdParser
class, which processes the reduced file, calculates event parameters, and stores the processed data in Parquet format.parquetToCsv.py
: Contains theParquetToCSVConverter
class, which takes the Parquet file generated byurqmdParser
and converts it into multiple CSV files, each representing a time snapshot.run.py
: The main script that runs the pipeline in sequence, handling the entire process from file reduction to CSV conversion.
The primary entry point is run.py
, which orchestrates the reduction, parsing, and conversion stages. To run the pipeline:
-
Set Input Paths:
- Open
run.py
and specify the correct path for your.dat
input file by modifying thefilename
variable.
- Open
-
Run the Script:
- Execute the following command from the terminal to initiate the pipeline:
python run.py
- Execute the following command from the terminal to initiate the pipeline:
-
Output:
- The pipeline will output the CSV files into a specified folder (
output_csv_files
). Each CSV file contains data for an individual time slice.
- The pipeline will output the CSV files into a specified folder (
Here’s an example of the expected output in the terminal during the process:
Starting file reduction for: ../files/urqmd_AuAu_0-3fm/urqmd_1_14.dat
Finished processing 1702856 lines.
Reduction complete.
Output saved to: ../files/urqmd_AuAu_0-3fm/urqmd_1_14_reduced.csv
File reduction completed successfully.
Starting parsing...
Loading data from: ../files/urqmd_AuAu_0-3fm/urqmd_1_14_reduced.csv...
Data loaded successfully.
Collision Parameters:
Total Time (tottime): 25.0
Delta Time (dtime): 0.1
Impact parameter: 2.79 fm
Mass and Charge of Particles:
Particle A - Mass: 197, Charge: 79
Particle B - Mass: 197, Charge: 79
Total slices to process: 250
[####################] 250 / 250 slices processed
Data saved to ./output_parquet_files/event_2.parquet
Parsing completed, memory cleaned up.
Parsing and Parquet file creation completed successfully.
Parquet file loaded successfully.
Starting CSV conversion...
[####################] 250 / 250 frames processed
Conversion completed: 250 files created, 0 failed.
CSV conversion completed successfully.
To visualize the output in ParaView:
-
Open ParaView:
- Run ParaView and navigate to
File -> Load State
. - Load the
paraViewState-massVar.pvsm
template.
- Run ParaView and navigate to
-
Load the CSV File Sequence:
- Right-click on
event3_frame_0.csv*
in the pipeline and selectChange File
. - Navigate to the
csv_folder
and select your event file. - Right-click again on the file sequence in the pipeline and select
Reload Files
to refresh the list with the new files (Find new files
).
- Right-click on
-
Adjust Event Info and Time Annotation:
- Update the event information in
UrQMD-text
. - Set the
TimeAnnotation
scaling based on your simulation step size withscale = step
.
- Update the event information in
-
Enable Ray Tracing:
- In the properties tab, enable ray tracing.
-
Save the Animation:
- Go to
File -> Save Animation
. - Select a folder to save the PNG files for the animation.
- Set the image resolution to 1920 x 1080 and choose a compression level (0 is recommended for no compression).
- Go to