BEGIN {FS =" ";} {if (NR < 7)else {for (i =1;i <=NF ;i ++) {if ($i == "-9999")res =-9999;else if ($i <a )res =0;else res =1;printf "%s ",res ; }printf "\n "; } }
The script requires as a parameter a a threshold. Every value below this threshold is classified as 0 and every value above as 1. No data values (-9999) are not affected. Once the script is saved to reclass.awk, it can be calle with:
awk -v a =0.4 -f reclass .awk ingrid .asc >outgrid .asc
没有评论:
发表评论