From 9aa699dd679f34138e55b628c4001e3589a8acb1 Mon Sep 17 00:00:00 2001 From: Daniela Farina Date: Fri, 13 Jul 2012 16:24:30 +0000 Subject: [PATCH] added gnuplot and bash scripts --- scripts/beta-alpha.sh | 20 ++++++++++---------- scripts/icd-cnt.gnu | 31 ++++++++++++++----------------- scripts/icd-rho.gnu | 25 +++++++++++++------------ scripts/t-alpha.sh | 10 +++++----- 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/scripts/beta-alpha.sh b/scripts/beta-alpha.sh index 9f3fdce..687cb7d 100755 --- a/scripts/beta-alpha.sh +++ b/scripts/beta-alpha.sh @@ -1,9 +1,9 @@ #!/bin/bash # set input/working/output folders -in=/Users/lorenzo/Desktop/files5s -work=/Users/lorenzo/Desktop/tmp2 -out=/Users/lorenzo/Desktop/out +in=/Users/daniela/Desktop/scenario_001/files5s +work=/Users/daniela/Desktop/scenario_001/tmpab +out=/Users/daniela/Desktop/scenario_001/outab # launching mirrors mirror=( "USM" "LSM" ) @@ -11,10 +11,10 @@ r0=( 699.871 705.392 ) z0=( 441.441 417.821 ) # steering range -amin=25 +amin=20 amax=70 -bmin=10 -bmax=30 +bmin=16 +bmax=26 # check if working folder exists, otherwise create it if [[ ! -e $work ]]; then @@ -65,9 +65,9 @@ for i in 0 1; do echo "# =============================" >> $f7file appendheader=0 #loop on beta - for (( beta=$bmin; beta<=$bmax ; beta=beta+1 )); do + for (( beta=$bmin; beta<=$bmax ; beta=beta+2 )); do #loop on alpha - for (( alpha=$amin; alpha<=$amax ; alpha=alpha+1 )); do + for (( alpha=$amin; alpha<=$amax ; alpha=alpha+2 )); do # replace dummy values in template for gray.data sed "s/-alfa-/$alpha/g; \ s/-beta-/$beta/g; \ @@ -80,7 +80,7 @@ for i in 0 1; do if (( $appendheader==0 )); then # append parameters to header if first run of the loop cat headers.txt >> $f7file - echo "# beta alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file + echo "#beta alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file appendheader=1 fi # add time and alpha values in first two columns @@ -96,4 +96,4 @@ done # remove files from working folder rm ${base}.eqdsk ${base}.prf fort.* -#EOF \ No newline at end of file +#EOF diff --git a/scripts/icd-cnt.gnu b/scripts/icd-cnt.gnu index b37b86a..7e7e082 100644 --- a/scripts/icd-cnt.gnu +++ b/scripts/icd-cnt.gnu @@ -11,15 +11,15 @@ unset hidden set contour base set isosamples 200,200 -dir='../EL_data/' -id1='sc9MA' -id2='bot12co' -fn='f7.'.id1.'_'.id2.'.txt' +dir='/Users/daniela/Desktop/scenario_001/outab/' +id1='LSM' +id2='520' +fn='f7_'.id1.'_t'.id2.'.txt' lab1=id1 -lab2=id2 +lab2='t='.id2.'s' -xi=10; xa=45 -yi=-40; ya=40 +xi=16; xa=26 +yi=20; ya=70 xl = xi + 0.1*(xa - xi); xh = xa - 0.1*(xa-xi); yl = yi + 0.1*(ya - yi); yh = ya - 0.1*(ya-yi); xtoy = (xa-xi) / (ya-yi) @@ -33,8 +33,8 @@ SEARCH = "filecontour index b using 1:(g($1,$2))" PLOT = "filecontour index b using 1:(f($1,$2)) w l lt 1 lc rgb 'black' lw 2" LABEL = "filecontour index b using 1:2:(lab($1,$2)) with labels font 'Helvetica, 16'" -i0=60 -di=10 +i0=25 +di=2.5 imax=i0 set xrange [xi:xa] set yrange [yi:ya] reverse @@ -46,7 +46,7 @@ set cntrparam levels incremental 0,0.2,1.0 filecontour = "contours.dat" set table filecontour -splot dir.fn u (abs($2)):3:($5>=0.95?$10:1/0) +splot dir.fn u 1:2:($4>=0.95 ?$8:1/0) unset table set lmargin at screen 0.15 @@ -59,7 +59,7 @@ set multiplot unset border set xtics offset 0,0.3 #set xlabel "{/Symbol b} (º)" offset 0,0.8 -set xlabel "{/Symbol |b|} (º)" offset 0,0.8 +set xlabel "{/Symbol b} (º)" offset 0,0.8 set ytics offset 0,0 set ylabel "{/Symbol a} (º)" offset 0,0 set colorbox user origin 0.80,0.12 size 0.05,0.78 vertical @@ -68,16 +68,14 @@ set mcbtics 2 set cblabel "{/Symbol |}I_{cd}{/Symbol |} (kA/MW)" offset 0,0 set clabel set cntrparam levels incremental -i0,di/5.,i0 -splot dir.fn u (abs($2)):3:($5>=0.95 && abs($4)>1 ?abs($4):1/0) w l lt 1 lc palette lw 1 +splot dir.fn u 1:2:($4>=0.95? abs($3):1/0) w l lt 1 lc palette lw 1 unset xtics; unset mxtics; unset xlabel unset ytics; unset mytics; unset ylabel unset colorbox set cntrparam levels incremental -i0,di,i0 set border -splot dir.fn u (abs($2)):3:($5>=0.95 && abs($4)>1 ?abs($4):1/0) w l lt 1 lc palette lw 2 -#set cntrparam levels incremental -i0,2*di,i0 -#splot dir.fn u (abs($2)):3:($5>=0.95 && abs($4)>1 ?abs($4):1/0) w l lt 1 lc palette lw 3 +splot dir.fn u 1:2:($4>=0.95? abs($3):1/0) w l lt 1 lc palette lw 2 filecontour = "contours.dat" b = 0 @@ -91,14 +89,13 @@ plot \ @SEARCH, @PLOT, @LABEL, @ZERO, \ @SEARCH, @PLOT, @LABEL, @ZERO, \ @SEARCH, @PLOT, @LABEL, @ZERO, \ -@SEARCH, @PLOT, @LABEL, @ZERO, \ @SEARCH, @PLOT, @LABEL set cntrparam levels discrete 0.05,0.1,0.15,0.25,0.3,0.35,0.45,0.5,0.55,0.65,0.7,0.75,0.85,0.9,0.95 unset clabel set border set label 1 lab1 left at screen 0.15,0.94 set label 2 lab2 right at screen 0.76,0.94 -splot dir.fn u (abs($2)):3:($5>=0.95 && abs($4)>1 ?$10:1/0) w l lt 1 lc rgb 'black' lw 1 +splot dir.fn u 1:2:($4>=0.95 ?$8:1/0) w l lt 1 lc rgb 'black' lw 1 unset label 1 unset label 2 diff --git a/scripts/icd-rho.gnu b/scripts/icd-rho.gnu index d274510..e480d03 100755 --- a/scripts/icd-rho.gnu +++ b/scripts/icd-rho.gnu @@ -1,27 +1,28 @@ set term aqua enhanced font "Helvetica, 20" -id1='sc15MA' -id2='mid12co' -#dir=id.'/' -dir='../EL_data/' -fn='f7.'.id1.'_'.id2.'.txt' -set title id1."- mid row co" +dir='/Users/daniela/Desktop/scenario_001/outu/' +id1='USM' +id2='18' +fn='f7_'.id1.'_'.id2.'.txt' +set title id1."-".id2 -al=0 +#bt=20 #USM +bt=18 #LSM set xrange[0:1] set yrange[*:*] -set ytics 10 +set ytics 5 set xlabel "{/Symbol r}" -set ylabel "I_{cd} (kA/MW)" +set ylabel "-I_{cd} (kA/MW)" unset key set style line 1 lt 1 lc rgb "red" lw 1 set style line 2 lt 2 lc rgb "red" lw 1 set style line 3 lt 1 lc rgb "blue" lw 1 set style line 4 lt 2 lc rgb "blue" lw 1 - -plot dir.fn u 10:($8>0 && $5>=0.95 && (abs($4))>1 ? (abs($4)):1/0) w l ls 1, dir.fn u 10:($8<0 && $5>=0.95 && (abs($4))>1? (abs($4)):1/0) w l ls 2,\ -dir.fn u 10:($3==al && $5>=0.95 ? (abs($4)):1/0) w p pt 7 lc rgb "black" +plot dir.fn u 8:($4>=0.95? (-$3):1/0) w l ls 1 +#plot dir.fn u 8:($4>=0.95? (-$3):1/0) w p pt 7 lc rgb "red" +#plot dir.fn u 8:($4>=0.95? (-$3):1/0) w lp ls 1,\ +#dir.fn u 8:($1==bt && $4>=0.95 ?(abs($3)):1/0) w p pt 7 lc rgb "red" set term postscript eps enhanced font "Helvetica, 20" set termoption dash diff --git a/scripts/t-alpha.sh b/scripts/t-alpha.sh index 79db60c..356435a 100755 --- a/scripts/t-alpha.sh +++ b/scripts/t-alpha.sh @@ -1,9 +1,9 @@ #!/bin/bash # set input/working/output folders -in=/Users/lorenzo/Desktop/files5s -work=/Users/lorenzo/Desktop/tmp -out=/Users/lorenzo/Desktop/out +in=/Users/daniela/Desktop/scenario_001/files5s +work=/Users/daniela/Desktop/scenario_001/tmp +out=/Users/daniela/Desktop/scenario_001/out # launching mirrors mirror=( "USM" "LSM" ) @@ -78,7 +78,7 @@ for i in 0 1; do if (( $appendheader==0 )); then # append parameters to header if first run of the loop cat headers.txt >> $f7file - echo "# t alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file + echo "#t alpha`head -n 1 fort.7 | sed 's/#//'`" >> $f7file appendheader=1 fi # add time and alpha values in first two columns @@ -91,4 +91,4 @@ for i in 0 1; do done done -#EOF \ No newline at end of file +#EOF