USGS-R / NWCEd

A Repository for Educational Materials Based on the National Water Census Data Resources Portal
http://cida.usgs.gov/nwc/
Other
4 stars 5 forks source link

Problem pulling in streamflow data #14

Closed jnelson7 closed 8 years ago

jnelson7 commented 8 years ago

I'm not sure where the issue is at, but this is a line of code from the original script.

https://github.com/NWCEd/NWCEd/blob/master/R/getNWCData.R#L15

Please let me know if you are needing anything more specific.

dblodgett-usgs commented 8 years ago

I get:

> library(NWCEd)
> NWCdata<-getNWCData(huc="160202030505", local = FALSE)
> names(NWCdata)
[1] "et"         "prcp"       "streamflow"
> names(NWCdata$streamflow)
[1] "agency_cd"        "site_no"          "Date"             "data_00060_00003" "cd_00060_00003" 
> summary(NWCdata$streamflow$data_00060_00003)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
    0.0    38.0   125.5   192.3   281.0  2420.0       7 
> length(NWCdata$streamflow$data_00060_00003)
[1] 29897

Do you get the same? I suspect the issue is that you are expecting the streamflow for NWIS data to be the same as the streamflow from HUCs with modeled streamflow in the south east US.

Going to a SE HUC I get:

> NWCdata<-getNWCData(huc="031601030306", local = FALSE)
> names(NWCdata)
[1] "et"         "prcp"       "streamflow"
> names(NWCdata$streamflow)
[1] "date" "data"
> summary(NWCdata$streamflow$data)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
   17.05   192.60   435.50   855.70   966.40 36080.00 
> length(NWCdata$streamflow$data)
[1] 10957

Is this the case? If so, you can either handle the different responses (probably a good way to go) or we can return the same column name whether it's NWIS observed or modeled... I'd rather handle the observed/modeled explicitly so plots can say it's observed or modeled, etc. Make sense?

jnelson7 commented 8 years ago

I'm getting it now. I was not including the "local = false" portion. When doing that the streamflow dataset came in.

My apologies for the trouble.

Thank you for your help!

On Tue, Aug 2, 2016 at 6:26 PM, David Blodgett notifications@github.com wrote:

I get:

library(NWCEd) NWCdata<-getNWCData(huc="160202030505", local = FALSE) names(NWCdata) [1] "et" "prcp" "streamflow" names(NWCdata$streamflow) [1] "agency_cd" "site_no" "Date" "data_00060_00003" "cd_00060_00003" summary(NWCdata$streamflow$data_00060_00003) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 0.0 38.0 125.5 192.3 281.0 2420.0 7 length(NWCdata$streamflow$data_00060_00003) [1] 29897

Do you get the same? I suspect the issue is that you are expecting the streamflow for NWIS data to be the same as the streamflow from HUCs with modeled streamflow in the south east US.

Going to a SE HUC I get:

NWCdata<-getNWCData(huc="031601030306", local = FALSE) names(NWCdata) [1] "et" "prcp" "streamflow" names(NWCdata$streamflow) [1] "date" "data" summary(NWCdata$streamflow$data) Min. 1st Qu. Median Mean 3rd Qu. Max. 17.05 192.60 435.50 855.70 966.40 36080.00 length(NWCdata$streamflow$data) [1] 10957

Is this the case? If so, you can either handle the different responses (probably a good way to go) or we can return the same column name whether it's NWIS observed or modeled... I'd rather handle the observed/modeled explicitly so plots can say it's observed or modeled, etc. Make sense?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NWCEd/NWCEd/issues/14#issuecomment-237092749, or mute the thread https://github.com/notifications/unsubscribe-auth/ARBtw4mcoSfHILFlYZToIMGhfNlsExOBks5qb-AfgaJpZM4JbFwX .

Jake Nelson

dblodgett-usgs commented 8 years ago

That would do it! No problem. Glad we got it figured.