Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Question: Why are not all the bands for L7,L8, and L9 Pan-Sharpened? #560

Open
2320sharon opened this issue Jan 6, 2025 · 0 comments
Open

Comments

@2320sharon
Copy link
Contributor

2320sharon commented Jan 6, 2025

Hi @kvos!
First of all, thank you for all your great work maintaining and improving CoastSat.

I was diving into the preprocess_single function and noticed that for Landsat 7 the red band is not pan-sharpened. I also found that for Landsat 8 and Landsat 9 the NIR and SWIR band are not pan-sharpened. I re-read the portion of the coastsat paper that discusses the pan-sharpening process and I can't find anything that mentions why only certain bands for L7,L8, and L9 are being pan-sharpened.. What is the reasoning behind not pan-sharpening the red band and the SWIR band for Landsat 7 as well as not pan-sharpening the NIR and SWIR bands for L8 and L9?

I did some experimentation on a L8 site from Santa Cruz, California and a different L7 site and I found that when all the bands are pan-sharpened the results look much clearer. I posted a few screenshots of the results of pan-sharpening using the original method and pan-sharpening all of the bands below.

Snippet of preprocess single function that pan-sharpens L7 bands:

            # pansharpen Green, Blue, NIR for Landsat 7
            if satname == "L7":
                try:
                    im_ms_ps = pansharpen(im_ms[:, :, [1, 2, 3]], im_pan, cloud_mask)
                except:  # if pansharpening fails, keep downsampled bands (for long runs)
                    print("\npansharpening of image %s failed." % fn[0])
                    im_ms_ps = im_ms[:, :, [1, 2, 3]]
                # add downsampled Blue and SWIR1 bands
                im_ms_ps = np.append(im_ms[:, :, [0]], im_ms_ps, axis=2)
                im_ms_ps = np.append(im_ms_ps, im_ms[:, :, [4]], axis=2)
                im_ms = im_ms_ps.copy()
                # the extra image is the 15m panchromatic band
                im_extra = im_pan

Snippet of preprocess single function that pan-sharpens L8 bands:

            # pansharpen Blue, Green, Red for Landsat 8 and 9
            elif satname in ["L8", "L9"]:
                try:
                    im_ms_ps = pansharpen(im_ms[:, :, [0, 1, 2]], im_pan, cloud_mask)
                except:  # if pansharpening fails, keep downsampled bands (for long runs)
                    print("\npansharpening of image %s failed." % fn[0])
                    im_ms_ps = im_ms[:, :, [0, 1, 2]]
                # add downsampled NIR and SWIR1 bands
                im_ms_ps = np.append(im_ms_ps, im_ms[:, :, [3, 4]], axis=2)
                im_ms = im_ms_ps.copy()
                # the extra image is the 15m panchromatic band
                im_extra = im_pan

Results of Pan Sharpening

I ran a few experiments to check what the impact of pan-sharpening different bands of a Landsat 7 and Landsat 8 scene would be. The NIR and SWIR bands look much better after pan-sharpening for L8. The RGB image for L7 looks a little bit different the effect of pan-sharpening the red band is not as dramatic as the results for L8.

Experiment 1 ( the control) pan-sharpens the same bands as coastsat.

L7 - Bands 1,2,3 (Blue, Green, NIR) are pan-sharpened
L8 - Bands 0,1,2 (Red ,Blue, Green) are pan-sharpened

Experiment 2: pan-sharpen the red band for L7 and pan-sharpen the NIR band for L8

L7 - Bands 0,1,2,3 (Red, Blue, Green, NIR) are pan-sharpened
L8 - Bands 0,1,2,3 (Red ,Blue, Green, NIR) are pan-sharpened

Experiment 3: all bands are pan-sharpened

L7 - Bands 0,1,2,3,4 (Red, Blue, Green, NIR,SWIR) are pan-sharpened
L8 - Bands 0,1,2,3,4 (Red ,Blue, Green, NIR,SWIR) are pan-sharpened

Landsat 8 Pan-Sharpened Results

  1. The first figure shows an RGB jpg generated after pan-sharpening.
  2. The second figure shows each band being plotted before and after pan-sharpening each bands.
    pansharpen-L8
    pansharpened_bands_0_1_2_3_4

Landsat 7 Pan-Sharpened Results

  1. The first figure shows an RGB jpg generated after pan-sharpening.
  2. The second figure shows each band being plotted before and after pan-sharpening each bands.

pansharpen-l7

pansharpened_bands_0_1_2_3_4

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant