Landsat 8 SWIR Bands

Post Reply
GHesketh4
Posts: 10
Joined: Tue Jun 09, 2020 4:42 pm
company / institution: University of Maine
Location: Orono, ME

Landsat 8 SWIR Bands

Post by GHesketh4 »

Hello,I cannot get Polymer to write Landsat-8's SWIR bands onto a level-2 netCDF. I want the 1610 band and the 2200 band in the atmospheric correction as well. I tried to add code to the file level1_landsat.py, but that didn't work.

Here is my modification of the level1_landsast.py:

band_index = {
440: 1,
480: 2,
560: 3,
655: 4,
865: 5,
1610: 6,
2200: 7,
}

And here is is my code when I run level 2 processing.

run_atm_corr(
Level1_OLI(fileLoc),
Level2_NETCDF(outdir=outLoc, ext=(fileName + '.nc'),
overwrite=True), multiprocessing=-1
)

Thanks!
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Landsat 8 SWIR Bands

Post by fsteinmetz »

Hi Gabe,

Indeed you did the proper modification, but this requires a few additional changes in level1_landsat.py and params.py. See the following diff (I will include these changes in further releases of Polymer) :

Code: Select all

diff --git a/polymer/level1_landsat8.py b/polymer/level1_landsat8.py
index a70ad72..b3a4dd9 100644
--- a/polymer/level1_landsat8.py
+++ b/polymer/level1_landsat8.py
@@ -24,6 +24,8 @@ band_index = {
         560: 3,
         655: 4,
         865: 5,
+        1610: 6,
+        2200: 7,
         }
 
 
@@ -188,7 +190,9 @@ class Level1_OLI(Level1_base):
                          (480, 'Blue'),
                          (560, 'Green'),
                          (655, 'Red'),
-                         (865, 'NIR')]:
+                         (865, 'NIR'),
+                         (1610, 'SWIR1'),
+                         (2200, 'SWIR2')]:
             sh = wb.sheet_by_name(bname)
 
             wav, srf = [], []
diff --git a/polymer/params.py b/polymer/params.py
index 8aab4a2..3ed303e 100644
--- a/polymer/params.py
+++ b/polymer/params.py
@@ -710,6 +710,8 @@ class Params(object):
                 560: 1.,
                 655: 1.,
                 865: 1.,
+                1610: 1.,
+                2200: 1.,
                 }
 
 
@@ -732,7 +734,9 @@ class Params(object):
                          (480, 'Blue'),
                          (560, 'Green'),
                          (655, 'Red'),
-                         (865, 'NIR')]:
+                         (865, 'NIR'),
+                         (1610, 'SWIR1'),
+                         (2200, 'SWIR2')]:
             sh = wb.sheet_by_name(bname)
 
             wav, srf = [], []
@@ -756,6 +760,8 @@ class Params(object):
                 560: 0.,
                 655: 0.,
                 865: 0.,
+                1610: 0.,
+                2200: 0.,
                 }
 
         self.band_cloudmask = 865
Then you also need to call run_atm_corr with the argument bands_rw = [440, 480, 560, 655, 865, 1610, 2200] to activate the writing of the SWIR bands.
This will apply the atmospheric reflectance model to the SWIR bands to provide water reflectances at these bands. This will not use the SWIR bands for atmospheric correction. Please be aware that the consistency of the model from the VIS/NIR bands to the SWIR is not guaranteed at all. This is completely experimental and you may end up with large bias in the SWIR bands. Your feedback is welcome !
Cheers,
François
GHesketh4
Posts: 10
Joined: Tue Jun 09, 2020 4:42 pm
company / institution: University of Maine
Location: Orono, ME

Re: Landsat 8 SWIR Bands

Post by GHesketh4 »

Got it, thanks!
Post Reply