i.band.library(1grass)

i.band.library πŸ’–βœ¨

okay bestie, this is the GRASS manual page for i.band.library, straight out of the GRASS User's Manual. It's a little tool that prints the semantic label info used for multispectral data. Sensor lore, band lore, registry files β€” the whole vibe. Let's get into it πŸ¦‹

Keywords: general, imagery, semantic label, image collections 🌈


✨ SYNOPSIS ✨

i.band.library
i.band.library --help
i.band.library [-e]  [pattern=string]   [operation=string]   [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags

  • -e β€” print extended metadata information πŸ‘‘
  • --help β€” print usage summary
  • --verbose β€” verbose module output
  • --quiet β€” quiet module output 🀫
  • --ui β€” force launching GUI dialog

🌸 Parameters

  • pattern=string β€” semantic label search pattern (examples: L, S2, .*_2, S2_1)
  • operation=string β€” operation to be performed. Options: print. Default: print

πŸ’… DESCRIPTION

So, i.band.library prints the available band information for the multispectral data that GRASS has defined. By default these multispectral sensors are the ones supported β€” and heads up, other band reference registry files can totally be added, more on that below 🫢

Generic multispectral system:

  • gen_r Visible red
  • gen_g Visible green
  • gen_b Visible blue
  • gen_pan Visible panchromatic
  • gen_nir Near infrared

Landsat-5:

  • L5_1 Visible (Blue)
  • L5_2 Visible (Green)
  • L5_3 Visible (Red)
  • L5_4 Near-Infrared
  • L5_5 Short-wave infrared
  • L5_6 Thermal
  • L5_7 Short-wave infrared

Landsat-7:

  • L7_1 Visible (Blue)
  • L7_2 Visible (Green)
  • L7_3 Visible (Red)
  • L7_4 Near-Infrared
  • L7_5 Near-Infrared
  • L7_6 Thermal
  • L7_7 Mid-Infrared
  • L7_8 Panchromatic

Landsat-8:

  • L8_1 Visible (Coastal/Aerosol)
  • L8_2 Visible (Blue)
  • L8_3 Visible (Green)
  • L8_4 Visible (Red)
  • L8_5 Near-Infrared
  • L8_6 SWIR 1
  • L8_7 SWIR 2
  • L8_8 Panchromatic
  • L8_9 Cirrus
  • L8_10 TIRS 1
  • L8_11 TIRS 1

Sentinel-2:

  • S2_1 Visible (Coastal/Aerosol)
  • S2_2 Visible (Blue)
  • S2_3 Visible (Green)
  • S2_4 Visible (Red)
  • S2_5 Vegetation Red Edge 1
  • S2_6 Vegetation Red Edge 2
  • S2_7 Vegetation Red Edge 3
  • S2_8 Near-Infrared
  • S2_8A Narrow Near-Infrared
  • S2_9 Water vapour
  • S2_10 SWIR - Cirrus
  • S2_11 SWIR 1
  • S2_12 SWIR 2

The band references that get printed can be filtered by a search pattern β€” or by a fully defined band reference identifier β€” which you hand over with the pattern option. For the pattern syntax, go peek at the Python regular expression operations documentation. And by default? i.band.library prints all the available band references. No filtering, all vibes πŸ¦‹

Extended metadata (think central wavelength, spatial resolution, etc.) only shows up when you pass the -e flag. Periodt.

🧚 Band reference and semantic label relation

Band references are a special case β€” a subset, if you will β€” of semantic labels. Any string can be a semantic label, but strings that identify specific remote sensing platform bands (= band references) can have extra metadata managed by i.band.library. And a specific band reference can be assigned to a raster map as a semantic label by the r.semantic.label or r.support modules πŸ’œ


🌟 NOTES

The whole semantic label concept is supported by temporal GRASS modules β€” go look at t.register, t.rast.list, t.info and t.rast.mapcalc for examples, iykyk.

🌈 Image collections

Image collections are the common data type for referencing time series of multi band data. It's used in so many frameworks (Google Earth Engine API, for example) to address multi spectral satellite image series. GRASS basically supports a multi-band raster layer approach with the imagery group concept (i.group). And a new semantic label concept is designed specifically to support image collections in GRASS πŸ’«

πŸ“ Band reference registry files

Band reference information lives in JSON files with a pre-defined internal data structure. Here's a minimalistic example:

{
    "Sentinel2": {
        "description": "The Sentinel-2 A/B bands",
        "shortcut": "S2",
        "instruments": "MultiSpectral Instrument (MSI) optical and infrared",
        "launched": "23 June 2015 (A); 07 March 2017 (B)",
        "source": "https://sentinel.esa.int/web/sentinel/missions/sentinel-2",
        "bands": {
            "1": {
                "Sentinel 2A" : {
                    "central wavelength (nm)": 443.9,
                    "bandwidth (nm)": 27
                },
                "Sentinel 2B" : {
                    "central wavelength (nm)": 442.3,
                    "bandwidth (nm)": 45
                },
                "spatial resolution (meters)": 60,
                "tag": "Visible (Coastal/Aerosol)"
            },
            "2": {
                "Sentinel 2A" : {
                    "central wavelength (nm)": 496.6,
                    "bandwidth (nm)": 98
                },
                "Sentinel 2B" : {
                    "central wavelength (nm)": 492.1,
                    "bandwidth (nm)": 98
                },
                "spatial resolution (meters)": 10,
                "tag": "Visible (Blue)"
            }
        }
    }
}

Each series starts with a unique identifier ("Sentinel2" in the example above). Only two attributes are required: a shortcut and bands. And note β€” a shortcut must be unique across all band reference registry files, no duplicates allowed bestie πŸ’…

The number of other attributes isn't defined or even limited (in that example above, only the description and instruments attributes are defined). The list of bands is defined by a bands attribute, and each band is defined by an identifier ("1", "2" in the example above). The list of attributes describing each band isn't pre-defined or limited either. In the example, each band is described by a central wavelength (nm), bandwidth (nm), and a tag ✨

A band reference identifier defined by the pattern option is given by a shortcut β€” that's how you print band reference information for the whole series β€” or by a specific shortcut_band identifier.

System-defined registry files live in the GRASS installation directory ($GISBASE/etc/i.band.library). And note: currently i.band.library only allows managing system-defined registry files. Support for user-defined registry files is planned to be implemented β€” check the KNOWN ISSUES section for details πŸ‘€


πŸ”₯ EXAMPLES πŸ”₯

i.band.library
S2_1 Visible (Coastal/Aerosol)
S2_2 Visible (Blue)
...
L7_1 Visible (Blue)
L7_2 Visible (Green)
...
L8_1 Visible (Coastal/Aerosol)
L8_2 Visible (Blue)
...

The module prints band reference and related tag if defined πŸ’–

✨ Filter band references by a shortcut

Only band identifiers related to the Sentinel-2 satellite will be printed:

i.band.library pattern=S2
S2_1 Visible (Coastal/Aerosol)
...
S2_12 SWIR 2

✨ Filter band references by a regular expression

Print all available 2nd bands:

i.band.library pattern=.*_2
S2_2 Visible (Blue)
L7_2 Visible (Green)
L8_2 Visible (Blue)
...

Extended metadata related to the first band of the Sentinel-2 satellite will be printed:

i.band.library -e pattern=S2_1
description: The Sentinel-2 A/B bands
shortcut: S2
instruments: MultiSpectral Instrument (MSI) optical and infrared
launched: 23 June 2015 (A); 07 March 2017 (B)
source: https://sentinel.esa.int/web/sentinel/missions/sentinel-2
    band: 1
        Sentinel 2A:
                central wavelength (nm): 443.9
                bandwidth (nm): 27
        Sentinel 2B:
                central wavelength (nm): 442.3
                bandwidth (nm): 45
        spatial resolution (meters): 60
        tag: Visible (Coastal/Aerosol)

πŸ’€ KNOWN ISSUES

ngl, i.band.library currently has very limited functionality. Only system-defined band references are supported. The final implementation will support managing (add, modify, delete) user-defined band references. It's giving "coming soon" 😭

Also, only a very limited number of band references is currently defined β€” namely Sentinel-2, Landsat7, and Landsat8 satellites. This will be improved in the near future πŸ™ˆ


🌈 REFERENCES

  • Google Earth Engine API

🫢 SEE ALSO

r.semantic.label, r.info


πŸ‘‘ AUTHORS

Martin Landa

Development sponsored by mundialis GmbH & Co. KG (for the openEO EU H2020 grant 776242) πŸ’–


🌸 SOURCE CODE

Available at: i.band.library source code (history)

Latest change: Friday Aug 08 09:39:19 2025 in commit: ed72c71d8580e872cd6fd345c84a15c324764465

Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page bestie, no cap πŸ’… ok so the sign-off: this whole thing is Β© 2003-2026 GRASS Development Team, straight from the GRASS 8.5.0 Reference Manual, and yeah the footer says GRASS 8.5.0 too β€” slay, go filter some bands πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from