IAP GITLAB

Skip to content
Snippets Groups Projects
Commit e19bc849 authored by Ralf Ulrich's avatar Ralf Ulrich
Browse files

Merge branch '232-update-shower-animation-script' into 'master'

Resolve "update shower animation script"

Closes #232

See merge request AirShowerPhysics/corsika!255
parents e769036e fea943db
No related branches found
No related tags found
No related merge requests found
...@@ -10,22 +10,32 @@ ...@@ -10,22 +10,32 @@
# with this script you can plot an animation of output of TrackWriter # with this script you can plot an animation of output of TrackWriter
track_dat=$1 tracks_dat="$1"
muon_dat=$2 if [ -z "$tracks_dat" ]; then
echo "usage: $0 <tracks.dat> [output.gif]" >&2
if [ -z "$track_dat" ] || [ -z "$muon_dat" ]; then
echo "usage: $0 <hadron.dat> <muon.dat> [output.gif]" >&2
exit 1 exit 1
fi fi
output=$3 directory=$(dirname "$tracks_dat")
hadrons_dat="$directory/hadrons.dat"
muons_dat="$directory/muons.dat"
if [ "$muons_dat" -ot "$tracks_dat" -o "$hadrons_dat" -ot "$muons_dat" ]; then
echo "splitting $tracks_dat into $muons_dat and $hadrons_dat."
cat "$tracks_dat" | egrep '^\s+-*13\s' > "$muons_dat"
cat "$tracks_dat" | egrep -v '^\s+-*13\s' > "$hadrons_dat"
fi
output="$2"
if [ -z "$output" ]; then if [ -z "$output" ]; then
output="$track_dat.gif" output="$tracks_dat.gif"
fi fi
echo "creating $output..."
cat <<EOF | gnuplot cat <<EOF | gnuplot
set term png size 900,900 set term gif animate size 900,900
#set output "$output" set output "$output"
#set zrange [0:40e3] #set zrange [0:40e3]
#set xrange [-10:10] #set xrange [-10:10]
...@@ -36,9 +46,11 @@ set zlabel "z / m" ...@@ -36,9 +46,11 @@ set zlabel "z / m"
set title "CORSIKA 8 preliminary" set title "CORSIKA 8 preliminary"
do for [t=0:359:1] { do for [t=0:359:1] {
set output sprintf("%03d_$output", t) # for separate file per angle:
set view 90, t # set output sprintf("%03d_$output", t)
splot "$muon_dat" u 3:4:5:6:7:8 w vectors nohead lt rgb "red" t "", "$track_dat" u 3:4:5:6:7:8 w vectors nohead lc rgb "black" t ""
set view 80, t
splot "$muons_dat" u 3:4:5:6:7:8 w vectors nohead lt rgb "red" t "", "$hadrons_dat" u 3:4:5:6:7:8 w vectors nohead lc rgb "black" t ""
} }
EOF EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment