Transformation - InterpolationSerial Linear
schema: | |
keywords: | transformation, interpolation |
Description and usage
This transformation function is used to fill inner gaps in a time series. The inner gaps are filled with linearly interpolated data values.
A gap is defined as a number of consecutive values that are unreliable or missing. An inner gap is defined as a gap for which there is at least one reliable or doubtful value before the gap and at least one reliable or doubtful value after the gap. This function fills only inner gaps.
Each inner gap is filled using linear interpolation between the value just before the gap and the value just after the gap.
This function has an option to define the maximum length of the gaps that should be filled. Gaps that are equal to or smaller than the defined maximum gap length will be filled with interpolated values. Gaps that are larger than the defined maximum gap length will not be filled.
The interpolation serial transformation also has the possibility to configure a custom flagSource to be assigned to a flagSourceColumn for interpolated values.
Input/Output time series
In this function one input time series and one output time series must be identified.
- inputVariable: A time series with input values. This will typically contain inner gaps.
- outputVariable: A time series in which the output will be stored. The output series will contain all input values and the inner gaps will be filled.
The in- and output time series may be of the type coverage, where each timestep is represented by a grid coverage, in this case coverages that are missing for a specific timestep will be created by interpolation of the previous and next available coverage. Optionally, you can enable interpolation of missing pixels within the coverages by specifying the option <interpolateGrids> as true.
Configuration
A basic configuration of the function is described below. This describes the main elements and attributes required and provides an example configuration.
inputVariable
Required element defining the identifier of the input time series with input values. This Id must reference a valid input time series.
outputVariable
Required element defining the identifier of the output time series with output values. This Id must reference a valid output time series.
maxGapLength
Optional element defining the maximum length of gaps that should be filled. The length is equal to the number of time steps. Gaps equal to or smaller than maxGapLength will be filled with interpolated values. Gaps larger than maxGapLength will not be filled. If maxGapLength is not defined (the default), then all gaps will be filled with interpolated values.
interpolateMissingGridCells
Since 2022.01: Optional element that can be set to 'true' to enable the interpolation of missing grid cells (pixels) for grid coverage time series (default is false). When using this option it is recommended to specify the maxGapLength as the default maxGapLength value of 1 time step will be used otherwise. Note that this default behavior is different from the standard maxGapLength default behavior explained, in order to prevent excessive memory use for this interpolation.
outputCustomFlagSourceId
Optional element to define what customFlagSource should be written to the flagSourceColumn (defined in the workflow file) for interpolated values. The customFlagSourceId should be configured in CustomFlagSources configuration file.
outputComment if outputCustomFlagSourceId is being used, then the outputComment is added for the missing values. For the available values, the input comments would be used.
Example
<transformation id="interpolation serial linear"> <interpolationSerial> <linear> <inputVariable> <variableId>input</variableId> </inputVariable> <maxGapLength>5</maxGapLength> <interpolateMissingGridCells>false</interpolateMissingGridCells> <outputVariable> <variableId>output</variableId> </outputVariable> <outputComment>outputCommentTest</outputComment> <outputCustomFlagSourceId>INTP</outputCustomFlagSourceId> </linear> </interpolationSerial> </transformation>
Common issues
None reported.