Compute annual dryness trend from NDVI and LST raster time series by pairing filenames by date, generating TVDI rasters, averaging TVDI within each available year, extracting yearly means, and fitting a linear trend.
Use this skill for annual dryness/wetness trend tasks from NDVI+LST GeoTIFFs stored in one directory.
Default mode: native tools only.
run_python_script.get_filelist more than once unless the first call clearly failed. If it returns the same result twice, do not call it again.Procedure:
get_filelist(dir_path=DATA_DIR) once.YYYY-MM-DD in-memory and build two maps by date:
*_LST.tif*_NDVI.tiflst_path=[DATA_DIR/<lst-file>, ...]ndvi_path=[DATA_DIR/<ndvi-file>, ...]output_path=[TASK_OUT/tvdi_YYYY-MM-DD.tif, ...]compute_tvdi(lst_path=..., ndvi_path=..., output_path=...) once over all matched pairs if batch is supported.compute_tvdi fails, iterate once per matched pair using the same pairing result already in memory. Do not re-query the file list.calculate_tif_average(file_list=year_tvdis, output_path=annual_avg_path) once per available year.calc_batch_image_mean(file_list=annual_avg_paths) once.compute_linear_trend(x=sorted_years, y=annual_means).Deterministic filename-pairing rule:
Xinjiang_2022-09-30_LST.tif and Xinjiang_2022-09-30_NDVI.tif, the shared key is 2022-09-30.Xinjiang_2022-10-16_LST.tif exists but Xinjiang_2022-10-16_NDVI.tif does not, skip that date and mention one unmatched 2022 date.Required execution rules:
get_filelist(dir_path=...)compute_tvdi(lst_path=[...], ndvi_path=[...], output_path=[...])calculate_tif_average(file_list=[...], output_path=...)calc_batch_image_mean(file_list=[...])compute_linear_trend(x=[years], y=[means])compute_tvdi call over many single-date calls.compute_tvdi call, lst_path, ndvi_path, and output_path must all be lists of the same length.output_path must be a JSON list, never one comma-joined string.get_filelist, do parsing/grouping in the reasoning step and move downstream; do not stall on repeated listing.Path convention:
DATA_DIR/<filename>question1/tvdi_YYYY-MM-DD.tif or task-matched output subdirbenchmark/out/question1/tvdi_annual_avg_YYYY.tifMini example:
get_filelist(dir_path="benchmark/data/question1")Xinjiang_2019-01-01_LST.tif with Xinjiang_2019-01-01_NDVI.tiflst_path=["benchmark/data/question1/Xinjiang_2019-01-01_LST.tif", "benchmark/data/question1/Xinjiang_2019-01-17_LST.tif"]ndvi_path=["benchmark/data/question1/Xinjiang_2019-01-01_NDVI.tif", "benchmark/data/question1/Xinjiang_2019-01-17_NDVI.tif"]output_path=["question1/tvdi_2019-01-01.tif", "question1/tvdi_2019-01-17.tif"]x=[2019,2020,2021,2022].-0.037 => decreasing dryness; if MCQ is present, choose the option describing decreasing dryness (often B).Final answer template:
Available matched years: 2019, 2020, 2021, 2022; requested 2023 is absent, so trend is computed on available years only.Annual mean TVDI values: [...]Linear trend slope: ...Interpretation: dryness is increasing/decreasing/stable annually.MCQ: <label> if applicable.