Oft-ascstat.awk

From Open Foris Wiki

Jump to: navigation, search

oft-ascstat.awk computes basic statistics for a given input file or stdin.

Usage: oft-ascstat.awk [input_file]

Please not that the data must be provided as space separated!


Exercise:

1. Open your working directory using

cd /home/...

2. The script oft-ascstat.awk computes basic statistics for our space separate input file sample_landuse.txt:

head sample_landuse.txt
10557.00 772650.00 -2404770.00 5.00 53.00 26.00 28.00 54.00 81.00 131.00 39.00
94788.00 773490.00 -2431680.00 1.00 51.00 24.00 25.00 45.00 65.00 127.00 33.00
201536.00 774750.00 -2439390.00 1.00 54.00 25.00 27.00 50.00 71.00 130.00 35.00
88531.00 771450.00 -2431110.00 1.00 47.00 21.00 18.00 37.00 48.00 126.00 21.00
123374.00 774150.00 -2433990.00 1.00 54.00 24.00 30.00 35.00 75.00 132.00 42.00
97345.00 776220.00 -2431950.00 1.00 52.00 23.00 24.00 42.00 60.00 131.00 30.00
199041.00 773190.00 -2439120.00 1.00 51.00 23.00 23.00 52.00 58.00 130.00 28.00
144276.00 775860.00 -2435400.00 1.00 49.00 22.00 21.00 45.00 59.00 125.00 30.00
180961.00 772680.00 -2437890.00 1.00 49.00 21.00 21.00 36.00 61.00 126.00 28.00
185386.00 772410.00 -2438190.00 1.00 49.00 21.00 18.00 43.00 51.00 126.00 22.00

Explanation of the columns: pixel_id x y class band1 band2 band3 band4 band5 band6 band7


3. Lets run oft-ascstat.awk

oft-ascstat.awk sample_landuse.txt

Result is printed on screen:

           Col             Min             Max             Avg             Std
             1     4923.000000   220664.000000   116318.433333     6345.839056
             2   736440.000000   787020.000000   771921.000000      798.104655
             3 -2448000.000000 -2403090.000000 -2431097.666667     1035.677643
             4        1.000000       25.000000        2.844444        0.519269
             5       44.000000       69.000000       53.455556        0.491606
             6       19.000000       37.000000       24.822222        0.383203
             7       16.000000       48.000000       27.022222        0.691350
             8       34.000000       62.000000       46.744444        0.711611
             9       42.000000      103.000000       69.455556        1.450889
            10      124.000000      136.000000      129.433333        0.252272
            11       15.000000       64.000000       34.111111        1.013162
          

Explanation of the columns same as before: pixel_id x y class band1 band2 band3 band4 band5 band6 band7

And of course the interesting lines are line 4-11.



Back to Open Foris Toolkit Main Page

Back to Tools & Exercises



Personal tools