LinearAdjustments#
- class geowombat.radiometry.LinearAdjustments[source]#
Bases:
object
A class for linear bandpass adjustments.
Methods
bandpass
(data[, sensor, to, band_names, ...])Applies a bandpass adjustment by applying a linear function to surface reflectance values.
Methods Documentation
- bandpass(data, sensor=None, to='l8', band_names=None, scale_factor=1, src_nodata=0, dst_nodata=0)[source]#
Applies a bandpass adjustment by applying a linear function to surface reflectance values.
- Parameters:
data (DataArray) – The data to adjust.
sensor (Optional[str]) – The sensor to adjust.
to (Optional[str]) – The sensor to adjust to.
band_names (Optional[list]) – The bands to adjust. If not given, all bands are adjusted.
scale_factor (Optional[float]) – A scale factor to apply to the input data.
src_nodata (Optional[int or float]) – The input ‘no data’ value.
dst_nodata (Optional[int or float]) – The output ‘no data’ value.
Reference:
Sentinel-2 and Landsat 8:
https://hls.gsfc.nasa.gov/algorithms/bandpass-adjustment/
See [CHGF19] for further details
Landsat 7 and Landsat 8:
See [RZJ+16] (Table 2)
- Returns:
xarray.DataArray
Examples
>>> import geowombat as gw >>> from geowombat.radiometry import LinearAdjustments >>> >>> la = LinearAdjustments() >>> >>> # Adjust all Sentinel-2 bands to Landsat 8 >>> with gw.config.update(sensor='s2'): >>> with gw.open('sentinel-2.tif') as ds: >>> ds_adjusted = la.bandpass(ds, to='l8')
- bandpass(data, sensor=None, to='l8', band_names=None, scale_factor=1, src_nodata=0, dst_nodata=0)[source]#
Applies a bandpass adjustment by applying a linear function to surface reflectance values.
- Parameters:
data (DataArray) – The data to adjust.
sensor (Optional[str]) – The sensor to adjust.
to (Optional[str]) – The sensor to adjust to.
band_names (Optional[list]) – The bands to adjust. If not given, all bands are adjusted.
scale_factor (Optional[float]) – A scale factor to apply to the input data.
src_nodata (Optional[int or float]) – The input ‘no data’ value.
dst_nodata (Optional[int or float]) – The output ‘no data’ value.
Reference:
Sentinel-2 and Landsat 8:
https://hls.gsfc.nasa.gov/algorithms/bandpass-adjustment/
See [CHGF19] for further details
Landsat 7 and Landsat 8:
See [RZJ+16] (Table 2)
- Returns:
xarray.DataArray
Examples
>>> import geowombat as gw >>> from geowombat.radiometry import LinearAdjustments >>> >>> la = LinearAdjustments() >>> >>> # Adjust all Sentinel-2 bands to Landsat 8 >>> with gw.config.update(sensor='s2'): >>> with gw.open('sentinel-2.tif') as ds: >>> ds_adjusted = la.bandpass(ds, to='l8')
Robert Chastain, Ian Housman, Joshua Goldstein, and Mark Finco. Empirical cross sensor comparison of Sentinel-2A and 2B MSI, Landsat-8 OLI, and Landsat-7 ETM+ top of atmosphere spectral characteristics over the conterminous United States. Remote sensing of environment, 221:274–285, 2019.