Skip to content

r.series.interp

Interpolates raster maps located (temporal or spatial) in between input raster maps at specific sampling positions.

r.series.interp [input=name [,name,...]] [datapos=float [,float,...]] [infile=name] [output=name [,name,...]] [samplingpos=float [,float,...]] [outfile=name] [method=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.series.interp

grass.script.run_command("r.series.interp", input=None, datapos=None, infile=None, output=None, samplingpos=None, outfile=None, method="linear", overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.series.interp")

Parameters

input=name [,name,...]
    Name of input raster map(s)
datapos=float [,float,...]
    Data point position for each input map
infile=name
    Input file with one input raster map name and data point position per line, field separator between name and sample point is |
output=name [,name,...]
    Name for output raster map
samplingpos=float [,float,...]
    Sampling point position for each output map
outfile=name
    Input file with one output raster map name and sample point position per line, field separator between name and sample point is |
method=string
    Interpolation method, currently only linear interpolation is supported
    Allowed values: linear
    Default: linear
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str | list[str], optional
    Name of input raster map(s)
    Used as: input, raster, name
datapos : float | list[float] | str, optional
    Data point position for each input map
infile : str, optional
    Input file with one input raster map name and data point position per line, field separator between name and sample point is |
    Used as: input, file, name
output : str | list[str], optional
    Name for output raster map
    Used as: output, raster, name
samplingpos : float | list[float] | str, optional
    Sampling point position for each output map
outfile : str, optional
    Input file with one output raster map name and sample point position per line, field separator between name and sample point is |
    Used as: input, file, name
method : str, optional
    Interpolation method, currently only linear interpolation is supported
    Allowed values: linear
    Default: linear
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.series.interp interpolates new raster maps located temporal or spatial in between existing raster maps. The interpolation is performed at specific sampling positions. The sampling position for each output map must be specified, as well as the data position of the input maps. The following interpolation methods are supported.

  • linear: Linear interpolation. At least two input maps and data positions are required.

EXAMPLES

Interpolate linear three new maps at 3 sampling positions in the interval (0.0;1.0)
First prepare the input maps:

g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3

r.mapcalc expr="prec_1 = 100"
r.mapcalc expr="prec_5 = 500"

Interpolate

r.series.interp --v input=prec_1,prec_5 datapos=0.0,1.0 \
                  output=prec_2,prec_3,prec_4 samplingpos=0.25,0.5,0.75 \
                  method=linear

Interpolate using the file option. First prepare the input file:

echo "prec_2|0.25
prec_3|0.5
prec_4|0.75" >> outfile.txt

Interpolate:

r.series.interp --v input=prec_1,prec_5 datapos=0.0,1.0 file=outfile.txt method=linear

The resulting maps will have the values 200, 300 and 400.

SEE ALSO

g.region, r.series, r.series.accumulate

Hints for large raster data processing

AUTHOR

Sören Gebbert

SOURCE CODE

Available at: r.series.interp source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f