Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #string with month names
- IN="oktobris;novembris;decembris;janvaris;februaris;marts;aprilis;maijs;junijs;julijs;augusts;septembri"
- #create an array splitting the string by ";"
- arr=$(echo $IN | tr ";" "\n")
- #-----boolean switches ------
- #switch for interpolation on
- #or off
- #interpSwitch=0
- interpSwitch=1
- statisticSwitch=1
- #----------------------------
- #----------INTERPOLATING----------
- #if switch is "on"
- if [ "$interpSwitch" = 1 ]; then
- #iterate over an array
- for x in $arr
- do
- v.surf.idw input=vectorMapWithColumnsWithMonthlyData output=rasterMap_$x npoints=12 power=2 column=$x --o
- done
- fi
- #---------------------------------
- #----------STATISTICS--------------
- if [ "$statisticSwitch" = 1 ]; then
- #delete possibly previously created
- rm W:/scripts/output.txt
- #iterate over an array
- for x in $arr
- do
- #r.univar results are plain text which could be pipelined to awk
- #splitting and getting exact information from r.univar text output. and
- #finally writed in file. Each time element from the array are "catched" inside the awk as
- #a command line parameter and is used as the heading for each following statistics
- r.univar map=REF_rel_GW_unc83_$x | awk -v x="$x" 'BEGIN {printf "\r\n" x "\r\n" >> "W:/scripts/output.txt"} NR>6{split($0,a,":"); printf $0 "\r\n" >> "W:/scripts/output.txt"}'
- echo "$x"
- done
- fi
- #-----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement