Skip to content

Commit

Permalink
Dev rpaganmunoz (#3)
Browse files Browse the repository at this point in the history
* Parameters update

* Change notation parameter and optional

Change the notation of parameter -v with -i and new parameters optional
  • Loading branch information
rpaganmunoz authored Feb 8, 2021
1 parent 87ef93d commit 2f388c9
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 5 deletions.
126 changes: 123 additions & 3 deletions sims/do_sims.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ showhelp() {
echo -e " -d : Enable DEBUG mode"
echo -e " -a : Enable high energy cuts for secondaries"
echo -e " -k <altitude, in cm> : Fix altitude, even for predefined sites"
echo -e " -c <atm_model> : Fix Atmospheric Model even for predefined sites."
echo -e " -b <rigidity cutoff> : Rigidity cutoff; 0 = disabled; value in GV = enabled."
echo -e " -m <Low edge zenith angle> : Low edge of zenith angle."
echo -e " -n <High edge zenith angle> : High edge of zenith angle."
echo -e " -r <Low primary particle energy> : Lower limit of the primary particle energy."
echo -e " -i <Upper primary particle energy> : Upper limit of the primary particle energy."
echo -e " -o <BX> : Horizontal comp. of the Earth's mag. field."
echo -e " -q <BZ> : Vertical comp. of the Earth's mag. field."
echo -e " -x : Enable other defaults (It doesn't prompt user for unset parameters)"
echo -e " -? : Shows this help and exit."
echo
Expand All @@ -85,9 +93,17 @@ vol=false
alt=false
altitude=0.
procs=4
atm_m=false
rig=false
lez=false
hez=false
lppe=false
uppe=false
BXcomp=false
BZcomp=false
defaults=false
echo
while getopts ':w:k:p:t:v:u:h:s:j:?aydex' opt; do
while getopts ':w:k:p:t:v:u:h:s:j:c:b:m:n:r:i:o:q:?aydex' opt; do
case $opt in
w)
wdir=$OPTARG
Expand Down Expand Up @@ -123,10 +139,50 @@ while getopts ':w:k:p:t:v:u:h:s:j:?aydex' opt; do
sites=true
echo -e "# Site location = $site"
;;
j)
procs=$OPTARG
j)
procs=$OPTARG
echo -e "# Number of processors = $procs"
;;
c)
atm_m=true
atm_model=$OPTARG
echo -e "# <atm_model> = $atm_model"
;;
b)
rig=true
rigididy=$OPTARG
echo -e "# <rigidity cutoff> = $rigididy"
;;
m)
lez=true
lowez=$OPTARG
echo -e "# <Low edge of zenith angle> = $lowez"
;;
n)
hez=true
highez=$OPTARG
echo -e "# <High edge of zenith angle> = $highez"
;;
r)
lppe=true
lowppe=$OPTARG
echo -e "# <Low primary particle energy> = $lowppe"
;;
i)
uppe=true
upperppe=$OPTARG
echo -e "# <High primary particle energy> = $upperppe"
;;
o)
BXcomp=true
BX=$OPTARG
echo -e "# <Horizontal comp. Earth's mag. field> = $BX"
;;
q)
BZcomp=true
BZ=$OPTARG
echo -e "# <Vertical comp. Earth's mag. field> = $BZ"
;;
e)
cta=true
echo -e "# Cherenkov mode enabled for = $site"
Expand Down Expand Up @@ -187,6 +243,46 @@ if [ "X$hig" == "X" ]; then
echo -e "# WARNING: High energy interaction model was not provided. Using default: $hig"
fi

if [ "X$atm_model" == "X" ]; then
atm_model="E1"
echo -e "# WARNING: Atmospheric Model was not provided. Using default: $atm_model"
fi

if [ "X$rigididy" == "X" ]; then
rigididy="0"
echo -e "# WARNING: Rigidity cutoff was not provided. Using default (disabled): $rigididy"
fi

if [ "X$lowez" == "X" ]; then
lowez="10"
echo -e "# WARNING: Low edge of zenith angle was not provided. Using default: $lowez"
fi

if [ "X$highez" == "X" ]; then
highez="80"
echo -e "# WARNING: High edge of zenith angle was not provided. Using default: $highez"
fi

if [ "X$lowppe" == "X" ]; then
lowppe="1e3"
echo -e "# WARNING: Low primary particle energy was not provided. Using default: $lowppe"
fi

if [ "X$upperppe" == "X" ]; then
upperppe="1e4"
echo -e "# WARNING: Low primary particle energy was not provided. Using default: $upperppe"
fi

if [ "X$BX" == "X" ]; then
BX="12.5"
echo -e "# WARNING: Horizontal comp. Earth's mag. field was not provided. Using default: $BX"
fi

if [ "X$BZ" == "X" ]; then
BZ="25.5"
echo -e "# WARNING: Vertical comp. Earth's mag. field was not provided. Using default: $BZ"
fi

if $debug; then
echo -e "# WARNING: You are running in DEBUG mode."
fi
Expand Down Expand Up @@ -243,6 +339,30 @@ fi
if $alt; then
options=${options}"-k $altitude "
fi
if $atm_m; then
options=${options}"-c $atm_model "
fi
if $rig; then
options=${options}"-b $rigididy "
fi
if $lez; then
options=${options}"-m $lowez "
fi
if $hez; then
options=${options}"-n $highez "
fi
if $lppe; then
options=${options}"-r $lowppe "
fi
if $uppe; then
options=${options}"-r $upperppe "
fi
if $BXcomp; then
options=${options}"-o $BX "
fi
if $BZcomp; then
options=${options}"-q $BZ "
fi
if $defaults; then
options=${options}"-x "
fi
Expand Down
4 changes: 2 additions & 2 deletions sims/generate_spectra.pl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ sub get {
-m Low edge of zenith angle (THETAP) [deg] (Default: 0)
-n High edge of zenith angle (THETAP) [deg] (Default: 90)
-r Lower limit of the primary particle energy (ERANGE) [GeV] (Default: 5e0)
-v Upper limit of the primary particle energy (ERANGE) [GeV] (Default: 1e6)
-i Upper limit of the primary particle energy (ERANGE) [GeV] (Default: 1e6)
Fix parameters for unknow sites:
-o <BX> Horizontal comp. of the Earth's mag. field (MAGNET) [North,muT], see values at http://www.ngdc.noaa.gov/geomagmodels/struts/calcIGRFWMM
-q <BZ> Vertical comp. of the Earth's mag. field (MAGNET) [downwards,muT], see values at http://www.ngdc.noaa.gov/geomagmodels/struts/calcIGRFWMM
Expand Down Expand Up @@ -222,7 +222,7 @@ sub get {
$llimit = $ARGV[0];
shift;
}
if (/-v$/i) {
if (/-i$/i) {
$ulimit = $ARGV[0];
shift;
}
Expand Down

0 comments on commit 2f388c9

Please sign in to comment.