g.bands.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <h2>DESCRIPTION</h2>
  2. <em>g.bands</em> prints available band references information of multispectral data
  3. defined by GRASS GIS. The following multispectral sensors are supported
  4. by default (other band reference registry files can be added, see below):
  5. <p>
  6. Generic multispectral system:
  7. <ul>
  8. <li>gen_r Visible red</li>
  9. <li>gen_g Visible green</li>
  10. <li>gen_b Visible blue</li>
  11. <li>gen_pan Visible panchromatic</li>
  12. <li>gen_nir Near infrared</li>
  13. </ul>
  14. <p>
  15. Landsat-5:
  16. <ul>
  17. <li>L5_1 Visible (Blue)</li>
  18. <li>L5_2 Visible (Green)</li>
  19. <li>L5_3 Visible (Red)</li>
  20. <li>L5_4 Near-Infrared</li>
  21. <li>L5_5 Short-wave infrared</li>
  22. <li>L5_6 Thermal</li>
  23. <li>L5_7 Short-wave infrared</li>
  24. </ul>
  25. <p>
  26. Landsat-7:
  27. <ul>
  28. <li>L7_1 Visible (Blue)</li>
  29. <li>L7_2 Visible (Green)</li>
  30. <li>L7_3 Visible (Red)</li>
  31. <li>L7_4 Near-Infrared</li>
  32. <li>L7_5 Near-Infrared</li>
  33. <li>L7_6 Thermal</li>
  34. <li>L7_7 Mid-Infrared</li>
  35. <li>L7_8 Panchromatic</li>
  36. </ul>
  37. <p>
  38. Landsat-8:
  39. <ul>
  40. <li>L8_1 Visible (Coastal/Aerosol)</li>
  41. <li>L8_2 Visible (Blue)</li>
  42. <li>L8_3 Visible (Green)</li>
  43. <li>L8_4 Visible (Red)</li>
  44. <li>L8_5 Near-Infrared</li>
  45. <li>L8_6 SWIR 1</li>
  46. <li>L8_7 SWIR 2</li>
  47. <li>L8_8 Panchromatic</li>
  48. <li>L8_9 Cirrus</li>
  49. <li>L8_10 TIRS 1</li>
  50. <li>L8_11 TIRS 1</li>
  51. </ul>
  52. <p>
  53. Sentinel-2:
  54. <ul>
  55. <li>S2_1 Visible (Coastal/Aerosol)</li>
  56. <li>S2_2 Visible (Blue)</li>
  57. <li>S2_3 Visible (Green)</li>
  58. <li>S2_4 Visible (Red)</li>
  59. <li>S2_5 Vegetation Red Edge 1</li>
  60. <li>S2_6 Vegetation Red Edge 2</li>
  61. <li>S2_7 Vegetation Red Edge 3</li>
  62. <li>S2_8 Near-Infrared</li>
  63. <li>S2_8A Narrow Near-Infrared</li>
  64. <li>S2_9 Water vapour</li>
  65. <li>S2_10 SWIR - Cirrus</li>
  66. <li>S2_11 SWIR 1</li>
  67. <li>S2_12 SWIR 2</li>
  68. </ul>
  69. <p>
  70. Band references to be printed can be filtered by a search pattern (or
  71. fully defined band reference identifier) which can be specified
  72. by <b>pattern</b> option. For pattern syntax
  73. see <a href="https://docs.python.org/3/library/re.html#regular-expression-syntax">Python
  74. regular expression operations</a> documentation. By
  75. default, <em>g.bands</em> prints all available band references.
  76. <p>
  77. Extended metadata (central wavelength, spatial resolution, etc.) is printed
  78. only when the <b>-e</b> flag is given.
  79. <h2>NOTES</h2>
  80. Specific band reference can be assigned to a raster map
  81. by <em><a href="i.band.html">i.band</a></em> module.
  82. <p>
  83. Band reference concept is supported by temporal GRASS modules,
  84. see <em><a href="t.register.html#support-for-band-references">t.register</a></em>,
  85. <em><a href="t.rast.list.html#filtering-the-result-by-band-references">t.rast.list</a></em>,
  86. <em><a href="t.info.html#space-time-dataset-with-band-references-assigned">t.info</a></em>
  87. and <em><a href="t.rast.mapcalc.html#band-reference-filtering">t.rast.mapcalc</a></em>
  88. modules for examples.
  89. <h3>Image collections</h3>
  90. Image collections are the common data type to reference time series of
  91. multi band data. It is used in many frameworks
  92. (see <a href="https://developers.google.com/earth-engine/tutorial_api_04">Google
  93. Earth Engine API</a> for example) to address multi spectral satellite
  94. images series. GRASS supports a multi-band raster layer approach
  95. basically with the imagery group concept
  96. (<em><a href="i.group.html">i.group</a></em>). A new band reference
  97. concept is designed in order to support image collections in GRASS
  98. GIS.
  99. <h3>Band reference registry files</h3>
  100. Band reference information is stored in JSON files with a pre-defined
  101. internal data structure. A minimalistic example is shown below.
  102. <div class="code"><pre>
  103. {
  104. "Sentinel2": {
  105. "description": "The Sentinel-2 A/B bands",
  106. "shortcut": "S2",
  107. "instruments": "MultiSpectral Instrument (MSI) optical and infrared",
  108. "launched": "23 June 2015 (A); 07 March 2017 (B)",
  109. "source": "https://sentinel.esa.int/web/sentinel/missions/sentinel-2",
  110. "bands": {
  111. "1": {
  112. "Sentinel 2A" : {
  113. "central wavelength (nm)": 443.9,
  114. "bandwidth (nm)": 27
  115. },
  116. "Sentinel 2B" : {
  117. "central wavelength (nm)": 442.3,
  118. "bandwidth (nm)": 45
  119. },
  120. "spatial resolution (meters)": 60,
  121. "tag": "Visible (Coastal/Aerosol)"
  122. },
  123. "2": {
  124. "Sentinel 2A" : {
  125. "central wavelength (nm)": 496.6,
  126. "bandwidth (nm)": 98
  127. },
  128. "Sentinel 2B" : {
  129. "central wavelength (nm)": 492.1,
  130. "bandwidth (nm)": 98
  131. },
  132. "spatial resolution (meters)": 10,
  133. "tag": "Visible (Blue)"
  134. }
  135. }
  136. }
  137. }
  138. </pre></div>
  139. Each series starts with an unique identifier (&quot;Sentinel2&quot;
  140. in example above). Required attributes are only two:
  141. a <tt>shortcut</tt> and <tt>bands</tt>. Note that a <i>shortcut</i>
  142. must be unique in all band reference registry files. Number of other
  143. attributes is not defined or even limited (in example above
  144. only <tt>description</tt> and <tt>instruments</tt> attributes are
  145. defined). List of bands is defined by a <tt>bands</tt> attribute. Each
  146. band is defined by an identifier ("1", "2" in example above). List of
  147. attributes describing each band is not pre-defined or limited. In
  148. example above each band is described by a <tt>central wavelength
  149. (nm)</tt>, <tt>bandwidth (nm)</tt>, and a <tt>tag</tt>.
  150. <p>
  151. Band reference identifier defined by <b>pattern</b> option is given by
  152. a <i>shortcut</i> in order to print band reference information for
  153. whole series or by specific <i>shortcut</i>_<i>band</i>
  154. identifier.
  155. <p>
  156. System-defined registry files are located in GRASS GIS installation
  157. directory (<tt>$GISBASE/etc/g.bands</tt>). Note that
  158. currently <i>g.bands</i> allows to manage only system-defined registry
  159. files. Support for user-defined registry files is planned to be
  160. implemented, see <a href="#known-issues">KNOWN ISSUES</a> section for
  161. details.
  162. <h2>EXAMPLES</h2>
  163. <h3>Print all available band references</h3>
  164. <div class="code"><pre>
  165. g.bands
  166. S2_1 Visible (Coastal/Aerosol)
  167. S2_2 Visible (Blue)
  168. ...
  169. L7_1 Visible (Blue)
  170. L7_2 Visible (Green)
  171. ...
  172. L8_1 Visible (Coastal/Aerosol)
  173. L8_2 Visible (Blue)
  174. ...
  175. </pre></div>
  176. The module prints band reference and related tag if defined.
  177. <h3>Filter band references by a shortcut</h3>
  178. Only band identifiers related to Sentinel-2 satellite will be
  179. printed.
  180. <div class="code"><pre>
  181. g.bands pattern=S2
  182. S2_1 Visible (Coastal/Aerosol)
  183. ...
  184. S2_12 SWIR 2
  185. </pre></div>
  186. <h3>Filter band references by a regular expression</h3>
  187. Print all available 2nd bands:
  188. <div class="code"><pre>
  189. g.bands pattern=.*_2
  190. S2_2 Visible (Blue)
  191. L7_2 Visible (Green)
  192. L8_2 Visible (Blue)
  193. ...
  194. </pre></div>
  195. <h3>Print extended metadata for specified band identifier</h3>
  196. Extended metadata related to the first band of Sentinel-2 satellite
  197. will be printed.
  198. <div class="code"><pre>
  199. g.bands -e pattern=S2_1
  200. description: The Sentinel-2 A/B bands
  201. shortcut: S2
  202. instruments: MultiSpectral Instrument (MSI) optical and infrared
  203. launched: 23 June 2015 (A); 07 March 2017 (B)
  204. source: https://sentinel.esa.int/web/sentinel/missions/sentinel-2
  205. band: 1
  206. Sentinel 2A:
  207. central wavelength (nm): 443.9
  208. bandwidth (nm): 27
  209. Sentinel 2B:
  210. central wavelength (nm): 442.3
  211. bandwidth (nm): 45
  212. spatial resolution (meters): 60
  213. tag: Visible (Coastal/Aerosol)
  214. </pre></div>
  215. <h2>KNOWN ISSUES</h2>
  216. <em>g.bands</em> has currently <b>very limited functionality</b>. Only
  217. system-defined band references are supported. The final implementation
  218. will support managing (add, modify, delete) user-defined band
  219. references.
  220. <p>
  221. Only very limited number of band references is currently
  222. defined, namely Sentinel-2, Landsat7, and Landsat8 satellites. This
  223. will be improved in the near future.
  224. <h2>REFERENCES</h2>
  225. <ul>
  226. <li><a href="https://developers.google.com/earth-engine/tutorial_api_04">Google Earth Engine API</a></li>
  227. </ul>
  228. <h2>SEE ALSO</h2>
  229. <em>
  230. <a href="i.band.html">i.band</a>,
  231. <a href="r.info.html">r.info</a>
  232. </em>
  233. <h2>AUTHORS</h2>
  234. Martin Landa<br>
  235. Development sponsored by <a href="https://www.mundialis.de/en">mundialis
  236. GmbH &amp; Co. KG</a> (for the <a href="https://openeo.org">openEO</a>
  237. EU H2020 grant 776242)
  238. <!--
  239. <p>
  240. <i>Last changed: $Date$</i>
  241. -->