Advertisement
didzislauva

Interpolate multiple maps and get some raster statistics

Dec 18th, 2012
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/sh
  2. #first array
  3. monthNamesAbr=(jan feb mar apr mai jun jul aug sep okt nov dec)
  4. #second array
  5. modelNames=(m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15 m16 m17 m18 m19)
  6.  
  7. #helper string
  8. periods1="fut"
  9.  
  10. for i in "${monthNamesAbr[@]}"  #outer loop over months
  11. do
  12.     for j in "${modelNames[@]}" #inner loop over models
  13.     do
  14.         v.surf.rst input=${i}_${periods1}_norm elev=${i}_${periods1}_norm_${j} --overwrite zcolumn=${j}
  15.         #line number 9 containts maximum of raster value.
  16.         r.univar map=${i}_${periods1}_norm_${j} |awk -v month=$i -v model=$j 'NR==9{
  17.         print month",",model,",",$0
  18.         }'>>maximum.txt
  19.     done    #end of inner loop
  20. done        #end of outer loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement