Skip to content

i.spectral

Displays spectral response at user specified locations in group or images.

i.spectral [-cgt] [group=name] [subgroup=name] [raster=name [,name,...]] coordinates=east,north [,east,north,...] [output=name] [format=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

i.spectral coordinates=east,north

grass.script.run_command("i.spectral", group=None, subgroup=None, raster=None, coordinates, output=None, format="png", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("i.spectral", coordinates=east,north)

Parameters

group=name
    Name of input imagery group
subgroup=name
    Name of input imagery subgroup
raster=name [,name,...]
    Name of input raster map(s)
coordinates=east,north [,east,north,...] [required]
    Coordinates
output=name
    Name for output image is valid for -g (or text file for -t flag)
format=string
    Graphics format for output file (valid for -g flag)
    Allowed values: png, eps, svg
    Default: png
-c
    Show sampling coordinates instead of numbering in the legend (valid for -g flag)
-g
    Use gnuplot for display
-t
    output to text file
--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

group : str, optional
    Name of input imagery group
    Used as: input, group, name
subgroup : str, optional
    Name of input imagery subgroup
    Used as: input, subgroup, name
raster : str | list[str], optional
    Name of input raster map(s)
    Used as: input, raster, name
coordinates : list[tuple[float, float]] | tuple[float, float] | list[float] | str, required
    Coordinates
    Used as: input, coords, east,north
output : str, optional
    Name for output image is valid for -g (or text file for -t flag)
    Used as: output, file, name
format : str, optional
    Graphics format for output file (valid for -g flag)
    Allowed values: png, eps, svg
    Default: png
flags : str, optional
    Allowed values: c, g, t
    c
        Show sampling coordinates instead of numbering in the legend (valid for -g flag)
    g
        Use gnuplot for display
    t
        output to text file
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

i.spectral displays spectral response at user specified locations in images.

NOTES

This script requires the launch of one of the supported monitors (cairo, png, ps) or gnuplot to be installed.

EXAMPLE

Analysis of LANDSAT TM7 channels (North Carolina dataset):

g.region raster=lsat7_2002_10 -p
i.spectral -g raster=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
           coordinates=636069,215440,637958,223393,633277,223605

Spectral plot of 3 different land cover types
Spectral plot of 3 different land cover types: (1) water, (2) green vegetation, and (3) highway

North Carolina sample dataset:

g.region raster=lsat7_2002_10 -p
LIST=`g.list type=raster pattern="lsat7_2002_[1-5,7]0" separator=","`
d.mon start=cairo output=plot.png
i.spectral raster=$LIST coordinates=637502.25,221744.25
d.mon stop=cairo

This will search all LANDSAT map for 2002 but select only the B, G, R, NIR, and MIR channels.

SEE ALSO

d.where, r.what, Cairo driver, PNG driver, PS driver (Postscript)

AUTHORS

Markus Neteler
Francesco Pirotti

SOURCE CODE

Available at: i.spectral source code (history)
Latest change: Friday Mar 07 23:20:43 2025 in commit b94776a