INSFITSTACK

Fits a low order polynomial to a stack of multi-temporal data and generates the coefficient of determination.


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example

Back to top

Description


INSFITSTACK estimates and applies a user specified low order polynomial fit to a multi-temporal data stack. The input can be spatially averaged prior to estimating the polynomial. The temporal spacing of the output matches that of the input. The coefficient of determination is also written as the final layer.
Back to top

Parameters


insfitstack(fili, polyorder, flsz, filo)

Name Type Caption Length Value range
FILI * str Input stack file 1 -    
POLYORDER List[int] Order of Polynomial to be applied 0 - 1  
FLSZ List[int] Size of boxcar filter 0 - 2  
FILO * str Output stack file 1 -    

* Required parameter
Back to top

Parameter descriptions

FILI

Name of file containing temporally ordered, non-overlapping, displacement values.

POLYORDER

Order of polynomial to be used to calculate best fit value at time associated with input layer. This value must be greater than or equal to one.

FLSZ

This parameter specifies the boxcar filter size to be applied to the data prior to estimating the low order polynomial. • Blank will apply no filtering. • A single ODD integer will provide a boxcar filter of that size. • A pair of ODD integers will provide the boxcar filter size in the X and Y directions respectively.

FILO

Name to be given to the output file. The output channels are temporally and spatially aligned with the FILI input channels. Each pixel value is replaced with the value of the low order polynomial fit estimated from the input channel values at that pixel location. The last layer contains the coefficient of determination (R^2) value.

Back to top

Details

INSFITSTACK generates and applies a low order polynomial fit to each pixel at the temporal intervals given by the input file. Prior to generating the polynomial, the user can optionally apply a spatial boxcar filter. For each pixel, the coefficient of determination is written to the last channel. The coefficient of determination is an estimate of how well the original data fits the polynomial model and ranges from zero to one.

Back to top

Example

Generate and apply a second order polynomial to the input stack after applying a 7x7 boxcar filter.

from pci.insfitstack import insfitstack

fili	=	"insstackoutput.pix"
polyorder = [2]
flsz = [7]
filo	=	"FitData.pix"

insfitstack( fili, polyorder, flsz, filo )
    

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.