mikejohnson51 / nwmTools

Set of tools to work with National Water Model output
https://mikejohnson51.github.io/nwmTools/
Creative Commons Zero v1.0 Universal
18 stars 5 forks source link

Issues with v2.1 data #4

Closed psavoy closed 2 years ago

psavoy commented 2 years ago

I have been digging into the NWM data over the past few days and I think there may be some issues with the v2.1 data. At first I thought perhaps that it was somehow a units issue, but after poking around more there does not seem to be a consistent bias across all sites that would indicate a units problem.

I attached 3 plots (grey dots are NWIS, orange line is NWM 2.1 and the other lines are NWM v1.2 and v2) that show three different behaviors of the v2.1 data: 1.) no variation, 2.) consistent underestimation, and 3.) consistent overestimation. These were just pulled using readNWMdata and aggregated to daily means for easier plotting. I'm happy to provide follow up or examples or help as I can.

1-no variation

2- little variation

3- high bias

mikejohnson51 commented 2 years ago

Hi @psavoy,

Thanks - you did find an error in my assumptions!! I have updated the index table and will push it shortly to close this issue but for now things are looking aligned (locally) with your example sites:

library(ggplot2)
library(nwmTools)

# Reusable plotting function

plot_data = function(data, ID = NULL) {
  ggplot(data = data) + 
    geom_line(aes(x = dateTime, y = flow_cms_v1.2, color = "v1.2")) + 
    geom_line(aes(x = dateTime, y = flow_cms_v2,   color = "v2.0")) +
    geom_line(aes(x = dateTime, y = flow_cms_v2.1, color = "v2.1")) +
    geom_line(aes(x = dateTime, y = flow_cms_nwis, color = "nwis")) +
    labs(y = 'Flows', x = "DateTime", title = paste0(
      "Model Comparison vs Observation: NWIS-", ID), 
      color ="Model") + 
    theme_bw() +
    theme(legend.position = "bottom")
}

data = readNWMdata(siteID = '01017000', 
            startDate = "2015-01-01",
            endDate = "2016-01-01",
            version = c(1.2, 2.0, 2.1),
            addObs = TRUE)

plot_data(data, data$siteID[1])

data = readNWMdata(siteID = '01017290', 
                   startDate = "2015-01-01",
                   endDate = "2016-01-01",
                   version = c(1.2, 2.0, 2.1),
                   addObs = TRUE)

plot_data(data, data$siteID[1])

data = readNWMdata(siteID = '01073785', 
                   startDate = "2015-01-01",
                   endDate = "2016-01-01",
                   version = c(1.2, 2.0, 2.1),
                   addObs = TRUE)

plot_data(data, data$siteID[1])

Created on 2022-03-29 by the reprex package (v2.0.1)

We did find that 42 seemingly random hours are missing from the NWM record (see #3) these are being addressed and will be undated soon as well.

Thanks for working through the issue and please let me know what else you find,

Mike