This repository provides the code used to conduct the research for the paper “From static classes to dynamic processes: Rethinking landscape characterization in drylands”, submitted to the Ecosphere journal.
There are two folders within this repository. The “Code” folder contains files related to processing and analysis of the data, and the “StudyArea” folder contains shapefiles of the study area. Within the “Code” folder, there are several different code files corresponding to different steps of the analysis. For the first step of the analysis, the “Manuscript_GEEcode.txt” file contains the code used in the JavaScript-based Google Earth Engine code editor. This code is also available at this link. Before running this code, a Google Earth Engine account is necessary, as well as access to Google Drive with sufficient storage for the data that will be downloaded (in this specific case, about 2.5 GB). Running the Google Earth Engine script produces a raster of precipitation-independent greenness time series for the given study area (although note that, for our study area, GEE outputs two raster files that need to be merged, but this step may be skipped if using a smaller study area). To run this code, both shapefiles (“NM_StudyArea” and “NM_StudyArea_NLCDfiltered”) need to be uploaded as assets into Google Earth Engine. The “NM_StudyArea” shapefile contains the general outline of the study area, and the “NM_StudyArea_NLCDfiltered” shapefile only contains areas within the study area that are classified as "Barren", "Shrub", "Grassland", and "Pasture" by the 2023 National Land Cover Database (NLCD). Further information on how to upload these shapefiles can be found at the Manage Assets guide from Google Earth Engine.
The next stage of the analysis involves processing the raster of precipitation-independent greeness time series, running the time series clustering, and enacting the LandTrendr algorithm to further analyze the clustering results. The code for these steps is written in Python. The “clusterEnv.yml” file contains a python environment tailored to this analysis and is provided in the “Code” folder as well. The “ManuscriptCod.py” and “ManuscriptCode.ipynb” contain the same code, with the former being a traditional python code file and the latter being in the format of a notebook. The different steps of analysis are split up into sections, as denoted in the code files. It is recommended that the Python code is run in Google colabs, especially for Section 4.2 that utilizes the Google Earth Engine Python API. Otherwise, if run on a local machine, this step (Section 4.2) may have to be conducted separately from the rest of the Python code.
Throughout each code file (both Python and JavaScript), there are variables, names of the files, or file paths that will need to be input by the user. These are denoted by “INPUT” commented next to lines which require user input. Within the Python files, there are also some intermediate steps that must be taken (including uploading and downloading data files), which are denoted as a “.Note” within each section.
Please note that the Google Earth Engine code is heavily drawn from code provided in “Detecting Land Cover Change in Rangelands”, a chapter authored by Ginger Allington and Natalie Kreitzer in the book “Cloud-Based Remote Sensing with Google Earth Engine: Fundamentals and Applications” (Allington and Kreitzer, 2024).
Contact Julie Peeling at jap479@cornell.edu with questions.
References
Allington, G., & Kreitzer, N. (2024). Detecting Land Cover Change in Rangelands. In J. A. Cardille, M. A. Crowley, D. Saah, & N. E. Clinton (Eds.), Cloud-Based Remote Sensing with Google Earth Engine: Fundamentals and Applications. Springer International Publishing. https://link.springer.com/10.1007/978-3-031-26588-4