### YAML Configuration File Example Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/cli.md This is an example of the expected YAML configuration file output. It contains a 'DEFAULT' section with baseline parameters and subsequent sections for each unique command area identifier found in the input dataset. ```yaml DEFAULT: use_default: true planting_date: "2025-07-30" crop_type: Wheat soil_coef: 0.6 distribution_unif: 0.8 Teesta Canal A: use_default: false planting_date: "2025-07-30" crop_type: Wheat soil_coef: 0.6 distribution_unif: 0.8 T1T: use_default: false planting_date: '2025-07-07' crop_type: Wheat soil_coef: 0.5 distribution_unif: 1.0 ... ``` -------------------------------- ### Install and Initialize sDRIPS Project Source: https://context7.com/uw-saswe/sdrips/llms.txt Installs the sDRIPS package using pip and initializes a new project directory with the necessary folder structure and configuration templates. It also includes options for forcing an update of existing configurations and verifying the installation. ```bash # Install sDRIPS pip install sdrips # Initialize project (creates Data/, Shapefiles/, config_files/ directories) sdrips init --dir /path/to/my_irrigation_project # Force update existing configurations sdrips init --dir . --force # Verify installation sdrips test --dir ./tests ``` -------------------------------- ### sDRIPS Configuration Example (High-Level Controls) Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/full_guide/cli.md Example of high-level module controls within the `sdrips_config.yaml` file for generating advisories without in-situ sensor integration. This section dictates the types of advisories to be generated. ```yaml # ------------------------------- # HIGH-LEVEL MODULE CONTROLS # ------------------------------- Command_Area_Net_Water_Requirement: true # Generate advisory on how much water should be allotted to each command area Canal_water_allotment: false # Generate advisory on how much water should be allotted to each canal (From primary to tertiary canals) Insitu_Sensor_integration: false # Toggle to integrate in-situ sensor data with satellite data for bias correction Weather_station_integration: false # Toggle to integrate local weather station data to improve accuracy ``` -------------------------------- ### CLI Help Command Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/cli.md This command displays the help information for the `sdrips.cmd_config` module, outlining all available options and their descriptions. ```bash python -m sdrips.cmd_config -h ``` -------------------------------- ### Initialize sDRIPS Project Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/full_guide/cli.md Initializes a new sDRIPS project in the current directory. This command fetches the latest configuration files required for sDRIPS operation. Ensure your conda environment is activated before running. ```bash sdrips init -d . ``` -------------------------------- ### Clone sDRIPS Repository Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Development/Developer_Version.md This command clones the sDRIPS repository to your local machine. Ensure you have Git installed. ```bash git clone https://github.com/UW-SASWE/sDRIPS.git . ``` -------------------------------- ### Main sDRIPS Configuration Setup (YAML) Source: https://context7.com/uw-saswe/sdrips/llms.txt Sets up the main sDRIPS execution parameters using a YAML configuration file. This includes enabling/disabling various modules, specifying input data paths (shapefiles, GEE assets), defining the analysis period, setting data storage locations, and configuring processing parameters like the number of parallel cores. ```yaml # config_files/sdrips_config.yaml # Module activation flags Command_Area_Net_Water_Requirement: true # Calculate water needs per command area Canal_water_allotment: false # Distribute water through canal network Insitu_Sensor_integration: false # Integrate ground sensors for bias correction Weather_station_integration: false # Use local weather station data # Command area shapefile Irrigation_cmd_area_shapefile: path: Shapefiles/my_command_areas.shp feature_name: AREA_NAME # Unique ID column numeric_id_name: ID # Numeric ID for sorting area_column_name: Irrigable_Area # Area in square meters # Google Earth Engine asset (optional) GEE_Asset_ID: id: "users/myaccount/my_command_areas" # GEE asset path shp: Shapefiles/my_command_areas.shp # Fallback local shapefile # Analysis period Date_Running: start_date: "2024-06-15" default_run_week: false run_week: ["currentweek"] # Options: currentweek, lastweek, or both # Data storage Save_Data_Location: save_data_loc: Data/ # Command area configuration Cmd_Area_Config: path: config_files/ca_config.yaml # Crop coefficients Crop_Config: path: config_files/crop_config.yaml # Processing Multiprocessing: cores: 7 # Parallel processing workers ``` -------------------------------- ### Check Help for Command Area Creation CLI Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/cmd_area_creation/cli.md This command displays the help information for the `sdrips.cmd_area_creation` CLI tool. It outlines all available arguments and options for generating command area polygons. ```bash python -m sdrips.cmd_area_creation -h ``` -------------------------------- ### Define Crop Coefficients (Kc) in YAML Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Configuration/crop_config.md This YAML snippet demonstrates the structure for defining crop coefficients (Kc) across different growth stages. It includes examples of constant Kc values and linear progressions of Kc over a specified duration, essential for estimating crop evapotranspiration. ```yaml # ------------------------------- # Crop configuration file # ------------------------------- Rice: "0-20": 1.1 "21-45": [linear, 1.1, 1.4, 25] "46-105": 1.4 "106-115": [linear, 1.4, 1.0, 10] "116-140": 1.0 Wheat: "0-28": 0.5 "29-56": [linear, 0.5, 1.15, 28] "57-112": 1.15 "113-119": [linear, 1.15, 0.7, 7] "120-140": 0.7 # Ref: https://www.researchgate.net/publication/4875041_Actual_evapotranspiration_and_crop_coefficients_of_wheat_Triticum_aestivum_under_varying_moisture_levels_of_humid_tropical_canal_command_area/figures?lo=1 ``` -------------------------------- ### Weather Station Data CSV Format Example Source: https://context7.com/uw-saswe/sdrips/llms.txt Example format for weather station data CSV files. Specifies STATION_ID, Date, and meteorological variables such as Temp_C, Wind_ms, and Precip_mm. ```csv STATION_ID,Date,Temp_C,Wind_ms,Precip_mm STN_001,2024-06-15,29.3,2.5,5.2 STN_002,2024-06-15,28.7,3.1,4.8 ``` -------------------------------- ### Secrets Configuration File Example (YAML) Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Configuration/secrets.md This YAML snippet demonstrates the structure for storing Google Earth Engine and IMERG account credentials in the secrets.yaml file. It requires placeholders for usernames, passwords, and key file paths. ```yaml GEE_Account: username: # Google Earth Engine service account key_file: # Path to the key file IMERG_Account: username: # IMERG username password: # IMERG password ``` -------------------------------- ### Sensor Data CSV Format Example Source: https://context7.com/uw-saswe/sdrips/llms.txt Example format for sensor data CSV files used by sDRIPS. Includes Timestamp and meteorological variables like Temperature, Water Content, and Wind, along with spatial coordinates. ```csv Timestamp,Temperature,Water Content,Wind,Latitude,Longitude 2024-06-15 08:00:00,28.5,0.32,2.1,23.45,89.67 2024-06-15 08:00:00,29.1,0.28,1.8,23.48,89.72 ``` -------------------------------- ### Run sDRIPS Execution Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/full_guide/cli.md Executes the sDRIPS run with the specified `sdrips_config.yaml` file. This process can take time depending on the size of the shapefile as assets are exported to Google Earth Engine. Progress bars indicate the current step and estimated completion time. ```bash sdrips run -c config_files/sdrips_config.yaml ``` -------------------------------- ### Generate Command Area Config CLI Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/cli.md This command generates a YAML configuration file for command areas. It takes the path to a vector dataset, the name of the attribute column containing command area identifiers, a default planting date, a default crop type, and an output file path as input. Shapefile format is recommended for easy integration with Google Earth Engine. ```bash python -m sdrips.cmd_config -s "../../Shapefiles/cmd_area_wgs/Teesta_Command_Areas.shp" -c "CNLNM" -d 2025-07-07 -cc Rice -o '../Data/cmd_config.yaml' ``` -------------------------------- ### Create Command Area Configuration Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/full_guide/cli.md Generates the `ca_config.yaml` file required for sDRIPS command area processing. It requires the path to the command area shapefile, the column name containing unique IDs, the planting date, and the crop type. For help with input parameters, use the -h flag. ```python python -m sdrips.cmd_config -s "Shapefiles/TBP_Command_Area/commandarea_teesta_ph1_simplified_modified_Irrigable_Area_Final.shp" -c CNLNM_ID -d 2023-01-15 -cc Rice ``` -------------------------------- ### Initialize Earth Engine Source: https://context7.com/uw-saswe/sdrips/llms.txt Initializes the Google Earth Engine (GEE) environment using a service account and key file. This is a prerequisite for using GEE functionalities within the project. Requires service account credentials and a key file path. ```python from sdrips.utils.ee_utils import initialize_earth_engine import ee initialize_earth_engine( service_account='my-account@project.iam.gserviceaccount.com', key_file='gee-key.json' ) ``` -------------------------------- ### Execute Full sDRIPS Workflow (CLI) Source: https://context7.com/uw-saswe/sdrips/llms.txt Initiate the complete sDRIPS irrigation advisory workflow from the command line. This command requires a path to the main configuration file. ```bash # Command-line execution sdrips run --config config_files/sdrips_config.yaml ``` -------------------------------- ### Get Growth Kc Value Source: https://context7.com/uw-saswe/sdrips/llms.txt Retrieves the Kc (crop coefficient) value for a specific growth day based on provided crop coefficients. It handles both constant stages and linear interpolation between defined values. Takes the coefficients and the number of growth days as input. ```python from sdrips.utils.utils import get_growth_kc # Example for interpolated value # Assuming 'coefficients' is loaded from read_crop_coefficients c_value = get_growth_kc(coefficients, num_days=35) # Example for constant stage c_value_early = get_growth_kc(coefficients, num_days=15) ``` -------------------------------- ### Add New Crop Configuration in YAML Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Configuration/crop_config.md This YAML snippet illustrates the syntax for adding a new crop to the configuration file. It specifies how to define Kc values using either a constant rate or a linear progression over a defined number of days, allowing for custom crop entries. ```yaml CropName: "startDay-endDay": value # Constant value "startDay-endDay": [linear, startVal, endVal, duration] # Linear progression over 'duration' days - startVal: value at the beginning of the stage - endVal: value at the end of the stage - durationDays: number of days over which the value increases/decreases linearly Example of adding a new crop: Crop_XXXX: "0-28": 0.51 "29-56": [linear, 0.51, 1.29, 28] "57-112": 1.29 "113-119": [linear, 1.29, 0.52, 7] "120-140": 0.52 ``` -------------------------------- ### Authenticate Google Earth Engine (Python) Source: https://context7.com/uw-saswe/sdrips/llms.txt Perform interactive authentication for Google Earth Engine (GEE) using OAuth. This method opens a browser window for user authorization. After authentication, the GEE client is initialized with the specified project ID. ```python import ee ee.Authenticate() # Opens browser for OAuth ee.Initialize(project='my-gee-project') ``` -------------------------------- ### Generate Command Area Polygons with CLI Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/cmd_area_creation/cli.md This command generates command-area polygons around a canal/line network. It uses an iterative buffer process to match each polygon to a target area. Requires input shapefile, target area column name, and an output shapefile path. ```bash python -m sdrips.cmd_area_creation -s '../../Shapefiles/canal_network/Irrigation_Canal_Networks.shp' -c "CMD_Ar_m2" -o '../Data/created_cmd_area/created_cmd_area.shp' ``` -------------------------------- ### Print Generated Configuration File Path Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/Creating_CMD_Config.ipynb Prints the path to the generated command area configuration YAML file. This confirms the location where the output file has been saved. ```python print(ca_path) ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Development/Developer_Version.md Stages changes, commits them with a descriptive message, and pushes the feature branch to the remote repository. Replace '' with the actual file names. ```bash git add git commit -m "Adding XXXXX functionality" git push origin feature/my-new-module ``` -------------------------------- ### Check run_cmd_config Function Signature and Docstring Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/Creating_CMD_Config.ipynb Displays the signature and docstring of the 'run_cmd_config' function, which outlines its parameters, their types, default values, and a detailed explanation of its functionality, inputs, and outputs. This helps in understanding how to use the function effectively. ```python run_cmd_config? ``` -------------------------------- ### Generate Command Area Configuration from Vector Data Source: https://context7.com/uw-saswe/sdrips/llms.txt Generates a YAML configuration file for command areas using Python. It takes a vector data file (Shapefile, GeoJSON, GeoPackage) as input and allows specifying default crop, planting date, soil, and distribution uniformity parameters. A CLI equivalent is also provided. ```python from sdrips.cmd_config import run_cmd_config from pathlib import Path # Generate config from shapefile output_path = run_cmd_config( shp_path='Shapefiles/command_areas.shp', column_name='AREA_ID', # Column with unique command area identifiers default_planting_date='2024-04-15', # ISO format YYYY-MM-DD default_crop_type='Rice', # Options: Rice, Wheat, Corn, Sugarcane, Potato, Lentils, Eggplant default_soil_coef=0.5, # Soil coefficient (0.3-0.7) default_distribution_unif=0.85, # Irrigation efficiency (0.7-1.0) output_path='config_files/ca_config.yaml' ) print(f"Configuration created at: {output_path}") # CLI equivalent # python -m sdrips.cmd_config -s Shapefiles/command_areas.shp -c AREA_ID \ # -d 2024-04-15 -cc Rice -sc 0.5 -du 0.85 -o config_files/ca_config.yaml ``` -------------------------------- ### Execute Full sDRIPS Workflow (Python) Source: https://context7.com/uw-saswe/sdrips/llms.txt Programmatically run the entire sDRIPS irrigation advisory workflow using the `run_sdrips` function. This function takes the path to the configuration file as an argument. ```python # Programmatic execution from sdrips.run_sdrips import run_sdrips # Execute full workflow run_sdrips('config_files/sdrips_config.yaml') ``` -------------------------------- ### Run sDRIPS Test Suite Locally Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Development/Developer_Version.md Executes the sDRIPS test suite to ensure that your changes do not introduce regressions. This command requires the test directory to be specified. ```bash python src/sdrips/cli/sdrips_test.py -d ./tests/ ``` -------------------------------- ### Inspect create_cmd_area Function Signature and Docstring (Python) Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/cmd_area_creation/Creating_CMD_Config.ipynb This snippet shows how to inspect the `create_cmd_area` function to understand its input parameters, their types, and the function's purpose. The docstring provides detailed information on the function's behavior, parameters, and limitations, emphasizing that the output command areas are estimations and should be used with caution. ```python create_cmd_area? ``` -------------------------------- ### Integrate Weather Stations for Forcings (YAML) Source: https://context7.com/uw-saswe/sdrips/llms.txt Configuration file for integrating a network of local weather stations. Specifies which meteorological variables to use from stations, their names, shapefile location, and interpolation methods. ```yaml Weather_station_integration: true Weather_station_integration_config: air_temperature_station: true air_temperature_variable: 'Temp_C' wind_speed_station: true wind_speed_variable: 'Wind_ms' precipitation_station: true precipitation_variable: 'Precip_mm' weather_station_shp_file: Shapefiles/weather_stations.shp weather_station_feature_name: STATION_ID EPSG_code: 'EPSG:4326' weather_station_data_path: WeatherData/stations.csv interpolation_method: idw ``` -------------------------------- ### Process Command Areas in Parallel for ET Estimation Source: https://context7.com/uw-saswe/sdrips/llms.txt Fetches Landsat imagery, applies SEBAL and Penman-Monteith algorithms to estimate actual and reference ET, calculates net irrigation, and exports results. It requires a configuration file and utilizes Google Earth Engine and GFS meteorological data. ```python from sdrips.processing import process_cmd_area_parallel from sdrips.logging_utils import setup_logger from multiprocessing import Queue log_queue = Queue() logger = setup_logger(log_queue=log_queue, log_level='INFO') process_cmd_area_parallel( config_path='config_files/sdrips_config.yaml', main_logger=logger, log_queue=log_queue, cores=4 # Number of parallel workers ) ``` -------------------------------- ### Load and Inspect Canal Network Data (Python) Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/cmd_area_creation/Creating_CMD_Config.ipynb Loads a canal network shapefile using GeoPandas and displays the first few rows of the dataframe. This step is crucial for understanding the input data, including geometry types (e.g., LINESTRING) and attribute columns like 'CMD_Ar_m2', which will be used to determine the target area for buffering. ```python shp_path = '../../Shapefiles/canal_network/Irrigation_Canal_Networks.shp' f = gpd.read_file(shp_path) f.head() ``` -------------------------------- ### Visualize Canal Network Data (Python) Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/cmd_area_creation/Creating_CMD_Config.ipynb Visualizes the loaded canal network data using GeoPandas' `explore` method, which integrates with Folium to create interactive maps. This helps in geographically understanding the canal network before generating command areas. ```python f.explore() ``` -------------------------------- ### Integrate Weather Stations for Forcings (Python) Source: https://context7.com/uw-saswe/sdrips/llms.txt Python script to execute the weather station integration process within sDRIPS. This function uses the configuration to ingest weather station data, interpolate it, and improve meteorological forcings for ET calculations. ```python from sdrips.stn_corr_evapotranspiration import process_cmd_area_stn_parallel # Run ET with weather station integration process_cmd_area_stn_parallel( config_path='config_files/sdrips_config.yaml', main_logger=logger, log_queue=log_queue, cores=4 ) ``` -------------------------------- ### Configure GEE and IMERG Credentials (YAML) Source: https://context7.com/uw-saswe/sdrips/llms.txt Store sensitive credentials for Google Earth Engine (GEE) service accounts and IMERG precipitation data access. The GEE configuration requires the service account email and the path to the private key file. IMERG credentials include username and password. ```yaml # config_files/secrets.yaml GEE_Service_Account: service_account: "my-service-account@project.iam.gserviceaccount.com" key_path: "path/to/gee-service-account-key.json" IMERG_Credentials: username: "my_imerg_username" password: "my_imerg_password" ``` -------------------------------- ### YAML Configuration for IMERG Precipitation Links Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Configuration/config_links.md This snippet defines the structure for managing base URLs and file naming patterns for IMERG precipitation data. It includes base URL categories (before, year, after) and file name components (prefix, suffix) used by the pipeline to access data. ```yaml precipitation: base_urls: before: "https://jsimpsonhttps.pps.eosdis.nasa.gov/imerg/gis/early/" year: "https://jsimpsonhttps.pps.eosdis.nasa.gov/imerg/gis/" after: "https://jsimpsonhttps.pps.eosdis.nasa.gov/imerg/gis/early/" file_pattern: prefix: "3B-HHR-E.MS.MRG.3IMERG." suffix: "-S233000-E235959.1410.V07B.1day.tif" ``` -------------------------------- ### Generate Command Area Configuration YAML Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/Creating_CMD_Config.ipynb Executes the 'run_cmd_config' function to generate a YAML configuration file. It specifies the input Shapefile path, the column containing command area names, default planting date, default crop type, and the desired output path for the YAML file. The function returns the path to the generated file. ```python ca_path = run_cmd_config(shp_path = '../../Shapefiles/cmd_area_wgs/Teesta_Command_Areas.shp',column_name = 'CNLNM', default_planting_date = '2025-07-07', default_crop_type='Wheat', output_path='../Data/cmd_config.yaml') ``` -------------------------------- ### Load YAML Configuration Source: https://context7.com/uw-saswe/sdrips/llms.txt Loads YAML configuration files programmatically. This function is essential for reading settings and parameters used throughout the SDrips project. It takes a file path as input and returns a dictionary representing the configuration. ```python from sdrips.utils.utils import load_yaml_config config = load_yaml_config('config_files/sdrips_config.yaml') print(config['Date_Running']['start_date']) ``` -------------------------------- ### Evapotranspiration Estimation (Python) Source: https://context7.com/uw-saswe/sdrips/llms.txt Initiate the parallel processing of command areas to estimate Penman-Monteith and SEBAL evapotranspiration (ET). This function requires a logging queue for inter-process communication and a logger instance. ```python from sdrips.evapotranspiration import process_cmd_area_parallel import logging from multiprocessing import Queue # Setup logging queue for multiprocessing log_queue = Queue() logger = logging.getLogger(__name__) ``` -------------------------------- ### Configure sDRIPS Module Toggles Source: https://context7.com/uw-saswe/sdrips/llms.txt Enable or disable various modules within the sDRIPS workflow. This includes ET estimation, precipitation consideration, weather forecasts, percolation analysis, and region statistics. A 'Clean_Directory' option is also available to clear previous outputs. ```yaml Run_ET_Estimation: et_estimation: true Precipitation_Config: consider_preciptation: true imerg_user: myusername # From secrets.yaml imerg_pass: mypassword # From secrets.yaml Weather_Config: consider_forecasted_weather: true forecast_hours: 168 # 7-day forecast Percolation_Config: consider_percolation: true field_capacity_threshold: 0.3 Region_stats: estimate_region_stats: true Clean_Directory: clear_directory_condition: false # Clear previous outputs before running ``` -------------------------------- ### Read Crop Coefficients Source: https://context7.com/uw-saswe/sdrips/llms.txt Reads crop coefficients from a YAML configuration file for a specified crop. It can return specific values or ranges, and supports interpolation for growth stages. Requires a crop configuration file and the crop name. ```python from sdrips.utils.utils import read_crop_coefficients coefficients = read_crop_coefficients( config_path='config_files/crop_config.yaml', crop='Rice' ) ``` -------------------------------- ### YAML Configuration for Command Area Settings Source: https://github.com/uw-saswe/sdrips/blob/main/docs/Configuration/command_area_config.md Defines default and specific command area parameters like planting date, crop type, soil coefficient, and water distribution efficiency. The 'use_default' flag controls whether individual command area settings are applied or if default values are used. ```yaml DEFAULT: use_default: true planting_date: '2023-01-15' crop_type: Rice soil_coef: 0.5 distribution_unif: 1.0 Teesta_Canal_A_1: use_default: false planting_date: '2023-01-15' crop_type: Rice soil_coef: 0.5 distribution_unif: 1.0 T1T_2: use_default: false planting_date: '2023-01-15' crop_type: Rice soil_coef: 0.5 distribution_unif: 1.0 ``` -------------------------------- ### Configure Crop Coefficients (YAML) Source: https://context7.com/uw-saswe/sdrips/llms.txt Define crop-specific growth stage coefficients for evapotranspiration (ET) estimation. Supports constant values or linear interpolation between defined stages. The format is 'stage_days': coefficient or [interpolation_type, start_coefficient, end_coefficient, duration_days]. ```yaml # config_files/crop_config.yaml Rice: "0-20": 1.1 # Constant Kc for days 0-20 "21-45": [linear, 1.1, 1.4, 25] # Linear from 1.1 to 1.4 over 25 days "46-105": 1.4 # Peak growth stage "106-115": [linear, 1.4, 1.0, 10] # Senescence "116-140": 1.0 # Late season Wheat: "0-28": 0.5 "29-56": [linear, 0.5, 1.15, 28] "57-112": 1.15 "113-119": [linear, 1.15, 0.7, 7] "120-140": 0.7 Corn: "0-18": 0.4 "19-54": [linear, 0.4, 1.1, 36] "55-96": 1.1 "97-120": [linear, 1.1, 0.6, 24] Potato: "0-20": [linear, 0.4, 0.7, 20] "21-60": [linear, 0.7, 1.15, 40] "61-80": 1.15 "81-120": [linear, 1.15, 0.6, 40] Sugarcane: "0-30": 0.4 "31-90": [linear, 0.4, 1.25, 60] "91-270": 1.25 "271-365": [linear, 1.25, 0.75, 95] ``` -------------------------------- ### Upload Shapefile to Earth Engine Source: https://context7.com/uw-saswe/sdrips/llms.txt Uploads a shapefile to Google Earth Engine as an asset. This allows for geospatial data to be processed within GEE. Requires the path to the shapefile, an asset folder, asset name, and GEE authentication details. ```python from sdrips.utils.ee_utils import upload_shapefile_to_ee asset_id = upload_shapefile_to_ee( shp_path='Shapefiles/command_areas.shp', asset_folder='users/myaccount', asset_name='my_command_areas', service_account='my-account@project.iam.gserviceaccount.com', key_path='gee-key.json' ) print(f"Uploaded to: {asset_id}") ``` -------------------------------- ### Download GFS Weather Forecast Data Source: https://context7.com/uw-saswe/sdrips/llms.txt Downloads GFS weather forecast data, supporting both recent data from NOAA servers and historical data from Google Earth Engine. It allows specifying date ranges, geographical bounds, forecast hours, and desired meteorological variables. ```python from sdrips.gfs_processing import gfsdata, gfsdata_noaa, gfsdata_ee from datetime import datetime import ee ee.Initialize() # Automatic source selection based on date gfsdata('config_files/sdrips_config.yaml') # Recent data from NOAA server (last 10 days) gfsdata_noaa( start_date='2024-06-15', leftlon=88.5, rightlon=92.5, toplat=26.5, bottomlat=22.0, forecast_hours=168, # 7-day forecast save_data_loc='Data/', variable='precipitable_water_entire_atmosphere' ) # Historical data from Google Earth Engine (>10 days old) gfsdata_ee( start_date='2024-05-01', leftlon=88.5, rightlon=92.5, toplat=26.5, bottomlat=22.0, forecast_hours=168, save_data_loc='Data/', variable='total_precipitation_surface', service_account='myaccount@project.iam.gserviceaccount.com', key_path='gee-key.json' ) ``` -------------------------------- ### Integrate In-situ Sensors for Bias Correction (YAML) Source: https://context7.com/uw-saswe/sdrips/llms.txt Configuration file for integrating ground-based soil moisture and weather sensors. Enables specific sensors, maps them to variables, specifies data sources, and defines interpolation methods for bias correction. ```yaml # config_files/sdrips_config.yaml Insitu_Sensor_integration: true Insitu_Sensor_integration_config: air_temperature_sensor: true air_temperature_variable: 'Temperature' soil_moisture_sensor: true soil_moisture_variable: 'Water Content' wind_speed_sensor: true wind_speed_variable: 'Wind' specific_humidity_sensor: false specific_humidity_variable: 'Specific Humidity' hub_url: "https://my-sensor-hub.com/data/" date_regex: "(\d{4}_\d{2}_\d{2})" date_format: "%Y_%m_%d" sensor_data_path: "SensorData/" interpolation_method: kriging # Options: best, average, idw, kriging, nearest_neighbor ``` -------------------------------- ### Download and Process IMERG Precipitation Data Source: https://context7.com/uw-saswe/sdrips/llms.txt Downloads daily IMERG precipitation GeoTIFFs, clips them to specified bounds, resamples to a desired resolution, and aggregates daily data into weekly cumulative totals. It handles authentication with NASA GESDISC credentials and can process data for a specific day or download a range. ```python from sdrips.precipitation import imergprecip, process_day, compute_weekly_cummulative_precip from datetime import date, timedelta from pathlib import Path # Download 7 days of IMERG data imergprecip('config_files/sdrips_config.yaml') # Manual single-day processing success = process_day( date=date(2024, 6, 15), bounds=(88.5, 22.0, 92.5, 26.5), # (left, bottom, right, top) in EPSG:4326 save_data_loc='Data/', imerg_username='myusername', imerg_password='mypassword', precip_links_base_url={ 'before': 'https://gpm1.gesdisc.eosdis.nasa.gov/data/GPM_L3/GPM_3IMERGDF.07/', 'year': 'https://gpm1.gesdisc.eosdis.nasa.gov/data/GPM_L3/GPM_3IMERGDF.07/', 'after': 'https://gpm1.gesdisc.osa.gov/data/GPM_L3/GPM_3IMERGDF.07/' }, suffix='.tif', prefix='3B-DAY.MS.MRG.3IMERG.' ) # Aggregate weekly cumulative precipitation file_paths = [ Path('Data/precip/global.precip.imerg.20240615.tif'), Path('Data/precip/global.precip.imerg.20240616.tif') # ... 7 days total ] compute_weekly_cummulative_precip( file_paths=file_paths, output_path=Path('Data/precip/precip.currentweek.tif') ) ``` -------------------------------- ### Integrate In-situ Sensors for Bias Correction (Python) Source: https://context7.com/uw-saswe/sdrips/llms.txt Python script to execute the sensor integration process within sDRIPS. This function utilizes the configuration file to process sensor data, perform bias correction, and recalculate ET. ```python from sdrips.sen_corr_evapotranspiration import process_cmd_area_sensor_parallel # Run ET with sensor correction process_cmd_area_sensor_parallel( config_path='config_files/sdrips_config.yaml', main_logger=logger, log_queue=log_queue, cores=4 ) ``` -------------------------------- ### Import Command Config Module in Python Source: https://github.com/uw-saswe/sdrips/blob/main/docs/tutorials/config_files/Creating_CMD_Config.ipynb Imports the 'run_cmd_config' function from the 'sdrips.cmd_config' module. This function is used to generate YAML configuration files for command areas. ```python from sdrips.cmd_config import run_cmd_config ```