Jpp  debug
the software that should make you happy
JEarth.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to run JEarth.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 source $JPP_DIR/setenv.sh $JPP_DIR
20 
21 set_variable DEBUG 2
22 set_variable WORKDIR ${TMPDIR:-/tmp}/
23 
24 if do_usage $*; then
25  usage "$script <energy>"
26 fi
27 
28 case $# in
29  1) set_variable E $1;;
30  *) fatal "Wrong number of arguments."
31 esac
32 
33 if (( 1 )); then
34 
35  $JPP_DIR/examples/JPhysics/JEarth \
36  -E $E \
37  -o $WORKDIR/earth.root \
38  -n 100000000
39 fi
40 
41 JPlot2D \
42  -f $WORKDIR/earth.root:hs \
43  -O COLZ \
44  -> "x [m]" \
45  -< "y [m]" \
46  -T "source"
47 
48 
49 ZMAX=`JPrintResult -f ${TMPDIR:-/tmp}/earth.root:ht -F GetMaximum`
50 
51 ZMIN=$(( $ZMAX * 0.81))
52 ZMAX=$(( $ZMAX * 1.01))
53 
54 JPlot2D \
55  -f $WORKDIR/earth.root:ht \
56  -> "x [m]" \
57  -< "y [m]" \
58  -z "$ZMIN $ZMAX" \
59  -O COLZ \
60  -T "target"
61 
62 
63 JPlot2D \
64  -f $WORKDIR/earth.root:h2 \
65  -z "0.5 1e6" -Z \
66  -> "Tx" \
67  -< "Ty" \
68  -N "X 505" \
69  -N "Y 505" \
70  -O COLZ \
71  -T "target"