Author: CSDN @ _Yakult_
The code documented in this article is a script for building an annual collection of synthetic imagery . It obtains a collection of Landsat images within a given time range by calling a series of functions, and performs preprocessing and synthesis. It includes steps such as spectral index calculation, band adjustment, and median synthesis of remote sensing images.
The result is shown in the figure below,
The main steps of the script are as follows:
-
Define the dataset parameters, including the time series start year, end year, and start and end dates for each year.
-
Define the spectral index calculation function
timeSeriesIndex
, which is used to calculate the spectral index (NDVI, etc.). -
Create a dummy image collection
dummyCollection
that fills in missing years. -
Defines a function that builds a collection of annual synthetic images
buildMosaicCollection
, callsbuildMosaic
the function to build a median composite image for each year, and adds it to the collection. -
Define the L8 to L7 band adjustment function
harmonizationRoy
to band adjust Landsat 8 imagery according to a set of slope and intercept parameters to achieve spectral consistency with Landsat 7. -
Defines a function that applies median compositing to a collection of images
buildMosaic
by calling other functions to obtain the