Workflow to setup LANDSAT8 OLI data to be processed with Biophysical Processor

A set of 4 different GPF graphs is proposed with the aim of setup Landsat-8 OLI data for the processing with Biophysical Processor.
The Biophysical Processor integrated in SNAP 8 also supports Landsat-8 OLI as input data. Such processor requires zenith and azimuth angles both for sun and view to be provided together with BOA reflectances. Recently, Landsat Collection 2 (C2) datasets have been released, providing data with improved geometric accuracy and improved radiometric calibration. Landsat C2 dataset at Level 2 (L2) contains BOA reflectances, but no angles are provided. Landsat C2 dataset at Level 1 (L1) contains TOA reflectances, together with zenith and azimuth angles both for sun and view, that were not provided in the previous Collection 1 L1 dataset.
The ‘Sen2like’ tool will be integrated in SNAP to harmonize Landsat-8 to Sentinel-2, in order to generate denser time series and improve Earth monitoring. Since Landsat C2 reader is not yet available in SNAP 8, and Sen2Like is not yet integrated, there is the need of a procedure to easily combine BOA reflectances with zenith and azimuth angles both for sun and view, in order to use the Biophysical Processor.
I propose here a set of GPF graphs to combine Landsat-8 BOA reflectances with zenith and azimuth angles both for sun and view in order to execute the operator ‘Biophysical Processor LANDSAT8’ (BiophysicalLandsat8Op).

These graphs are proposed in the following posts:

  • L8_C2_L1_L2_stacking.xml Combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI C2 L2 (BOA reflectances)
  • L8_C2_BiophysicalOp.xml Combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI C2 L2 (BOA reflectances) and execute Biophysical Processor
  • L8_iCOR_BiophysicalOp.xml Combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI BOA reflectances atmospherically corrected using iCOR and execute Biophysical Processor
  • L8_C2_iCOR_BiophysicalOp.xml Perform atmospheric correction of Landsat-8 OLI C1 L1 using iCOR, combines with Landsat-8 OLI C2 L1 (angles) and execute Biophysical Processor

GPF graphs are also available at GitHub repository:

https://github.com/ffilipponi/SNAP_L8_C2_BiophysicalLandsat8Op

Federico

2 Likes

L8_C2_L1_L2_stacking.xml

The GPF graph combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI C2 L2 (BOA reflectances). Result can later be processed with the operator ‘Biophysical Processor LANDSAT8’ (BiophysicalLandsat8Op).

Here an example of command line

gpt L8_C2_L1_L2_stacking.xml -Poutput=/data/LC08_L2SP_190031_20201214_20201219_02_T1_SR.dim -Pinput_B3=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B3.TIF -Pinput_B4=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B4.TIF -Pinput_B5=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B5.TIF -Pinput_B6=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B6.TIF -Pinput_B7=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B7.TIF -Pinput_SZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SZA.TIF -Pinput_SAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SAA.TIF -Pinput_VZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VZA.TIF -Pinput_VAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VAA.TIF

Description of command line options:

  • -Poutput Output product file name
  • -Pinput_B3 Input Landsat-8 OLI C2 L2 Band 3 (B3) GeoTIFF file name
  • -Pinput_B4 Input Landsat-8 OLI C2 L2 Band 4 (B4) GeoTIFF file name
  • -Pinput_B5 Input Landsat-8 OLI C2 L2 Band 5 (B5) GeoTIFF file name
  • -Pinput_B6 Input Landsat-8 OLI C2 L2 Band 6 (B6) GeoTIFF file name
  • -Pinput_B7 Input Landsat-8 OLI C2 L2 Band 7 (B7) GeoTIFF file name
  • -Pinput_SZA Input Landsat-8 OLI C2 L1 Solar Zenith Angle (SZA) GeoTIFF file name
  • -Pinput_SAA Input Landsat-8 OLI C2 L1 Solar Azimuth Angle (SAA) GeoTIFF file name
  • -Pinput_VZA Input Landsat-8 OLI C2 L1 View Zenith Angle (VZA) GeoTIFF file name
  • -Pinput_VAA Input Landsat-8 OLI C2 L1 View Azimuth Angle (VAA) GeoTIFF file name

L8_C2_L1_L2_stacking.xml (9.3 KB)

2 Likes

L8_C2_BiophysicalOp.xml

The GPF graph combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI C2 L2 (BOA reflectances) and execute Biophysical Processor ‘Biophysical Processor LANDSAT8’ (BiophysicalLandsat8Op).

Here an example of command line

gpt L8_C2_BiophysicalOp.xml -PcomputeLAI=true -PcomputeFapar=true -PcomputeFcover=true -Pformat=BEAM-DIMAP -Poutput=/data/LC08_L2SP_190031_20201214_20201219_02_T1_SR_Biophysical.dim -Pinput_B3=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B3.TIF -Pinput_B4=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B4.TIF -Pinput_B5=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B5.TIF -Pinput_B6=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B6.TIF -Pinput_B7=/data/LC08_L2SP_190031_20201214_20201219_02_T1/LC08_L2SP_190031_20201214_20201219_02_T1_SR_B7.TIF -Pinput_SZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SZA.TIF -Pinput_SAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SAA.TIF -Pinput_VZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VZA.TIF -Pinput_VAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VAA.TIF

Description of command line options:

  • -PcomputeLAI Boolean. Compute LAI (Leaf Area Index)
  • -PcomputeFapar Boolean. Compute FAPAR (Fraction of Absorbed Photosynthetically Active Radiation)
  • -PcomputeFcover Boolean. Compute FVC (Fraction of Vegetation Cover)
  • -Pformat Output product format (i.e. ‘BEAM-DIMAP’)
  • -Poutput Output product file name
  • -Pinput_B3 Input Landsat-8 OLI C2 L2 Band 3 (B3) GeoTIFF file name
  • -Pinput_B4 Input Landsat-8 OLI C2 L2 Band 4 (B4) GeoTIFF file name
  • -Pinput_B5 Input Landsat-8 OLI C2 L2 Band 5 (B5) GeoTIFF file name
  • -Pinput_B6 Input Landsat-8 OLI C2 L2 Band 6 (B6) GeoTIFF file name
  • -Pinput_B7 Input Landsat-8 OLI C2 L2 Band 7 (B7) GeoTIFF file name
  • -Pinput_SZA Input Landsat-8 OLI C2 L1 Solar Zenith Angle (SZA) GeoTIFF file name
  • -Pinput_SAA Input Landsat-8 OLI C2 L1 Solar Azimuth Angle (SAA) GeoTIFF file name
  • -Pinput_VZA Input Landsat-8 OLI C2 L1 View Zenith Angle (VZA) GeoTIFF file name
  • -Pinput_VAA Input Landsat-8 OLI C2 L1 View Azimuth Angle (VAA) GeoTIFF file name

L8_C2_BiophysicalOp.xml (9.8 KB)

2 Likes

L8_iCOR_BiophysicalOp.xml

The GPF graph combines Landsat-8 OLI C2 L1 (angles) with Landsat-8 OLI BOA reflectances atmospherically corrected using iCOR and execute Biophysical Processor’Biophysical Processor LANDSAT8’ (BiophysicalLandsat8Op).
‘iCOR’ should be installed in the system and imported in SNAP 8 as a module. Landsat-8 OLI C1 L1 is currently supported as iCOR input dataset.

Here an example of command line

gpt L8_iCOR_BiophysicalOp.xml -PcomputeLAI=true -PcomputeFapar=true -PcomputeFcover=true -Pformat=BEAM-DIMAP -Poutput=/data/LC08_L1TP_191031_20210106_20210106_01_RT_Biophysical.dim -Pinput_iCOR=/data/LC08_L1TP_190031_20201214_20201219_01_T1_iCOR.tif -Pinput_SZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SZA.TIF -Pinput_SAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SAA.TIF -Pinput_VZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VZA.TIF -Pinput_VAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VAA.TIF

Description of command line options:

  • -PcomputeLAI Boolean. Compute LAI (Leaf Area Index)
  • -PcomputeFapar Boolean. Compute FAPAR (Fraction of Absorbed Photosynthetically Active Radiation)
  • -PcomputeFcover Boolean. Compute FVC (Fraction of Vegetation Cover)
  • -Pformat Output product format (i.e. ‘BEAM-DIMAP’)
  • -Poutput Output product file name
  • -Pinput_iCOR Input Landsat-8 OLI BOA Reflectances dataset atmosferically corrected using iCOR
  • -Pinput_SZA Input Landsat-8 OLI C2 L1 Solar Zenith Angle (SZA) GeoTIFF file name
  • -Pinput_SAA Input Landsat-8 OLI C2 L1 Solar Azimuth Angle (SAA) GeoTIFF file name
  • -Pinput_VZA Input Landsat-8 OLI C2 L1 View Zenith Angle (VZA) GeoTIFF file name
  • -Pinput_VAA Input Landsat-8 OLI C2 L1 View Azimuth Angle (VAA) GeoTIFF file name

L8_iCOR_BiophysicalOp.xml (7.9 KB)

1 Like

L8_C1_L1_iCOR_BiophysicalOp.xml

The GPF graph perform atmospheric correction of Landsat-8 OLI C1 L1 using iCOR, combines with Landsat-8 OLI C2 L1 (angles) and execute Biophysical Processor Biophysical Processor’Biophysical Processor LANDSAT8’ (BiophysicalLandsat8Op).
‘iCOR’ should be installed in the system and imported in SNAP 8 as a module. Landsat-8 OLI C1 L1 is currently supported as iCOR input dataset.

Here an example of command line

gpt L8_C1_L1_iCOR_BiophysicalOp.xml -PcomputeLAI=true -PcomputeFapar=true -PcomputeFcover=true -Poutput_iCOR=/data/LC08_L1TP_191031_20210106_20210106_01_RT_iCOR.tif -Pformat=BEAM-DIMAP -Poutput=/data/LC08_L1TP_191031_20210106_20210106_01_RT_iCOR_Biophysical.dim -Pinput=/data/LC08_L1TP_190031_20201214_20201219_01_T1/LC08_L1TP_190031_20201214_20201219_01_T1_MTL.txt -Pinput_SZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SZA.TIF -Pinput_SAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_SAA.TIF -Pinput_VZA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VZA.TIF -Pinput_VAA=/data/LC08_L1TP_190031_20201214_20201219_02_T1/LC08_L1TP_190031_20201214_20201219_02_T1_VAA.TIF

Description of command line options:

  • -PcomputeLAI Boolean. Compute LAI (Leaf Area Index)
  • -PcomputeFapar Boolean. Compute FAPAR (Fraction of Absorbed Photosynthetically Active Radiation)
  • -PcomputeFcover Boolean. Compute FVC (Fraction of Vegetation Cover)
  • -Poutput GeoTIFF file name for iCOR output product
  • -Pformat Output product format (i.e. ‘BEAM-DIMAP’)
  • -Poutput Output product file name
  • -Pinput Input Landsat-8 OLI C1 L1 dataset (‘MTL.txt’ file)
  • -Pinput_SZA Input Landsat-8 OLI C2 L1 Solar Zenith Angle (SZA) GeoTIFF file name
  • -Pinput_SAA Input Landsat-8 OLI C2 L1 Solar Azimuth Angle (SAA) GeoTIFF file name
  • -Pinput_VZA Input Landsat-8 OLI C2 L1 View Zenith Angle (VZA) GeoTIFF file name
  • -Pinput_VAA Input Landsat-8 OLI C2 L1 View Azimuth Angle (VAA) GeoTIFF file name

L8_C1_L1_iCOR_BiophysicalOp.xml (9.3 KB)

1 Like

great, thank you for sharing!

Hi Federico,

In the Help of SNAP 8.0, it says that blue, red, near_infrared, swir_1 and swir_2 bands are needed when using Landsat8 images as inputs for the Biophysical Processor. So for layer stacking, it should be Band 2 (blue) instead of Band 3 (green), right?

Shixian

Hi Federico,

When I ran the GPF graph for layer stacking, I got an error:“Expression is invalid. Undefined symbol '$sourceProduct1.band1”. Could you help me with it?

Dear @Shixian,

according to the Biophysical Operator parameters file, ‘green’ band is used as input for LANDSAT8 OLI data.
Have a look at this post for furhter details:

Regards,

Federico

Dear @Shixian,

have you tried to run the graph using gpt from command line?

Federico

@FedericoF I have loaded L8_C2_L1_L2_stacking.xml for the purpose it is built for, however I am receiving same error as @Shixian . I am not conversant with the command line. Can you please help me troubleshoot this problem? I will be glad if you could help me get rid of this nasty error.

@Neelum unfortunately the graph is only working from gpt command line.

Ciao Federico,
First of all, im a noob at using snap from the command line. I would like to use your methodology for LAI computation using Landsat-8 C2L1 and C2L2 data. I downloaded the .xml file from github, and modified the input files of the script according to my file system. Here i provide you with my inputs:

gpt L8_C2_BiophysicalOp.xml -PcomputeLAI=true -PcomputeFapar=true -PcomputeFcover=true -Pformat=BEAM-DIMAP -Poutput=D:/L8_prep_biophyical/LAI.dim -Pinput_B3=D:/L8_prep_biophyical/LC08_L2SP_191031_20210701_20210708_02_T1/LC08_L2SP_191031_20210701_20210708_02_T1_SR_B3.TIF -Pinput_B4=D:/L8_prep_biophyical/LC08_L2SP_191031_20210701_20210708_02_T1/LC08_L2SP_191031_20210701_20210708_02_T1_SR_B4.TIFF -Pinput_B5=D:/L8_prep_biophyical/LC08_L2SP_191031_20210701_20210708_02_T1/LC08_L2SP_191031_20210701_20210708_02_T1_SR_B5.TIF -Pinput_B6=D:/L8_prep_biophyical/LC08_L2SP_191031_20210701_20210708_02_T1/LC08_L2SP_191031_20210701_20210708_02_T1_SR_B6.TIF -Pinput_B7=D:/L8_prep_biophyical/LC08_L2SP_191031_20210701_20210708_02_T1/LC08_L2SP_191031_20210701_20210708_02_T1_SR_B7.TIF -Pinput_SZA=D:/L8_prep_biophyical/LC08_L1TP_191031_20210701_20210708_02_T1/LC08_L1TP_191031_20210701_20210708_02_T1_SZA.TIF -Pinput_SAA=D:/L8_prep_biophyical/LC08_L1TP_191031_20210701_20210708_02_T1/LC08_L1TP_191031_20210701_20210708_02_T1_SAA.TIF -Pinput_VZA=D:/L8_prep_biophyical/LC08_L1TP_191031_20210701_20210708_02_T1/LC08_L1TP_191031_20210701_20210708_02_T1_VZA.TIF -Pinput_VAA=D:/L8_prep_biophyical/LC08_L1TP_191031_20210701_20210708_02_T1/LC08_L1TP_191031_20210701_20210708_02_T1_VAA.TIF

When i launch the script from the command line, i got the following error message:
“Error: [NodeId: Read_B3] Specified ‘file’ [${input_B3}] does not exist.”.
I can’t understand what’s wrong, of course it must be something related to the path modification that I made, since i did not modified anything other than that!
Do you have any idea of what my problem could be?
Grazie mille in anticipo,
Quick update, I think i overcame this issue. Now i got the following warning:
“Error: [NodeId: BandMaths] Could not parse expression: ‘((($sourceProduct1.band_1 > 7273) and ($sourceProduct1.band_1 < 43637) and ($sourceProduct1.band_1 > 0)) ? (0.0000275 * $sourceProduct1.band_1 - 0.2) : NaN)’. Undefined symbol ‘$sourceProduct1.band_1’.”, which i think other users also had.
Alessandro

1 Like

Hi all,

I believe I was able to get past these errors and use the biophysical processor to calculate LAI (or FAPAR, etc.) using Landsat 8 imagery.

What I had to do was download both the Level 2 and Level 1 Product for the same image (download from Earth Explorer). These were downloaded as .tar archives. I then copied the four total sun and view azimuth files that were present in the Level 1 download .tar folder (the four TIFs ending in “_SZA.tif”, “_SAA.tif”, “_VAA.tif”, “_VZA.tif”), and I pasted them into the Level 2 download .tar folder. I did not need to change the name of these four files. I then copied the information for these four layers in the Level 1 metadata file (ending in “_MTL.txt”), and pasted the information for these four layers into the Level 2 metadata file. This process allowed SNAP to successfully read in the Level 2 .tar archive and it was able to recognize the four new tifs, which loaded in as “vaa”, “vza”, “saa”, and “sza”.

In order for the biophysical processor to work, I had to rename these four layers in the “Product Explorer” Window. I also had to do band math to correctly scale the DN values for these four layers, which required multiplying each input layer by “0.01”, as detailed in the comments by user Shixian at this link: Biophysical Processor Landsat 8 - #14 by florcamg.

Thanks,
Chris

1 Like