0
# Band and Platform Information
1
2
Comprehensive band definitions and platform-specific information for major satellite sensors used in remote sensing. Provides wavelength specifications, bandwidth information, and cross-platform compatibility mappings for standardized spectral band notation.
3
4
## Capabilities
5
6
### Global Band Catalogue
7
8
The global `spyndex.bands` object provides access to all band definitions used across spectral indices in the catalogue.
9
10
```python { .api }
11
class Bands(Box):
12
"""
13
Container for all band definitions used in spectral indices.
14
15
Provides dictionary-like access to individual Band objects.
16
"""
17
18
def __repr__(self) -> str:
19
"""Machine readable representation showing available band names."""
20
21
def __str__(self) -> str:
22
"""Human readable list of band names."""
23
```
24
25
**Usage Examples:**
26
27
```python
28
import spyndex
29
30
# Access the global band catalogue
31
print(spyndex.bands)
32
# Output: Bands(['A', 'B', 'G', 'R', 'RE1', 'RE2', 'RE3', 'N', 'N2', 'S1', 'S2', 'T1', 'T2'])
33
34
# Get list of all band names
35
band_names = list(spyndex.bands.keys())
36
print(f"Total bands available: {len(band_names)}")
37
38
# Access specific bands
39
nir = spyndex.bands.N # Near-infrared
40
red = spyndex.bands.R # Red
41
green = spyndex.bands.G # Green
42
blue = spyndex.bands.B # Blue
43
```
44
45
### Band Definitions
46
47
Each band is represented as a Band object containing spectral range information and platform-specific mappings.
48
49
```python { .api }
50
class Band:
51
"""
52
Individual band definition with spectral range and platform mappings.
53
"""
54
55
short_name: str # Standard band abbreviation (e.g., "N", "R", "G")
56
long_name: str # Descriptive name (e.g., "Near Infrared", "Red")
57
common_name: str # STAC Electro-Optical Extension common name
58
min_wavelength: float # Minimum wavelength of spectral range (nm)
59
max_wavelength: float # Maximum wavelength of spectral range (nm)
60
standard: str # Standard abbreviation (alias for short_name)
61
62
# Platform-specific band information (conditionally present)
63
# Note: Only platforms that support this specific band will have corresponding attributes
64
sentinel2a: Optional[PlatformBand] # Sentinel-2A band details (if supported)
65
sentinel2b: Optional[PlatformBand] # Sentinel-2B band details (if supported)
66
landsat4: Optional[PlatformBand] # Landsat 4 band details (if supported)
67
landsat5: Optional[PlatformBand] # Landsat 5 band details (if supported)
68
landsat7: Optional[PlatformBand] # Landsat 7 band details (if supported)
69
landsat8: Optional[PlatformBand] # Landsat 8 band details (if supported)
70
landsat9: Optional[PlatformBand] # Landsat 9 band details (if supported)
71
modis: Optional[PlatformBand] # MODIS band details (if supported)
72
worldview2: Optional[PlatformBand] # WorldView-2 band details (if supported)
73
worldview3: Optional[PlatformBand] # WorldView-3 band details (if supported)
74
planetscope: Optional[PlatformBand] # PlanetScope band details (if supported)
75
76
def __repr__(self) -> str:
77
"""Machine readable representation with band name."""
78
79
def __str__(self) -> str:
80
"""Human readable band description."""
81
```
82
83
**Usage Examples:**
84
85
```python
86
import spyndex
87
88
# Access individual band
89
nir_band = spyndex.bands.N
90
91
# Explore band properties
92
print(nir_band.short_name) # "N"
93
print(nir_band.long_name) # "Near Infrared"
94
print(nir_band.common_name) # "nir"
95
print(nir_band.min_wavelength) # 760.0
96
print(nir_band.max_wavelength) # 1000.0
97
98
# Display band information
99
print(nir_band)
100
# Output: N: Near Infrared
101
102
# Check available platforms for a band
103
if hasattr(nir_band, 'sentinel2a'):
104
print("Available on Sentinel-2A")
105
if hasattr(nir_band, 'landsat8'):
106
print("Available on Landsat 8")
107
```
108
109
### Platform-Specific Band Information
110
111
Detailed band specifications for individual satellite platforms, including actual band identifiers, center wavelengths, and bandwidths.
112
113
```python { .api }
114
class PlatformBand:
115
"""
116
Band information for a specific satellite platform.
117
"""
118
119
platform: str # Platform name (e.g., "Sentinel-2A", "Landsat 8")
120
band: str # Platform-specific band identifier (e.g., "B8", "B04")
121
name: str # Descriptive name for this platform
122
wavelength: float # Center wavelength in nanometers
123
bandwidth: float # Bandwidth in nanometers
124
125
def __repr__(self) -> str:
126
"""Machine readable representation with platform and band details."""
127
128
def __str__(self) -> str:
129
"""Human readable platform band description."""
130
```
131
132
**Usage Examples:**
133
134
```python
135
import spyndex
136
137
# Access platform-specific band information
138
nir_band = spyndex.bands.N
139
140
# Sentinel-2A NIR band details
141
s2a_nir = nir_band.sentinel2a
142
print(s2a_nir.platform) # "Sentinel-2A"
143
print(s2a_nir.band) # "B8"
144
print(s2a_nir.name) # "Near Infrared"
145
print(s2a_nir.wavelength) # 842.0
146
print(s2a_nir.bandwidth) # 106.0
147
148
# Display detailed information
149
print(s2a_nir)
150
# Output: Platform: Sentinel-2A, Band: Near Infrared
151
# * Band: B8
152
# * Center Wavelength (nm): 842.0
153
# * Bandwidth (nm): 106.0
154
155
# Compare across platforms
156
red_band = spyndex.bands.R
157
158
# Landsat 8 vs Sentinel-2A red bands
159
l8_red = red_band.landsat8
160
s2a_red = red_band.sentinel2a
161
162
print(f"Landsat 8 Red: {l8_red.wavelength}nm (±{l8_red.bandwidth/2}nm)")
163
print(f"Sentinel-2A Red: {s2a_red.wavelength}nm (±{s2a_red.bandwidth/2}nm)")
164
```
165
166
### Cross-Platform Band Mapping
167
168
Understanding how standardized band notation maps to different satellite platforms:
169
170
```python
171
import spyndex
172
173
def show_band_mapping(band_name):
174
"""Display how a standard band maps across platforms."""
175
band = getattr(spyndex.bands, band_name)
176
print(f"\nStandard Band: {band.short_name} ({band.long_name})")
177
print(f"Wavelength Range: {band.min_wavelength}-{band.max_wavelength} nm")
178
print("\nPlatform Mappings:")
179
180
platforms = ['sentinel2a', 'sentinel2b', 'landsat8', 'landsat7', 'modis']
181
for platform in platforms:
182
if hasattr(band, platform):
183
pb = getattr(band, platform)
184
print(f" {pb.platform}: {pb.band} ({pb.wavelength}nm, ±{pb.bandwidth/2}nm)")
185
186
# Example usage
187
show_band_mapping('N') # Near-infrared
188
show_band_mapping('R') # Red
189
show_band_mapping('G') # Green
190
```
191
192
### Band Compatibility Analysis
193
194
Finding compatible bands across different satellite platforms:
195
196
```python
197
import spyndex
198
199
# Find bands available on specific platforms
200
def find_platform_bands(platform_name):
201
"""Find all bands available on a specific platform."""
202
available_bands = []
203
for band_name, band in spyndex.bands.items():
204
platform_attr = platform_name.lower().replace('-', '').replace(' ', '')
205
if hasattr(band, platform_attr):
206
available_bands.append((band_name, band.long_name))
207
return available_bands
208
209
# Example usage
210
s2a_bands = find_platform_bands('Sentinel-2A')
211
print(f"Sentinel-2A available bands: {len(s2a_bands)}")
212
for short, long in s2a_bands:
213
print(f" {short}: {long}")
214
215
# Find bands common to multiple platforms
216
def find_common_bands(*platforms):
217
"""Find bands available on all specified platforms."""
218
platform_attrs = [p.lower().replace('-', '').replace(' ', '') for p in platforms]
219
common_bands = []
220
221
for band_name, band in spyndex.bands.items():
222
if all(hasattr(band, attr) for attr in platform_attrs):
223
common_bands.append(band_name)
224
225
return common_bands
226
227
# Find bands available on both Sentinel-2A and Landsat 8
228
common = find_common_bands('Sentinel-2A', 'Landsat 8')
229
print(f"Common bands: {common}")
230
```
231
232
## Standard Band Notation
233
234
Spyndex uses standardized single-letter band notation that maps to physical wavelength ranges:
235
236
- **B**: Blue (450-520 nm)
237
- **G**: Green (520-600 nm)
238
- **R**: Red (630-700 nm)
239
- **N**: Near Infrared (760-1000 nm)
240
- **S1**: Shortwave Infrared 1 (1550-1750 nm)
241
- **S2**: Shortwave Infrared 2 (2080-2350 nm)
242
- **T1**: Thermal Infrared 1 (10400-12500 nm)
243
- **T2**: Thermal Infrared 2 (10400-12500 nm)
244
- **RE1-RE3**: Red Edge bands (690-750 nm)
245
- **A**: Aerosol (430-450 nm)
246
- **WV**: Water Vapor (940 nm)
247
- **C**: Cirrus (1360-1390 nm)
248
249
## Supported Platforms
250
251
The band catalogue includes mappings for:
252
253
- **Sentinel-2A/2B**: Multispectral Imager (MSI)
254
- **Landsat 4/5**: Thematic Mapper (TM)
255
- **Landsat 7**: Enhanced Thematic Mapper Plus (ETM+)
256
- **Landsat 8/9**: Operational Land Imager (OLI) and Thermal Infrared Sensor (TIRS)
257
- **MODIS**: Terra and Aqua satellite sensors
258
- **WorldView-2/3**: High-resolution commercial satellites
259
- **PlanetScope**: Planet Labs constellation
260
261
## Wavelength Specifications
262
263
Band objects provide both general wavelength ranges for the standard notation and precise platform-specific center wavelengths and bandwidths. This enables:
264
265
- Cross-platform spectral index computation with awareness of sensor differences
266
- Wavelength-based band selection and filtering
267
- Inter-sensor calibration and harmonization
268
- Platform-specific optimization of spectral indices