diff --git a/scripts/gamma-singleray.sh b/scripts/gamma-singleray.sh index ed39cb2..4cb1ca3 100755 --- a/scripts/gamma-singleray.sh +++ b/scripts/gamma-singleray.sh @@ -1,9 +1,9 @@ #!/bin/bash # set input/working/output folders -in=/Users/lorenzo/Desktop/scenario_001 -work=/Users/lorenzo/Desktop/scenario_001/tmp -out=/Users/lorenzo/Desktop/scenario_001/out +in=/Users/lorenzo/ITER/UL-Grant-161/QO-design/scenario1_scan_gamma +work=/Users/lorenzo/ITER/UL-Grant-161/QO-design/scenario1_scan_gamma/tmp +out=/Users/lorenzo/ITER/UL-Grant-161/QO-design/scenario1_scan_gamma/out # check if working folder exists, otherwise create it if [[ ! -e $work ]]; then @@ -31,7 +31,8 @@ else fi fi -listfile=$in/alpha-beta-vs-gamma.txt +listfile=$in/v0_22.txt +listbase=`basename ${listfile} .txt` # count number of lines in input file nlines=`wc -l $listfile | awk '{print $1}'` @@ -45,7 +46,7 @@ cp $eqfile ${base}.eqdsk cp $in/${base}.prf ${base}.prf # set output file names -id=${base}_8beams_gammascan +id=t${t}_scan_${listbase}_1ray f7file=$out/f7_${id}.txt f48file=$out/f48_${id}.txt rm -f $out/log_${id}.txt @@ -61,7 +62,10 @@ appendheader=0 #loop on lines of launching conditions table for (( iline=1; iline<=$nlines+1; iline++ )); do # search full, non-commented lines - awkcommand='NR=='$iline' && NF>=6 {print $1, $2, $3, $4, $5, $6}' +# table from MIRRORS +# awkcommand='NR=='$iline' && NF>=6 {print $1, $2, $3, $4, $5, $6}' +# table from AM + awkcommand='NR=='$iline' && NF>=6 {print $1, -$2, sqrt($5^2+$6^2), $7, $3, $4}' line=`sed 's/#.*$//' $listfile | awk "$awkcommand"` if (( `echo $line | wc -w`>0 )); then # if valid line extract values