# Oft-mm

Computes minimum and maximum values for each band of the input file

For the input image, the command provides inline minimum and maximum values per band.

Option:

```-um maskfile = zero values in the maskfile will be excluded in the calculation
(maskfile extent must match inputfile extent)
```

Example:

```oft-mm input.tif
```

## Exercise:

1. Open your working directory using

```cd /home/...
```

2. Now we run oft-mm with images/landsat-t1.tif as input

```oft-mm images/landsat-t1.tif
```

3. The output will be printed in the terminal:

```argc 2
Driver: GTiff/GeoTIFF
Size is 3000, 3500
Corner Coordinates:
Upper Left  (  729285.000,-2352885.000) ( 60d47'25.21"W, 21d15'47.65"S)
Lower Left  (  729285.000,-2457885.000) ( 60d46'32.84"W, 22d12'40.25"S)
Upper Right (  819285.000,-2352885.000) ( 59d55'25.68"W, 21d14'58.71"S)
Lower Right (  819285.000,-2457885.000) ( 59d54'12.84"W, 22d11'48.91"S)
Center      (  774285.000,-2405385.000) ( 60d20'54.26"W, 21d43'50.98"S)
Done
Band 1 min = 20.000000
Band 1 max = 255.000000
Band 2 min = 1.000000
Band 2 max = 255.000000
Band 3 min = 1.000000
Band 3 max = 208.000000
Band 4 min = 8.000000
Band 4 max = 255.000000
Band 5 min = 5.000000
Band 5 max = 255.000000
Band 6 min = 112.000000
Band 6 max = 195.000000
Band 7 min = 1.000000
Band 7 max = 255.000000
DoneClose
```

4. If you are only interested in the min and max values for a certain band, you can use the grep command. Example for band 1:

```oft-mm images/landsat_t1.tif |grep "Band 1"
```
```Band 1 min = 20.000000
Band 1 max = 255.000000
```