Yampa River Freshwater Decarbonization

Gray or Green Infrastructure

The Yampa River in northwest Colorado is one of the few free-flowing rivers in the western United States and a major tributary of the Colorado River. Virridy is monitoring water quality and applying our patent data-science technologies along a 40 mile stretch of the river, measuring how the organic loading in the river is impacted by agriculture, ranches, towns and wastewater utilities.

Virridy is working with several utilities along this stretch of river to identify how nature-based watershed restoration projects could improve river water quality, and avoid the construction of expensive, greenhouse gas emitting wastewater treatment plant upgrades, while generating carbon credits to subsidize the watershed solutions.

In-Situ Sensor Data

ML Semi Quantification Model

  selected_sensor selected_lab
1       Turbidity    Turbidity
Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 

Confusion Matrix and Statistics

          Reference
Prediction [-Inf,6) [6, Inf]
  [-Inf,6)       62       11
  [6, Inf]        5       40
                                           
               Accuracy : 0.8644           
                 95% CI : (0.7892, 0.9205) 
    No Information Rate : 0.5678           
    P-Value [Acc > NIR] : 0.000000000003656
                                           
                  Kappa : 0.7198           
                                           
 Mcnemar's Test P-Value : 0.2113           
                                           
            Sensitivity : 0.9254           
            Specificity : 0.7843           
         Pos Pred Value : 0.8493           
         Neg Pred Value : 0.8889           
             Prevalence : 0.5678           
         Detection Rate : 0.5254           
   Detection Prevalence : 0.6186           
      Balanced Accuracy : 0.8548           
                                           
       'Positive' Class : [-Inf,6)         
                                           

Confusion Matrix and Statistics

          Reference
Prediction  0  1
         0 55 11
         1  6 46
                                              
               Accuracy : 0.8559              
                 95% CI : (0.7794, 0.9138)    
    No Information Rate : 0.5169              
    P-Value [Acc > NIR] : 0.000000000000008229
                                              
                  Kappa : 0.7107              
                                              
 Mcnemar's Test P-Value : 0.332               
                                              
            Sensitivity : 0.8070              
            Specificity : 0.9016              
         Pos Pred Value : 0.8846              
         Neg Pred Value : 0.8333              
             Prevalence : 0.4831              
         Detection Rate : 0.3898              
   Detection Prevalence : 0.4407              
      Balanced Accuracy : 0.8543              
                                              
       'Positive' Class : 1                   
                                              

`geom_smooth()` using method = 'loess' and formula = 'y ~ x'

  selected_sensor selected_lab
2    Conductivity Conductivity

Confusion Matrix and Statistics

            Reference
Prediction   [-Inf,200) [200, Inf]
  [-Inf,200)         25          3
  [200, Inf]          6         90
                                          
               Accuracy : 0.9274          
                 95% CI : (0.8667, 0.9663)
    No Information Rate : 0.75            
    P-Value [Acc > NIR] : 0.0000002994    
                                          
                  Kappa : 0.8             
                                          
 Mcnemar's Test P-Value : 0.505           
                                          
            Sensitivity : 0.8065          
            Specificity : 0.9677          
         Pos Pred Value : 0.8929          
         Neg Pred Value : 0.9375          
             Prevalence : 0.2500          
         Detection Rate : 0.2016          
   Detection Prevalence : 0.2258          
      Balanced Accuracy : 0.8871          
                                          
       'Positive' Class : [-Inf,200)      
                                          

Confusion Matrix and Statistics

          Reference
Prediction  0  1
         0 26  3
         1  5 90
                                          
               Accuracy : 0.9355          
                 95% CI : (0.8768, 0.9717)
    No Information Rate : 0.75            
    P-Value [Acc > NIR] : 0.00000006738   
                                          
                  Kappa : 0.8242          
                                          
 Mcnemar's Test P-Value : 0.7237          
                                          
            Sensitivity : 0.9677          
            Specificity : 0.8387          
         Pos Pred Value : 0.9474          
         Neg Pred Value : 0.8966          
             Prevalence : 0.7500          
         Detection Rate : 0.7258          
   Detection Prevalence : 0.7661          
      Balanced Accuracy : 0.9032          
                                          
       'Positive' Class : 1               
                                          

`geom_smooth()` using method = 'loess' and formula = 'y ~ x'

  selected_sensor selected_lab
3            FDOM          TOC

Confusion Matrix and Statistics

          Reference
Prediction [-Inf,5) [5, Inf]
  [-Inf,5)       32        7
  [5, Inf]        9       82
                                         
               Accuracy : 0.8769         
                 95% CI : (0.8078, 0.928)
    No Information Rate : 0.6846         
    P-Value [Acc > NIR] : 0.000000287    
                                         
                  Kappa : 0.7112         
                                         
 Mcnemar's Test P-Value : 0.8026         
                                         
            Sensitivity : 0.7805         
            Specificity : 0.9213         
         Pos Pred Value : 0.8205         
         Neg Pred Value : 0.9011         
             Prevalence : 0.3154         
         Detection Rate : 0.2462         
   Detection Prevalence : 0.3000         
      Balanced Accuracy : 0.8509         
                                         
       'Positive' Class : [-Inf,5)       
                                         

Confusion Matrix and Statistics

          Reference
Prediction  0  1
         0 39 14
         1  2 75
                                         
               Accuracy : 0.8769         
                 95% CI : (0.8078, 0.928)
    No Information Rate : 0.6846         
    P-Value [Acc > NIR] : 0.000000287    
                                         
                  Kappa : 0.7358         
                                         
 Mcnemar's Test P-Value : 0.00596        
                                         
            Sensitivity : 0.8427         
            Specificity : 0.9512         
         Pos Pred Value : 0.9740         
         Neg Pred Value : 0.7358         
             Prevalence : 0.6846         
         Detection Rate : 0.5769         
   Detection Prevalence : 0.5923         
      Balanced Accuracy : 0.8970         
                                         
       'Positive' Class : 1              
                                         

`geom_smooth()` using method = 'loess' and formula = 'y ~ x'

  selected_sensor selected_lab
4           Chl-a     Kjeldahl

Confusion Matrix and Statistics

            Reference
Prediction   [-Inf,0.3) [0.3, Inf]
  [-Inf,0.3)         88         12
  [0.3, Inf]          5         25
                                          
               Accuracy : 0.8692          
                 95% CI : (0.7989, 0.9219)
    No Information Rate : 0.7154          
    P-Value [Acc > NIR] : 0.00002462      
                                          
                  Kappa : 0.6595          
                                          
 Mcnemar's Test P-Value : 0.1456          
                                          
            Sensitivity : 0.9462          
            Specificity : 0.6757          
         Pos Pred Value : 0.8800          
         Neg Pred Value : 0.8333          
             Prevalence : 0.7154          
         Detection Rate : 0.6769          
   Detection Prevalence : 0.7692          
      Balanced Accuracy : 0.8110          
                                          
       'Positive' Class : [-Inf,0.3)      
                                          

Confusion Matrix and Statistics

          Reference
Prediction  0  1
         0 85  9
         1  8 28
                                          
               Accuracy : 0.8692          
                 95% CI : (0.7989, 0.9219)
    No Information Rate : 0.7154          
    P-Value [Acc > NIR] : 0.00002462      
                                          
                  Kappa : 0.6762          
                                          
 Mcnemar's Test P-Value : 1               
                                          
            Sensitivity : 0.7568          
            Specificity : 0.9140          
         Pos Pred Value : 0.7778          
         Neg Pred Value : 0.9043          
             Prevalence : 0.2846          
         Detection Rate : 0.2154          
   Detection Prevalence : 0.2769          
      Balanced Accuracy : 0.8354          
                                          
       'Positive' Class : 1               
                                          

`geom_smooth()` using method = 'loess' and formula = 'y ~ x'

USGS Stream Temperature Data

These are the existing USGS stream temperature monitoring stations.

Yampa River Steamboat Springs Reach

IDW Interpolation

IDW Shiny App

Urban Sky Land Cover Image Analysis

You have loaded FedData v4.
As of FedData v4 we have retired
dependencies on the `sp` and `raster` packages.
All functions in FedData v4 return `terra` (raster)
or `sf` (vector) objects by default, and there may be
other breaking changes.
The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
which was just loaded, will retire in October 2023.
Please refer to R-spatial evolution reports for details, especially
https://r-spatial.org/r/2023/05/15/evolution4.html.
It may be desirable to make the sf package available;
package maintainers should consider adding sf to Suggests:.
The sp package is now running under evolution status 2
     (status 2 uses the sf package in place of rgdal)

Attaching package: 'rasterVis'
The following object is masked from 'package:gam':

    gplot
Loading required package: sp
Please note that rgdal will be retired during 2023,
plan transition to sf/stars/terra functions using GDAL and PROJ
at your earliest convenience.
See https://r-spatial.org/r/2022/04/12/evolution.html and https://github.com/r-spatial/evolution
rgdal: version: 1.6-5, (SVN revision 1199)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.5.3, released 2022/10/21
Path to GDAL shared files: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/rgdal/gdal
 GDAL does not use iconv for recoding strings.
GDAL binary built with GEOS: TRUE 
Loaded PROJ runtime: Rel. 9.1.0, September 1st, 2022, [PJ_VERSION: 910]
Path to PROJ shared files: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/rgdal/proj
PROJ CDN enabled: FALSE
Linking to sp version:1.6-0
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.

Attaching package: 'reshape2'
The following object is masked from 'package:tidyr':

    smiths
The following objects are masked from 'package:data.table':

    dcast, melt
terra 1.7.39

Attaching package: 'terra'
The following object is masked from 'package:scales':

    rescale
The following object is masked from 'package:rgdal':

    project
The following object is masked from 'package:tidyr':

    extract
The following object is masked from 'package:ggpubr':

    rotate
The following object is masked from 'package:data.table':

    shift
Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE

Attaching package: 'tidyterra'
The following object is masked from 'package:kableExtra':

    group_rows
The following object is masked from 'package:raster':

    select
The following object is masked from 'package:stats':

    filter

# A tibble: 20 × 4
      ID Class                        Color   Description                       
   <dbl> <chr>                        <chr>   <chr>                             
 1    11 Open Water                   #5475A8 Areas of open water, generally wi…
 2    12 Perennial Ice/Snow           #FFFFFF Areas characterized by a perennia…
 3    21 Developed, Open Space        #E8D1D1 Areas with a mixture of some cons…
 4    22 Developed, Low Intensity     #E29E8C Areas with a mixture of construct…
 5    23 Developed, Medium Intensity  #ff0000 Areas with a mixture of construct…
 6    24 Developed High Intensity     #B50000 Highly developed areas where peop…
 7    31 Barren Land (Rock/Sand/Clay) #D2CDC0 Areas of bedrock, desert pavement…
 8    41 Deciduous Forest             #85C77E Areas dominated by trees generall…
 9    42 Evergreen Forest             #38814E Areas dominated by trees generall…
10    43 Mixed Forest                 #D4E7B0 Areas dominated by trees generall…
11    51 Dwarf Scrub                  #AF963C Alaska only areas dominated by sh…
12    52 Shrub/Scrub                  #DCCA8F Areas dominated by shrubs; less t…
13    71 Grassland/Herbaceous         #FDE9AA Areas dominated by gramanoid or h…
14    72 Sedge/Herbaceous             #D1D182 Alaska only areas dominated by se…
15    73 Lichens                      #A3CC51 Alaska only areas dominated by fr…
16    74 Moss                         #82BA9E Alaska only areas dominated by mo…
17    81 Pasture/Hay                  #FBF65D Areas of grasses, legumes, or gra…
18    82 Cultivated Crops             #CA9146 Areas used for the production of …
19    90 Woody Wetlands               #C8E6F8 Areas where forest or shrubland v…
20    95 Emergent Herbaceous Wetlands #64B3D5 Areas where perennial herbaceous …

Reading layer `WBDHU12' from data source 
  `/Users/evanthomas/Dropbox/River ML Share/WBDH12/WBDHU12.shp' 
  using driver `ESRI Shapefile'
Simple feature collection with 4252 features and 20 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: -110.4307 ymin: 35.71326 xmax: -100.677 ymax: 41.98053
Geodetic CRS:  NAD83
                                name        huc12
 1:            Chuck Lewis 1 - Sonde 140500010406
 2:     Downstream Catamount - Sonde 140500010406
 3:       Upstream Catamount - Sonde 140500010406
 4:             Fish Creek 1 - Sonde 140500010407
 5:        Howelsen tunnel 1 - Sonde 140500010409
 6:               Phippsburg - Sonde 140500010107
 7:                    Yampa - Sonde 140500010107
 8: Upstream of Stagecoach 2 - Sonde 140500010107
 9: Upstream of Stagecoach 1 - Sonde 140500010111
10:           Morrison-Yampa - Sonde 140500010111
SpatRaster resampled to ncells = 500262

NTT

#Coordinate with Garrett

Streamflow Analysis