Skip to content

saminab/Nutrientflux_Project

Repository files navigation

Nutrient Flux Project

This notebook is part of a project designed to estimate nutrient flux to Lake Huron as a contribution to the Great Lakes nutrient management efforts.

More details can be found on the following github Web page https://saminab.github.io/Nutrientflux_Project/

Workflow Overview:

The project processes are divided into two environments:

  1. Linux Subsystem:

    • Used for particle tracking and indirect nutrient estimations.
  2. Windows ArcPy Environment:

    • Facilitates geospatial analysis and watershed delineation tasks.

Focus: Direct Nutrient Load

This notebook covers the direct nutrient load estimation process, which includes:

1. Coastal Watershed Creation:

  • Input Data:
    • Coastal wetlands shapefiles (from MTRI) representing four main inundation zones.
    • Great Lakes basin streams and D8 flow direction data.
  • Steps:
    1. Identify and separate streams draining directly to the coastal wetlands.
    2. Use D8 flow direction to delineate watersheds for coastal wetlands.
    3. Remove overlapping regions between coastal and stream watersheds for accuracy.

Output Data

  • Watershed shapefiles representing refined coastal watersheds.
  • Data ready for further analysis of nutrient loading pathways. This notebook plays a critical role in supporting the accurate quantification of direct nutrient loads to Lake Huron.

2.ZonalStats notebook

The Zonal Stats code calculates spatial statistics for defined zones within the Great Lakes coastal watersheds. Using geospatial data, the script aggregates environmental and hydrological metrics, such as mean values, sums, and area-weighted averages, over each watershed. The key inputs include:

Watershed zones derived from previous coastal watershed delineation. The outputs are tables or geospatial files containing the aggregated statistics, which can be used for further analysis of nutrient flux

Focus: Indirect Nutrient load

This section calculates the nutrient load from the return of currents to coastal wetlands using particle tracking within currents generated by an open-water circulation model, part of NOAA's Great Lakes Coastal Wetland Forecasting System. The process on this section was on Linux subsystem.

1_Create_Initial_Position_multigroup.ipynb: This code generates position files within watersheds draining into the lake and assigns a number called group_id to identify the watersheds.

Following is showing the outputs of initial positions to Great lake Huron

2_PT_senseflux_intersectpoint.ipynb: Uses particle tracking to identify the path of particles through currents.

3_addgroup_number.ipynb: In addition to group_id, we need another identifier to track points within each watershed, as there are multiple points within each group_id. This code adds the group_number to the output of particle tracking.

4_PT_FirstInteraction.ipynb: This code estimates how many particles intersect with the first coastal wetland.

Some notes For Andrew:

For Snakemake: I implemented Snakemake for three of my workflows in the IndirectNutrientLoad directory. However, the first workflow in this directory is a mix of running in the Linux subsystem and Python with ArcPy, which requires Windows. This made it impossible to use Snakemake for that workflow. I generated some DAG images to demonstrate that I am able to run Snakemake for the workflows I have set up.

Testing Functions with Pytest: I created a test directory in IndirectNutrientLoad and used it to test one of the functions I wrote to add a group_number in my NetCDF files. I couldn't test all of my functions because they require more complex inputs, which made testing trickier. However, I plan to improve the robustness of these functions to make them faster and easier to use throughout the workflow.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published