---
name: "pkstatprofile"
section: "1"
platform: "linux"
package: "pktools"
version: "2.6.7.6+ds-6+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pkstatprofile"
---

# pkstatprofile(1)

program to calculate statistics in temporal or spectral profile

## NAME

pkstatprofile - program to calculate statistics in temporal or spectral profile

## SYNOPSIS

FC**pkstatprofile**F\[0\]  FC**-i**F\[0\] *input* FC**-o**F\[0\] *output* \[FC**-f**F\[0\] *function*\] \[*options*\]

## DESCRIPTION

**pkstatprofile** calculates statistics for a temporal (time series) or spectral profile.

| | |
| --- | --- |
| Function | Description |
| mean | calculate mean in window |
| median | perform a median filter in spatial (dx, dy) or spectral/temporal (dz) domain |
| var | calculate variance in window |
| stdev | calculate standard deviation in window |
| min | calculate minimum in window |
| max | calculate maximum in window |
| sum | calculate sum in window |
| mode | calculate mode of all values |
| ismin | 1 if value is minimum, else 0 |
| ismax | 1 if value is maximum, else 0 |
| per | calculate percentile in time series (provide percentage value as argument) |
| prop | calculate proportion |
| nvalid | report number of valid observations |

Calculate min and max NDVI in time series

```
FC
pkstatprofile -i modis_ndvi_2010.tif -o modis_stats_2010.tif -f min -f max
      F[0]
```

## OPTIONS

- FC**-i**F\[0\] *filename*, FC**--input**F\[0\] *filename*

  Input image file.

- FC**-o**F\[0\] *filename*, FC**--output**F\[0\] *filename*

  Output image file

- FC**-f**F\[0\] *function*, FC**--function**F\[0\] *function*

  Statistics function (mean, median, var, stdev, min, max, sum, mode (provide classes), ismin, ismax, proportion (provide classes), percentile, nvalid

- FC**-perc**F\[0\] *percentile*, FC**--perc**F\[0\] *percentile*

  Percentile value(s) used for rule percentile

- FC**-class**F\[0\] *class*, FC**--class**F\[0\] *class*

  class value(s) to use for mode, proportion

- FC**-nodata**F\[0\] *value*, FC**--nodata**F\[0\] *value*

  Set nodata value(s)

- FC**-ot**F\[0\] *type*, FC**--otype**F\[0\] *type*

  Data type for output image ({Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}). Empty string: inherit type from input image.

- FC**-of**F\[0\] *format*, FC**--oformat**F\[0\] *format*

  Output image format (see also [**gdal\_translate**(1)](/gdal_translate/1.md)).

- FC**-ct**F\[0\] *filename*, FC**--ct**F\[0\] *filename*

  Color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid). Use none to omit color table.

- FC**-co**F\[0\] *NAME=VALUE*, FC**--co**F\[0\] *NAME=VALUE*

  Creation option for output file. Multiple options can be specified.

- FC**-d**F\[0\] *value*, FC**--down**F\[0\] *value*

  Down sampling factor. Use value 1 for no downsampling. Use value n\>1 for downsampling (aggregation).

- FC**-v**F\[0\] *level*, FC**--verbose**F\[0\] *level*

  Verbose mode if \> 0
