Integrating WaPOR and GEE for IGwA

4. Chapter 3: GEE and WaPOR: From Data Preprocessing to Analysis

This chapter builds upon the data collection methods introduced in the previous chapter (Chapter 2), shifting the focus to the preprocessing and analysis of spatiotemporal data that represent agricultural inputs and outputs to the atmosphere. These steps are essential for preparing data to serve as inputs for the irrigation groundwater assessment model - next chapter (Chapter 4). 

Objective of This Chapter

The steps in this chapter:

  1. Prepare and visualize geospatial datasets that capture interactions between the land and atmosphere.
  2. Extract temporal trends of key hydrological components like precipitation (PCP), actual evapotranspiration (AETI), and potential evapotranspiration (PET).
  3. Transform data into forms suitable as inputs for the groundwater model introduced in the subsequent chapter.


The workflow is organized into six key stages: accessing datadata preprocessing, local data extraction, resampling, date matching, and analysis. The following sections provide a detailed breakdown of each step, as illustrated in the diagram below.

Step-by-Step Guide

Step 1: Accessing Images from the Asset

  • Objective: Retrieve WaPOR images for the study area, ensuring proper setup for further processing.
  • Process:
    1. Use asset paths to load the required datasets (e.g., AETI, PET, and PCP) from WaPOR into the analysis environment.
    2. Verify dataset integrity by inspecting metadata and coverage to ensure compatibility with the study area.
    3. Perform any required reclassification or spatial adjustments to match the Point of Interest (POI).

Step 2: Data Preprocessing

  • Objective: Transform raw datasets into structured, usable formats.
  • Process:
    1. Apply preprocessing functions to clean and standardize the loaded datasets.
    2. Add metadata such as timestamps or geolocation to enrich the dataset for subsequent analysis.
    3. Convert the data into tabular DataFrame formats, making them compatible with downstream tools for aggregation and analysis.

Step 3: Local Data Extraction

  • Objective: Extract relevant variables (e.g., AETI, PET, and PCP) for the study area or Point of Interest (POI).
  • Process:
    1. Extract the following variables from the preprocessed datasets:
      • Actual Evapotranspiration (AETI): Represents water loss to the atmosphere.
      • Potential Evapotranspiration (PET): Indicates the maximum potential evaporation under ideal conditions.
      • Precipitation (PCP): Reflects water input to the system.
    2. Ensure alignment of the extracted data spatially with the study area's boundaries to ensure accurate local analysis.

Step 4: Resampling Image Collections

  • Objective: Standardize datasets by aggregating them over consistent time intervals (e.g., monthly or seasonal).
  • Process:
    1. Use resampling functions to convert dekadal or irregular data into monthly aggregates.
    2. Generate resampled datasets for each key variable:
      • Monthly AETI: Aggregated actual evapotranspiration.
      • Monthly PET: Aggregated potential evapotranspiration.
      • Monthly PCP: Aggregated precipitation.
    3. The resulting datasets are now temporally uniform and ready for further comparative analysis.

Step 5: Matching Dates

  • Objective: Ensure all datasets are temporally aligned to enable consistent analysis and modeling.
  • Process:
    1. Apply a date-matching function to synchronize datasets such as AETI, PET, and PCP.
    2. The output consists of matched datasets (e.g., Matched AETI, Matched PET, Matched PCP) with uniform timeframes.

Step 6: Data Analysis

  • Objective: Combine processed datasets into a single structure for preliminary analysis and visualization.
  • Process:
    1. Integrate the matched datasets into a consolidated DataFrame, ready for model input.
    2. Perform exploratory data analysis (EDA) to identify trends, seasonal patterns, or anomalies.
    3. Create visualizations to communicate key insights effectively.

                                                                           Python ScriptWaPOR_and_GEE_Data_Preprocessing_to_Analysis