r.jpdf
From two series of input raster maps, calculates the joint probability function and outputs the probabilities of occurrence in the specified bins.
r.jpdf [-q] output=name input1=string [,string,...] input2=string [,string,...] bins1=string [,string,...] bins2=string [,string,...] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
r.jpdf output=name input1=string input2=string bins1=string bins2=string
grass.script.run_command("r.jpdf", output, input1, input2, bins1, bins2, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("r.jpdf", output="name", input1="string", input2="string", bins1="string", bins2="string")
Parameters
output=name [required]
Prefix of output raster name, will be followed by bin numbers
input1=string [,string,...] [required]
First set of input rasters
input2=string [,string,...] [required]
Second set of input rasters
bins1=string [,string,...] [required]
Start value, end value, and number of bins for first independent variable (from first set of inputs)
bins2=string [,string,...] [required]
Start value, end value, and number of bins for second independent variable (from second set of inputs)
-q
Run quietly
--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
output : str, required
Prefix of output raster name, will be followed by bin numbers
Used as: output, raster, name
input1 : str | list[str], required
First set of input rasters
input2 : str | list[str], required
Second set of input rasters
bins1 : str | list[str], required
Start value, end value, and number of bins for first independent variable (from first set of inputs)
bins2 : str | list[str], required
Start value, end value, and number of bins for second independent variable (from second set of inputs)
flags : str, optional
Allowed values: q
q
Run quietly
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.jpdf reads two series of raster maps and calculates for each raster cell the joint probability density function of the two input series. The output is set of raster maps, each containing the probability within a range of values from the first set and a range from the second set. NULL values are ignored when calculating the JPDF.
The number of output raster maps is determined by the number of "bins" specified by the user using the parameters input1 and input2. The users gives the range and density of bins with input1=Start1,End1,Nbins1 input2=Start2,End2,Nbins2. In this case the data from the first data set will be assigned to Nbins1 intervals between Start1 and End1 and Nbins2 intervals between Start2 and End2 for the second data set. In addition, r.jpdf will calculate extra bins for values below or above the start and end values given by the user. In total, the output will consist of (Nbins1+2)×(Nbins2+2) raster maps. The naming of the output rasters is Prefix_N1_N2 where Prefix is given by the parameter output. N1 and N2 may contain leading zeros.
NOTES
Input series of different lengths
Rasters from the two series of input data will be compared in the order in which they appear in the two lists. If one list is longer than the other, the trailing raster maps will be ignored.
Memory consumption
The (Nbins1+2)×(Nbins2+2) raster maps are held in memory until the end of the processing. On the other hand, only one raster from each of the two series of input rasters will be held in memory.
EXAMPLES
Using r.jpdf with wildcards:
r.series input1="`g.list pattern='temperature*' sep=,`" input2="`g.list pattern='pressure*' sep=,`"\
output=jpdf_temp_pres bins1=-20,40,10 bins2=950,1030,10
Note the g.list script also supports regular expressions for selecting map names.
SEE ALSO
g.list, g.region, r.quantile, r.series.accumulate, r.series.interp, r.univar
Hints for large raster data processing
AUTHOR
Thomas Huld
SOURCE CODE
Available at: r.jpdf source code
(history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819