Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaNs in FRNG test case #631

Open
jmccreight opened this issue Oct 6, 2015 · 2 comments
Open

NaNs in FRNG test case #631

jmccreight opened this issue Oct 6, 2015 · 2 comments

Comments

@jmccreight
Copy link
Collaborator

This appears to be a domain issue with the front range Route_Link file.
There are 3 reaches with NaNs in the test case 4DAY/NHDPLUS run, for the entire length of the run. These are NOT first order reaches, but there are no points in the domain above them according to the Route_Link file. This is likely the issue.

Here's the analysis in R showing their comIds and the issue with a plot at the end.

> path <- "/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/run.pmoOpenLoop/frxst_pts_out.txt"
> frxst <- ReadFrxstPts(path)
> rlFile <- '/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/DOMAIN/Route_Link_2.gagesAllLinks.nc'
> rl <- as.data.frame(GetNcdfFile(rlFile, q=TRUE))
> naLinkNames <- unique(frxst$st_id[which(is.na(frxst$q_cms))])
> rlNa <- subset(rl, trimws(rl$gages) %in% trimws(naLinkNames))
> naLinks <- rlNa$link
> naLinks
[1] 2897845 2919687 2876787

Those are the comIds. Here's the rest of the associated information in Route_Link.

> rlNa
      BtmWdth  Qi      So    link from      to       lon      lat     alt type
10509       5 0.1 0.00797 2897845    0 2897865 -105.0422 40.93214 1821.80    0
10570       3 0.1 0.01391 2919687    0 2919697 -104.7983 40.92731 1738.39    0
12199       3 0.1 0.00256 2876787    0 2876807 -104.5269 40.93164 1641.92    0
      order MusK MusX Length     n ChSlp LkHZArea LkMxH WeirC WeirL OrificeC
10509     3 3600  0.2    552 0.035  0.05    -9999 -9999 -9999 -9999    -9999
10570     2 3600  0.2     92 0.035  0.05    -9999 -9999 -9999 -9999    -9999
12199     2 3600  0.2    156 0.035  0.05    -9999 -9999 -9999 -9999    -9999
      OrificeA OrificeE time           gages
10509    -9999    -9999    0        g2897845
10570    -9999    -9999    0        g2919687
12199    -9999    -9999    0        g2876787

and, lo, the likely problem:

> which(rl$to %in% naLinks)
integer(0)

There are no upstream reaches though these are 2nd and 3rd order streams.

To generate the plot, a few more steps

> library(rwrfhydro)
> VisRl <- VisualizeRouteLink(rlFile)
> visRlObj <- VisRl()
Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=39.758913,-105.096191&zoom=8&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
> #names(visRlObj)
> #str(visRlObj$rl)
> #str(rl)
> rlNa <- subset(visRlObj$rl, trimws(visRlObj$rl$gages) %in% trimws(naLinkNames))
> visRlObj$ggObj+
+   ggplot2::geom_segment(data=rlNa,
+                         ## a little fudge factor necess since these reaches have no "from"
+                        ggplot2::aes(x=lon-.01, y=lat-.01, xend=to_lon, yend=to_lat), 
+                        color='cyan', size=9) 

The cyan bits at the top of the screen are the three links with Na values.
screen shot 2015-10-06 at 1 04 57 pm

@dnyates
Copy link

dnyates commented Oct 6, 2015

Thanks for looking into these issues James.. I see that these are on the
edge of the domain, where they have a higher streamorder, but coming into
the domain (usually have thought of these boundary issue links of flowing
out of the domain.. ).
I assume that these NaN's are for the "streamflow' variable?
y

On Tue, Oct 6, 2015 at 1:29 PM, James McCreight notifications@github.com
wrote:

This appears to be a domain issue with the front range Route_Link file.
There are 3 reaches with NaNs in the test case 4DAY/NHDPLUS run, for the
entire length of the run. These are NOT first order reaches, but there are
no points in the domain above them according to the Route_Link file. This
is likely the issue.

Here's the analysis in R showing their comIds and the issue with a plot at
the end.

path <- "/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/run.pmoOpenLoop/frxst_pts_out.txt"
frxst <- ReadFrxstPts(path)
rlFile <- '/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/DOMAIN/Route_Link_2.gagesAllLinks.nc'
rl <- as.data.frame(GetNcdfFile(rlFile, q=TRUE))
naLinkNames <- unique(frxst$st_id[which(is.na(frxst$q_cms))])
rlNa <- subset(rl, trimws(rl$gages) %in% trimws(naLinkNames))
naLinks <- rlNa$link
naLinks
[1] 2897845 2919687 2876787

Those are the comIds. Here's the rest of the associated information in
Route_Link.

rlNa
BtmWdth Qi So link from to lon lat alt type
10509 5 0.1 0.00797 2897845 0 2897865 -105.0422 40.93214 1821.80 0
10570 3 0.1 0.01391 2919687 0 2919697 -104.7983 40.92731 1738.39 0
12199 3 0.1 0.00256 2876787 0 2876807 -104.5269 40.93164 1641.92 0
order MusK MusX Length n ChSlp LkHZArea LkMxH WeirC WeirL OrificeC
10509 3 3600 0.2 552 0.035 0.05 -9999 -9999 -9999 -9999 -9999
10570 2 3600 0.2 92 0.035 0.05 -9999 -9999 -9999 -9999 -9999
12199 2 3600 0.2 156 0.035 0.05 -9999 -9999 -9999 -9999 -9999
OrificeA OrificeE time gages
10509 -9999 -9999 0 g2897845
10570 -9999 -9999 0 g2919687
12199 -9999 -9999 0 g2876787

and, lo, the likely problem:

which(rl$to %in% naLinks)
integer(0)

There are no upstream reaches though these are 2nd and 3rd order streams.

To generate the plot, a few more steps

library(rwrfhydro)
VisRl <- VisualizeRouteLink(rlFile)
visRlObj <- VisRl()
Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=39.758913,-105.096191&zoom=8&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
#names(visRlObj)
#str(visRlObj$rl)
#str(rl)
rlNa <- subset(visRlObj$rl, trimws(visRlObj$rl$gages) %in% trimws(naLinkNames))
visRlObj$ggObj+

  • ggplot2::geom_segment(data=rlNa,
  •                     ## a little fudge factor necess since these reaches have no "from"
    
  •                    ggplot2::aes(x=lon-.01, y=lat-.01, xend=to_lon, yend=to_lat),
    
  •                    color='cyan', size=9)
    

The cyan bits at the top of the screen are the three links with Na values.
[image: screen shot 2015-10-06 at 1 04 57 pm]
https://cloud.githubusercontent.com/assets/12465248/10319958/1a2c22fc-6c2e-11e5-86b0-26765bb0fd43.png


Reply to this email directly or view it on GitHub
#631.

David Yates
NCAR
303.497.8394 (o)
303.809.6604 (m)
skype: dnyates

@jmccreight
Copy link
Collaborator Author

Yes, they are qlink.


James L. McCreight
office: (303) 497-8404
cell: (831) 261-5149

On Tue, Oct 6, 2015 at 1:38 PM, dnyates notifications@github.com wrote:

Thanks for looking into these issues James.. I see that these are on the
edge of the domain, where they have a higher streamorder, but coming into
the domain (usually have thought of these boundary issue links of flowing
out of the domain.. ).
I assume that these NaN's are for the "streamflow' variable?
y

On Tue, Oct 6, 2015 at 1:29 PM, James McCreight notifications@github.com
wrote:

This appears to be a domain issue with the front range Route_Link file.
There are 3 reaches with NaNs in the test case 4DAY/NHDPLUS run, for the
entire length of the run. These are NOT first order reaches, but there
are
no points in the domain above them according to the Route_Link file. This
is likely the issue.

Here's the analysis in R showing their comIds and the issue with a plot
at
the end.

path <-
"/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/run.pmoOpenLoop/frxst_pts_out.txt"
frxst <- ReadFrxstPts(path)
rlFile <- '/d6/jamesmcc/WRF_Hydro/FRNG_NHD/4DAY/NHDPLUS/DOMAIN/
Route_Link_2.gagesAllLinks.nc'
rl <- as.data.frame(GetNcdfFile(rlFile, q=TRUE))
naLinkNames <- unique(frxst$st_id[which(is.na(frxst$q_cms))])
rlNa <- subset(rl, trimws(rl$gages) %in% trimws(naLinkNames))
naLinks <- rlNa$link
naLinks
[1] 2897845 2919687 2876787

Those are the comIds. Here's the rest of the associated information in
Route_Link.

rlNa
BtmWdth Qi So link from to lon lat alt type
10509 5 0.1 0.00797 2897845 0 2897865 -105.0422 40.93214 1821.80 0
10570 3 0.1 0.01391 2919687 0 2919697 -104.7983 40.92731 1738.39 0
12199 3 0.1 0.00256 2876787 0 2876807 -104.5269 40.93164 1641.92 0
order MusK MusX Length n ChSlp LkHZArea LkMxH WeirC WeirL OrificeC
10509 3 3600 0.2 552 0.035 0.05 -9999 -9999 -9999 -9999 -9999
10570 2 3600 0.2 92 0.035 0.05 -9999 -9999 -9999 -9999 -9999
12199 2 3600 0.2 156 0.035 0.05 -9999 -9999 -9999 -9999 -9999
OrificeA OrificeE time gages
10509 -9999 -9999 0 g2897845
10570 -9999 -9999 0 g2919687
12199 -9999 -9999 0 g2876787

and, lo, the likely problem:

which(rl$to %in% naLinks)
integer(0)

There are no upstream reaches though these are 2nd and 3rd order streams.

To generate the plot, a few more steps

library(rwrfhydro)
VisRl <- VisualizeRouteLink(rlFile)
visRlObj <- VisRl()
Map from URL :
http://maps.googleapis.com/maps/api/staticmap?center=39.758913,-105.096191&zoom=8&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
#names(visRlObj)
#str(visRlObj$rl)
#str(rl)
rlNa <- subset(visRlObj$rl, trimws(visRlObj$rl$gages) %in%
trimws(naLinkNames))
visRlObj$ggObj+

  • ggplot2::geom_segment(data=rlNa,
  • a little fudge factor necess since these reaches have no "from"

  • ggplot2::aes(x=lon-.01, y=lat-.01, xend=to_lon, yend=to_lat),
  • color='cyan', size=9)

The cyan bits at the top of the screen are the three links with Na
values.
[image: screen shot 2015-10-06 at 1 04 57 pm]
<
https://cloud.githubusercontent.com/assets/12465248/10319958/1a2c22fc-6c2e-11e5-86b0-26765bb0fd43.png


Reply to this email directly or view it on GitHub
#631.

David Yates
NCAR
303.497.8394 (o)
303.809.6604 (m)
skype: dnyates


Reply to this email directly or view it on GitHub
#631
.

@rcabell rcabell transferred this issue from another repository May 6, 2022
@rcabell rcabell transferred this issue from another repository May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants