-
Notifications
You must be signed in to change notification settings - Fork 6
/
sir20165080_AppendixH.R
1020 lines (916 loc) · 58 KB
/
sir20165080_AppendixH.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## ----setup, include=FALSE------------------------------------------------
t0 <- Sys.time()
try(knitr::opts_chunk$set(tidy=FALSE, comment="#", fig.align="center"), silent=TRUE)
grDevices::pdf.options(useDingbats=FALSE)
library(wrv)
library(inlmisc)
library(raster)
options(preferRaster=TRUE, scipen=0, digits=2)
# Device dimension in inches (width, height)
fin.graph <- c(7.17, 7.17)
fin.graph.short <- c(7.17, 3.50)
fig.graph.small <- c(3.50, 3.50)
fin.map <- c(7.17, 9.31)
fin.map.0 <- c(7.17, 8.77)
fin.map.s <- c(7.17, 5.22)
fin.map.s.0 <- c(7.17, 4.68)
fin.map.n <- c(7.17, 6.97)
fin.map.n.small <- c(3.50, 3.60)
fin.map.n.small.0 <- c(3.50, 3.30)
fin.cs <- c(7.17, 5.26)
fin.cs.0 <- c(7.17, 4.68)
# Extreme coordinates of plotting region (x1, x2, y1, y2)
usr.map <- c(2451504, 2497815, 1342484, 1402354)
usr.map.s <- c(2472304, 2497015, 1343284, 1358838)
usr.map.n.1 <- c(2463000, 2475356, 1386500, 1398856)
usr.map.n.2 <- c(2467500, 2479856, 1376500, 1388856)
usr.map.n.3 <- c(2466696, 2479052, 1366501, 1378857)
usr.map.n.4 <- c(2471500, 2483856, 1356482, 1368838)
# Unit conversions
cfs.to.m3.per.d <- 2446.57555
# Map credit
credit <- paste("Base derived from U.S. Geological Survey National Elevation Dataset 10-meter digital elevation model.",
"Idaho Transverse Mercator projection; North American Datum of 1983.", sep="\n")
## ----echo=FALSE----------------------------------------------------------
is.obs <- as.Date(obs.wells.head$DateTime) >= as.Date("1998-01-01") &
as.Date(obs.wells.head$DateTime) < as.Date("2011-01-01")
wells <- obs.wells
FUN <- function(x) {
x <- range(x)
moyr <- format(x, "%b %Y")
mo <- format(x, "%b")
yr <- format(x, "%Y")
if (moyr[1] == moyr[2]) {
return(moyr[1])
} else {
if (yr[1] == yr[2])
return(paste0(mo[1],"--", moyr[2]))
else
return(paste(moyr, collapse=" -- "))
}
}
x <- aggregate(obs.wells.head$DateTime, by=list(obs.wells.head$PESTNAME), FUN)
names(x) <- c("PESTNAME", "por")
d <- dplyr::left_join(obs.wells@data, x, by="PESTNAME")
d$nrec <- vapply(d$PESTNAME, function(i) sum(obs.wells.head$PESTNAME == i), 0L)
x <- aggregate(obs.wells.head$Head, by=list(obs.wells.head$PESTNAME), sd)
names(x) <- c("PESTNAME", "sd")
d <- dplyr::left_join(d, x, by="PESTNAME")
wells@data <- d
PrintTable <- function(idxs, is.last.hline, label) {
d <- wells@data[idxs[idxs <= nrow(wells@data)], ]
d$desc <- as.character(d$desc)
d$desc[d$desc == "Observation well"] <- "USGS well"
d$desc[d$desc == "Geo-located driller well"] <- "Geo-located driller well"
d$desc[d$desc == "Driller-located driller well"] <- "PLSS-located driller well"
d$desc[d$desc == "Sun Valley Water and Sewer well"] <- "SVWSD well"
d$desc[d$desc == "Nature Conservancy well"] <- "TNC well"
d[duplicated(d[, "desc"]), "desc"] <- ""
d$SiteNo[is.na(d$SiteNo)] <- "--"
d <- d[, c("desc", "id", "SiteNo", "WELLNUMBER", "nrec", "por", "sd")]
columns <- c("Well type",
"Well \\\\ No.",
"Site \\\\ identifier",
"Name",
"No. of \\\\ records",
"Period of \\\\ record",
"SD \\\\ (m)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Observation wells in the Wood River Valley aquifer system."
cap2 <- c("\\textbf{Well type}:",
"``USGS well'' is monitored by the U.S. Geological Survey and (or) the Idaho Department of Water Resources;",
"``Geolocated driller well'' is a driller recorded groundwater level in a geolocated well;",
"``PLSS-located driller well'' is a driller recorded groundwater level in a well located using the Public Land Survey System (PLSS);",
"``SVWSD well'' is a production well in the Sun Valley Water and Sewer District (SVWSD); and",
"``TNC well'' is monitored by The Nature Conservancy and installed with a pressure transducer.",
"\\textbf{Well No.}: identifier used to locate wells in figures \\ref{fig:map_wells_usgs}, \\ref{fig:map_wells_driller}, and \\ref{fig:map_wells_svws_nat}.",
"\\textbf{Site identifier}: unique numerical identifiers used to access well data (\\url{https://waterdata.usgs.gov/nwis}).",
"\\textbf{Name}: local well name used in this study.",
"\\textbf{SD}: standard deviation of groundwater levels.",
"\\textbf{Abbreviations}: m, meters; --, not available; NA, not applicable")
tbl <- xtable::xtable(d, label=label)
if (idxs[1] == 1L)
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
else
xtable::caption(tbl) <- sprintf("%s---Continued", cap1)
xtable::digits(tbl) <- c(0, 0, 0, 0, 0, 0, 0, 2)
suppressWarnings(xtable::align(tbl) <- "llccL{1.0in}rcr")
hline.after <- if (is.last.hline) c(-1, 0, nrow(tbl)) else c(-1, 0)
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="NA",
sanitize.text.function=identity, hline.after=hline.after)
}
## ----table_wells_usgs, echo=FALSE, results="asis"------------------------
PrintTable(idxs <- 1:(n <- 48L), FALSE, label <- "table_wells_usgs")
## ----echo=FALSE, results="asis"------------------------------------------
s <- unique(c(seq(n, nrow(wells@data), 56L), nrow(wells@data)))
for (i in head(seq_along(s), -1)) {
cat("\\addtocounter{table}{-1}\n")
PrintTable((s[i] + 1L):s[i + 1], s[i + 1L] == tail(s, 1), paste0(label, "_", i))
}
## ----include=FALSE-------------------------------------------------------
v <- "Location of wells in the U.S. Geological Survey (USGS) groundwater monitoring network, Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_wells_usgs, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col=NA, add=TRUE)
p <- obs.wells[obs.wells@data$desc == "Observation well", ]
col <- "#FF4B12"
bg <- "#FF4B12"
points(p, pch=21, cex=0.7, col=col, bg=bg, lwd=0.25)
pos <- c(2, 4, 1, 1, 1, 3, 4, 1, 1, 1,
3, 3, 4, 1, 1, 2, 3, 3, 3, 4,
1, 1, 2, 4, 1, 3, 1, 1, 1, 3,
1, 1, 1, 1, 1, 4, 2, 2, 1, 3,
3, 4, 2, 4, 2, 2, 2, 3, 2, 4,
1, 3, 4, 3, 3, 4, 2, 3, 4, 2,
4, 2, 1, 4, 4, 4, 2, 2, 3, 4,
2, 4, 2, 4, 1, 2, 4, 1, 1, 4,
2, 4, 2, 4, 2, 2, 1, 3, 2, 4,
3, 4, 3, 2)
text(p, labels=p@data$id, col="#333333", cex=0.6, pos=pos, offset=0.3)
leg <- "USGS well"
legend("topright", leg, pch=21, col=col, pt.bg=bg, pt.lwd=0.25, pt.cex=0.8,
inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
AddInsetMap(idaho, width=1, main.label=list("IDAHO", adj=c(-0.4, -4.9)),
sub.label=list("Map area", adj=c(0.5, 2.5)), loc="topleft")
## ----include=FALSE-------------------------------------------------------
v <- "Location of geolocated driller wells and Public Land Survey System (PLSS)-located driller wells in the Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_wells_driller, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col=NA, add=TRUE)
p.1 <- obs.wells[obs.wells@data$desc == "Geo-located driller well", ]
p.2 <- obs.wells[obs.wells@data$desc == "Driller-located driller well", ]
col <- c("#9061C2DD", "#FFC800DD")
bg <- c("#9061C280", "#FFC80080")
pch <- c(21, 22)
cex <- c(0.7, 0.6)
points(p.1, pch=pch[1], cex=cex[1], col=col[1], bg=bg[1], lwd=0.25)
points(p.2, pch=pch[2], cex=cex[2], col=col[2], bg=bg[2], lwd=0.25)
no.1 <- paste0("(", paste(range(p.1@data$id), collapse="-"), ")")
no.2 <- paste0("(", paste(range(p.2@data$id), collapse="-"), ")")
leg <- c(paste("Geolocated driller well", no.1),
paste("PLSS-located driller well", no.2))
legend("topright", leg, pch=pch, col=col, pt.bg=bg, pt.cex=cex,
pt.lwd=0.25, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5,
bg="#FFFFFFE7")
## ----include=FALSE-------------------------------------------------------
v <- "Location of two Sun Valley Water and Sewer District (SVWSD) production wells, and wells in The Nature Conservancy (TNC) groundwater monitoring network, Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_wells_svws_nat, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col=NA, add=TRUE)
p.1 <- obs.wells[obs.wells@data$desc == "Sun Valley Water and Sewer well", ]
p.2 <- obs.wells[obs.wells@data$desc == "Nature Conservancy well", ]
col <- c("#A40802", "#1F78B4")
pch <- c(21, 22)
cex <- c(0.7, 0.7)
points(p.1, pch=pch[1], cex=cex[1], col=col[1], bg=col[1], lwd=0.25)
points(p.2, pch=pch[2], cex=cex[2], col=col[2], bg=col[2], lwd=0.25)
pos <- c(4, 4)
text(p.1, labels=p.1@data$id, col="#333333", cex=0.6, pos=pos, offset=0.3)
pos <- c(1, 1, 1, 4, 1, 1, 1, 1, 4, 1)
text(p.2, labels=p.2@data$id, col="#333333", cex=0.6, pos=pos, offset=0.3)
leg <- c("SVWSD well", "TNC well")
legend("topright", leg, pch=pch, col=col, pt.bg=col, pt.cex=cex,
pt.lwd=0.25, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
## ----include=FALSE-------------------------------------------------------
v <- "River network and streamflow measurement sites in the Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_sites, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
sites <- seepage.study
sites <- sites[!sites@data$Type %in% c("Return", "Diversion", "Exchange well inflow"), ]
sites <- sites[!duplicated(sites@data$Name), ]
sites@data$site.no <- seq_len(nrow(sites@data))
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col="#FFFFFF9A", add=TRUE)
plot(river.reaches, col="#3399CC", lwd=0.5, add=TRUE)
plot(tributary.streams, col="#3399CC", lwd=0.5, add=TRUE)
is.continuous <- sites@data$SiteNo %in% streamgages@data$SiteNo
cols <- rep("#FDFDFD", length(is.continuous))
cols[is.continuous] <- "#A40802"
points(sites, pch=24, cex=0.8, col="#A40802", bg=cols)
pos <- c(2, 4, 3, 3, 1, 1, 3, 1, 1, 4,
3, 3, 1, 3, 3, 3, 4, 2, 2, 3,
1, 1, 3, 1, 3, 1, 3, 1, 3, 1,
3, 3)
text(sites, labels=sites@data$site.no, col="#333333", cex=0.6, pos=pos, offset=0.3)
lab <- paste0(max(sites@data$site.no), "\n")
text(par("usr")[2], par("usr")[3], labels=lab, col="#333333", cex=0.6, pos=2,
offset=0.1)
text(2478800, 1355000, labels="Big Wood River", cex=0.6, col="#3399CC", font=3, srt=75)
text(2493200, 1346300, labels="Silver\nCreek", cex=0.6, col="#3399CC", font=3, srt=0)
text(2478500, 1347700, labels="Willow Creek", cex=0.6, col="#3399CC", font=3, srt=15)
text(2483000, 1351600, labels="spring-fed\ntributaries", cex=0.6, col="#3399CC", font=3)
leg <- c("Rivers and streams", "Streamgage with continuous record",
"Measurement station without a gage")
legend("topright", leg, pch=c(NA, 24, 24), lwd=c(1, NA, NA),
col=c("#3399CC", "#A40802", "#A40802"), pt.bg=c(NA, "#A40802", "#FDFDFD"),
pt.cex=0.8, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
## ----echo=FALSE----------------------------------------------------------
GetSiteNo <- function(i) {
sprintf("site No.~%s", sites@data$site.no[sites@data$SiteNo %in% i])
}
## ----table_sites, echo=FALSE, results="asis"-----------------------------
d <- sites@data
d$POR <- "Aug, Oct 2012; Mar 2013"
d$POR[d$SiteNo == 432352114161500] <- "March 2013"
d$POR[d$SiteNo == 432248114163400] <- "March 2013"
d$POR[d$SiteNo == 434404114215200] <- "Aug, Oct 2012"
d$POR[d$SiteNo == 432805114113800] <- "Aug, Oct 2012"
d$POR[d$SiteNo == 13135510] <- "Aug, Oct 2012"
d$POR[d$SiteNo == 13137900] <- "Aug, Oct 2012"
d$POR[d$SiteNo == 13135500] <- "1948--1972, 2011--present"
d$POR[d$SiteNo == 13135520] <- "2011--present"
d$POR[d$SiteNo == 13137000] <- "1920--1921, 2011--present"
d$POR[d$SiteNo == 13137500] <- "1920--1921, 2011--present"
d$POR[d$SiteNo == 13138000] <- "1920--1921, 2011--present"
d$POR[d$SiteNo == 13139510] <- "1915--present"
d$POR[d$SiteNo == 13140800] <- "1996--present"
d$POR[d$SiteNo == 13140900] <- "1999--present"
d$POR[d$SiteNo == 13150430] <- "1974--present"
d <- d[, c("site.no", "SiteNo", "Name", "POR")]
columns <- c("Site \\\\ No.", "Site \\\\ identifier", "Name", "Period of record")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Streamflow measurement sites located on the Big Wood River, Willow Creek, Silver Creek, and spring-fed tributaries."
cap2 <- c("\\textbf{Site No.}: identifier used to locate measurement sites on maps located in figures and as a cross reference with data in other tables.",
"\\textbf{Site identifier}: unique numerical identifiers used to access streamflow data (\\url{https://waterdata.usgs.gov/nwis}).",
"\\textbf{Name}: local measurement site name used in this study.")
tbl <- xtable::xtable(d, label="table_sites")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "c", "p{3.7in}", "l")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="NA")
## ----table_lm, echo=FALSE, results="asis"--------------------------------
ids <- c(13135500, 13135520, 13137000, 13137500, 13138000)
d <- sites@data[match(ids, sites@data$SiteNo), c("Name", "site.no")]
d$Period <- c("Jun 1948 -- Sep 1971, May 2011 -- Sep 2013",
"May 2011 -- Sep 2013", "Feb 2011 -- Mar 2014",
"Dec 2010 -- Mar 2014", "Nov 2011 -- Sep 2013")
d$Slope <- c(0.34, 0.16, 0.17, 0.12, 0.12)
d$Intercept <- c(0.05, -5.74, 6.59, -11.90, -7.21) * cfs.to.m3.per.d
d$R.squared <- c(0.975, 0.863, 0.885, 0.865, 0.877)
columns <- c("Station name", "Site \\\\ No.", "Coinciding \\\\ time period",
"Slope \\\\ (1)", "Intercept \\\\ (m\\textsuperscript{3}/d)",
"R\\textsuperscript{2} \\\\ (1)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- paste("Characteristics of the linear regression models used to estimate streamflow at various streamgages during periods of missing data.",
"The independent variable of the linear regression models is streamflow measured at the Big Wood River, Hailey streamgage (13139510), in cubic meters per day.")
cap2 <- c("\\textbf{Station name}: local streamgage name used in this study.",
"\\textbf{Site No.}: identifier used to locate streamflow measurement sites in \\hyperref[fig:map_sites]{figure~\\ref{fig:map_sites}} and \\hyperref[table_sites]{table~\\ref{table_sites}}.",
"\\textbf{Coinciding time period}: when streamflow data were available at both streamgages.",
"\\textbf{Slope} and \\textbf{Intercept}: of the linear regression model.",
"\\textbf{R\\textsuperscript{2}}: the coefficient of determination.",
"\\textbf{Abbreviations}: m\\textsuperscript{3}/d, cubic meters per day")
tbl <- xtable::xtable(d, label="table_lm")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl)[5:7] <- c(2, 0, 3)
xtable::align(tbl) <- c("l", "p{2.8in}", "c", "p{1.2in}", "r", "r", "r")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--",
sanitize.text.function=identity, format.args=list(big.mark=","))
## ----echo=FALSE----------------------------------------------------------
# Apply hack for records in seepage.study that are missing from div.ret.exch
is.missing <- with(seepage.study@data, Type %in% c("Diversion", "Return", "Exchange well inflow") & !Name %in% div.ret.exch$Name)
missing.rec <- seepage.study[is.missing, c("Name", "Type"), drop=FALSE]
missing.rec@data$LocSource <- NA
missing.rec@data$BigReach <- NA
div.ret.exch <- rbind(div.ret.exch, missing.rec)
p.ret <- div.ret.exch[div.ret.exch@data$Type %in% c("Return", "Exchange well inflow"), ]
p.ret@data$ret.no <- seq_along(p.ret)
GetRetNo <- function(i) {
return(sprintf("return No.~%s", paste(p.ret@data$ret.no[p.ret$Name %in% i], collapse=",~")))
}
## ----include=FALSE-------------------------------------------------------
v <- "Streamflow returns from irrigation canals or ponds, and exchange wells located on the Big Wood River, Silver Creek, and spring-fed tributaries."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_ret, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col="#FFFFFF9A", add=TRUE)
plot(river.reaches, col="#3399CC", lwd=0.5, add=TRUE)
plot(tributary.streams, col="#3399CC", lwd=0.5, add=TRUE)
p <- p.ret[p.ret@data$Type == "Return", ]
cols <- c("#F3077D", "#7FAF1B")
points(p, pch=23, cex=0.7, col=cols[1], bg=cols[1])
pos <- c(2, 4, 1, 2, 4, 3, 4)
text(p, labels=p@data$ret.no, col="#333333", cex=0.6, pos=pos, offset=0.3)
p <- p.ret[p.ret@data$Type == "Exchange well inflow", ]
points(p, pch=21, cex=0.7, col=cols[2], bg=cols[2])
pos <- c(2, 3, 4, 1, 2, 3, 3, 1, 3, 1,
1, 2, 3, 2)
text(p, labels=p@data$ret.no, col="#333333", cex=0.6, pos=pos, offset=0.3)
leg <- c("Irrigation canal or pond return", "Exchange-well return")
legend("topright", leg, pch=c(23, 21), lwd=NA, col=cols, pt.bg=cols,
pt.cex=0.7, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
## ----table_ret, echo=FALSE, results="asis"-------------------------------
d <- p.ret@data
d$Type <- as.character(d$Type)
d$Type[d$Type == "Return"] <- "Irrigation canal or pond"
d$Type[d$Type == "Exchange well inflow"] <- "Exchange well"
d <- d[, c("ret.no", "Name", "Type")]
columns <- c("Return \\\\ No.", "Name", "Water-source")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Streamflow returns located on the Big Wood River, Silver Creek, and spring-fed tributaries."
cap2 <- c("\\textbf{Return No.}: identifier used to locate returns in \\hyperref[fig:map_ret]{figure~\\ref{fig:map_ret}}.",
"\\textbf{Name}: local name used to identify the return-flow location in this study.",
"\\textbf{Water-source}: the water type for return flows.")
tbl <- xtable::xtable(d, label="table_ret")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "p{2.0in}", "l")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--")
## ----include=FALSE-------------------------------------------------------
v <- "Streamflow diversions along on the Big Wood River, Willow Creek, Silver Creek, and spring-fed tributary streams."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_div, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
p.div <- div.ret.exch[div.ret.exch@data$Type == "Diversion", ]
p.div@data$div.no <- seq_along(p.div)
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col="#FFFFFF9A", add=TRUE)
plot(river.reaches, col="#3399CC", lwd=0.5, add=TRUE)
plot(tributary.streams, col="#3399CC", lwd=0.5, add=TRUE)
points(p.div, pch=22, cex=0.7, col="#F98C64", bg="#F98C64")
lab <- formatC(p.div@data$div.no)
lab[31] <- "31-54"
lab[32:54] <- ""
pos <- c(3, 4, 1, 2, 4, 1, 2, 2, 1, 4,
4, 3, 4, 3, 1, 4, 1, 2, 1, 4,
4, 2, 2, 4, 4, 1, 2, 3, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 4, 1, 3, 2,
2, 4, 1, 2, 4, 2, 2, 4, 2, 4,
2, 4, 3, 4, 4, 3, 1, 1, 1, 3,
2, 4, 1, 1, 3, 1, 2, 4, 3, 4,
2, 4, 1, 2, 3, 1, 3, 4, 1, 1,
3, 4, 2, 2)
text(p.div, labels=lab, col="#333333", cex=0.6, pos=pos, offset=0.3)
leg <- "Stream diversion"
legend("topright", leg, pch=22, lwd=NA, col="#F98C64", pt.bg="#F98C64",
pt.cex=0.7, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
## ----table_div, echo=FALSE, results="asis"-------------------------------
d <- p.div@data
d$SiteNo <- seepage.study@data$SiteNo[match(d$Name, seepage.study@data$Name)]
d <- d[, c("div.no", "SiteNo", "Name")]
columns <- c("Div. \\\\ No.", "Site \\\\ identifier", "Name")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Streamflow diversions located on the Big Wood River, Willow Creek, Silver Creek, and spring-fed tributaries."
cap2 <- c("\\textbf{Div. No.}: identifier used to locate diversions in \\hyperref[fig:map_div]{figure~\\ref{fig:map_div}}.",
"\\textbf{Site identifier}: unique numerical identifiers used to access streamflow measurement data (\\url{https://waterdata.usgs.gov/nwis}).",
"\\textbf{Name}: local diversion name used in this study.",
"\\textbf{Abbreviations}: --, not available")
idxs <- 1:52
tbl <- xtable::xtable(d[idxs, ], label="table_div")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- "lccl"
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--")
## ----echo=FALSE, results="asis"------------------------------------------
tbl <- xtable::xtable(d[seq_len(nrow(d))[-idxs], ], label="table_div_1")
xtable::caption(tbl) <- sprintf("%s---Continued", cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- "lccl"
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--")
## ----echo=FALSE----------------------------------------------------------
rr <- river.reaches[river.reaches@data$BigReach != "None", ]
rr <- rr[order(rr@data$ReachNo), ]
reach.names <- unique(rr@data$BigReach)
reach.numbers <- match(rr@data$BigReach, reach.names)
GetReachNo <- function(i) {
d <- data.frame(ReachNo=seq_along(reach.names), Name=as.character(reach.names))
return(sprintf("reach No.~%s", d[d$Name == i, "ReachNo"]))
}
## ----include=FALSE-------------------------------------------------------
v <- "Assigned river reaches in the Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_reach, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
Pal <- function(...) {
cols1 <- rainbow(..., s=0.5, v=1)
cols2 <- rainbow(..., s=1, v=0.5)
is.even <- seq_along(cols1) %% 2 == 0
cols1[is.even] <- cols2[is.even]
return(cols1)
}
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col="#FFFFFF9A", add=TRUE)
cols <- Pal(max(reach.numbers))[reach.numbers]
plot(rr, col=cols, lwd=0.5, add=TRUE)
text(getSpatialLinesMidPoints(rr), labels=reach.numbers,
col="#333333", cex=0.6, pos=4, offset=0.4)
ids <- c("13135500", "13139510", "13140800", "13140900", "13150430")
points(sites[sites@data$SiteNo %in% ids, ], pch=24, cex=0.7,
col="#333333B1", bg="#333333B1")
legend("topright", format(unique(reach.numbers)), lwd=1, col=unique(cols),
pt.cex=1, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5,
bg="#FFFFFFE7", title=expression(bold("Reach")))
## ----table_reach, echo=FALSE, results="asis"-----------------------------
d <- data.frame(ReachNo=seq_along(reach.names))
d$Name <- c("Big Wood, Nr Ketchum to Hailey",
"Big Wood, Hailey to Stanton Crossing",
"Willow Creek",
"Silver Creek, above Sportsman Access",
"Silver Creek, Sportsman Access to Nr Picabo")
# match(c(13135500, 13139510, 0, 0, 13150430), sites@data$SiteNo)
d$UpNo <- c("\\textbf{1}", "\\textbf{14}", NA, NA, "\\textbf{31}")
# match(c(13139510, 13140800, 13140900, 13150430, 13150500), sites@data$SiteNo)
d$DownNo <- c("\\textbf{14}", "\\textbf{20}", "\\textbf{21}", "\\textbf{31}", "32")
# match(c(13135520, 13137000, 13137500, 13138000), sites@data$SiteNo)
d$TribNo <- c("2, 9, 10, 12", NA, NA, NA, NA)
# lapply(d$Name, function(i) which(p.div@data$BigReach == i))
d$div.no <- c("1--27", "28--69", "70--79", "80--93", "94--98")
# lapply(d$Name, function(i) which(p.ret@data$BigReach == i))
d$ret.no <- c("1--4", "5", NA, "6--18", "19")
columns <- c("Reach \\\\ No.",
"Name",
"Upstream \\\\ Site No.",
"Down- \\\\ stream \\\\ Site No.",
"Tributary \\\\ Site No.",
"Return \\\\ No.",
"Diversion \\\\ No.")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Assigned river reaches of the Big Wood River, Willow Creek, Silver Creek, and spring-fed tributaries."
cap2 <- c("\\textbf{Reach No.}: identifier used to locate river reaches in \\hyperref[fig:map_reach]{figure~\\ref{fig:map_reach}}.",
"\\textbf{Name}: local reach name used in this study.",
"\\textbf{Site No.}: identifier used to locate streamflow measurement sites in \\hyperref[fig:map_sites]{figure~\\ref{fig:map_sites}} and \\hyperref[table_sites]{table~\\ref{table_sites}}.",
"Entry in \\textbf{bold} indicates a streamgage with continuous record.",
"No upstream site number indicates that the reach is spring-fed.",
"\\textbf{Return No.}: identifier used to locate return flows in \\hyperref[fig:map_ret]{figure~\\ref{fig:map_ret}} and \\hyperref[table_ret]{table~\\ref{table_ret}}.",
"\\textbf{Diversion No.}: identifier used to locate stream diversions in \\hyperref[fig:map_div]{figure~\\ref{fig:map_div}} and \\hyperref[table_div]{table~\\ref{table_div}}.",
"\\textbf{Abbreviations}: --, not present.")
tbl <- xtable::xtable(d, label="table_reach")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "l", "c", "c", "c", "c", "c")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--",
sanitize.text.function=identity)
## ----include=FALSE-------------------------------------------------------
v <- "Stream-aquifer flow exchange in the Big Wood River, near Ketchum to Hailey river reach."
v <- c(paste("Graph showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----graph_nket_hai, echo=FALSE, fig.width=fin.graph.short[1], fig.height=fin.graph.short[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
d.rech <- reach.recharge
ndays <- GetDaysInMonth(tail(d.rech$YearMonth, 1))
d.rech <- data.frame(Date=as.Date(paste0(d.rech$YearMonth, "01"), "%Y%m%d"),
d.rech[, -1])
d.rech <- rbind(d.rech, d.rech[nrow(d.rech), , drop=FALSE])
d.rech$Date[nrow(d.rech)] <- d.rech$Date[nrow(d.rech)] + ndays
ylab <- paste("Stream-aquifer flow exchange, in", c("cubic meters per day", "cubic feet per second"))
xlim <- as.Date(c("1995-01-01", "2011-01-01"), tz="MST")
d <- d.rech[, c("Date", "nKet_Hai")]
col <- "#C80C0B"
PlotGraph(d, ylab=ylab, xlim=xlim, col=col, fill="tozeroy",
conversion.factor=1 / cfs.to.m3.per.d,
scientific=c(FALSE, TRUE, FALSE), center.date.labels=TRUE,
seq.date.by="year")
## ----include=FALSE-------------------------------------------------------
v <- "Stream-aquifer flow exchange in the Big Wood River, Hailey to Stanton Crossing river reach."
v <- c(paste("Graph showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----graph_hai_stc, echo=FALSE, fig.width=fin.graph.short[1], fig.height=fin.graph.short[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
d <- d.rech[, c("Date", "Hai_StC")]
d[, 3] <- d[, 2]
d[!is.na(d[, 2]) & d[, 2] < 0, 2] <- 0
d[!is.na(d[, 3]) & d[, 3] > 0, 3] <- 0
col <- c("#67A9CF", "#C80C0B")
PlotGraph(d, ylab=ylab, xlim=xlim, col=col, fill="tozeroy",
conversion.factor=1 / cfs.to.m3.per.d,
scientific=c(FALSE, TRUE, FALSE), center.date.labels=TRUE,
seq.date.by="year")
legend("bottomright", c("Recharge", "Discharge"), col=col, lty=1,
inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
## ----include=FALSE-------------------------------------------------------
v <- "Stream-aquifer flow exchange in the Willow Creek river reach."
v <- c(paste("Graph showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----graph_willowcr, echo=FALSE, fig.width=fin.graph.short[1], fig.height=fin.graph.short[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
d <- d.rech[, c("Date", "WillowCr")]
col <- "#C80C0B"
PlotGraph(d, ylab=ylab, xlim=xlim, col=col, fill="tozeroy",
conversion.factor=1 / cfs.to.m3.per.d,
scientific=c(FALSE, TRUE, FALSE), center.date.labels=TRUE,
seq.date.by="year")
## ----include=FALSE-------------------------------------------------------
v <- "Stream-aquifer flow exchange in Silver Creek, above Sportsman Access river reach."
v <- c(paste("Graph showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----graph_silverabv, echo=FALSE, fig.width=fin.graph.short[1], fig.height=fin.graph.short[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
d <- d.rech[, c("Date", "SilverAbv")]
col <- "#C80C0B"
PlotGraph(d, ylab=ylab, xlim=xlim, col=col, fill="tozeroy",
conversion.factor=1 / cfs.to.m3.per.d,
scientific=c(FALSE, TRUE, FALSE), center.date.labels=TRUE,
seq.date.by="year")
## ----echo=FALSE----------------------------------------------------------
subreaches <- river.reaches
is <- !subreaches@data$Reach %in% c("Willow Creek",
"Big Wood, Stanton Crossing to Nr Bellevue",
"Silver Creek, Sportsman Access to Nr Picabo")
subreaches <- subreaches[is, ]
subreaches$BigReachNo <- match(subreaches$BigReach, reach.names)
## ----include=FALSE-------------------------------------------------------
v <- "Assigned river subreaches in the Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_subreach, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
Pal <- function(...) {
cols1 <- rainbow(..., s=0.5, v=1)
cols2 <- rainbow(..., s=1, v=0.5)
is.even <- seq_along(cols1) %% 2 == 0
cols1[is.even] <- cols2[is.even]
return(cols1)
}
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4],
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col="#FFFFFF9A", add=TRUE)
cols <- Pal(nlevels(subreaches@data$Reach))
plot(subreaches, col=cols, lwd=0.5, add=TRUE)
reach.numbers <- subreaches@data$ReachNo
pos <- c(4, 2, 4, 4, 4, 4, 4, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 1)
text(getSpatialLinesMidPoints(subreaches), labels=reach.numbers,
col="#333333", cex=0.6, pos=pos, offset=0.4)
pts <- sites[!sites@data$Type %in% c("Tributary", "Willow Creek") &
!sites@data$Name %in% c("BIG WOOD RIVER NR BELLEVUE, ID",
"SILVER CREEK NEAR HWY 20 NEAR PICABO, ID"), ]
points(pts, pch=24, cex=0.7, col="#333333B1", bg="#333333B1")
text(2478800, 1355000, labels="Big Wood River", cex=0.6, col="#333333", font=3, srt=75)
text(2485000, 1344500, labels="Silver\nCreek", cex=0.6, col="#333333", font=3, srt=0)
text(2483000, 1351800, labels="spring-fed\ntributaries", cex=0.6, col="#333333", font=3)
leg <- format(reach.numbers[order(reach.numbers)])
legend("topright", leg, lwd=1, col=cols[order(reach.numbers)], ncol=2,
pt.cex=1, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5,
bg="#FFFFFFE7", title=expression(bold("Subreach")))
## ----table_subreach, echo=FALSE, results="asis"--------------------------
d <- subreaches@data[order(subreaches@data$ReachNo), c("ReachNo", "Reach", "BigReachNo")]
d$BigReachNo[duplicated(d$BigReachNo)] <- ""
rownames(d) <- NULL
# match(c(13135500, 13135840, 13136000, 13138500, 13139510, 432929114174300, 432805114160400, 13140500, 432352114161500, 13140600,
# NA, NA, NA, NA, NA, NA, NA, NA, NA), sites@data$SiteNo)
d$UpNo <- c("\\textbf{1}", 6, 8, 13, 14, 15, 16, 17, 18, NA, NA, NA, NA, NA, NA, NA, NA, NA, "23--30")
# match(c(13135840, 13136000, 13138500, 13139510, 432929114174300, 432805114160400, 13140500, 432352114161500, 13140600, 13140800,
# 13150010, 431947114133300, 13150140, 13150150, 13150300, 13150350, 13150360, 13150400, 13150430), sites@data$SiteNo)
d$DownNo <- c(6, 8, 13, 14, 15, 16, 17, 18, NA, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31)
# match(c(13135520, 434611114244600, 13135600, 13135700), sites@data$SiteNo)
# match(434404114215200, sites@data$SiteNo)
# match(c(13137000, 13137500, 433817114211800, 13138000), sites@data$SiteNo)
d$TribNo <- c("2--5", 7, "9--12", rep(NA, 16))
# with(p.ret@data, ret.no[which(Name %in% c("BYPASS CANAL ABV AND BLW DIVERSION NR BELLEVUE, ID"))])
# with(p.ret@data, ret.no[which(Name %in% c("A well into Buhler Drain"))])
# with(p.ret@data, ret.no[which(Name %in% c("Bickett Well 00P1"))])
# with(p.ret@data, ret.no[which(Name %in% c("Steve 0P", "Lucke Well 00P4 Flood", "Teeter Canyon 00-P5", "Prinz 0P6", "Meadow Well 18P1", "Rinker Well 18P", "Tick Tock 16P1", "Stalker 0P7"))])
# with(p.ret@data, ret.no[which(Name %in% c("Mill In 16P"))])
d$ret.no <- c(NA, NA, NA, NA, NA, NA, NA, NA, NA, 20,
21, 7, NA, NA, NA, NA, NA, NA, "8--10, 13--17")
# with(p.div@data, div.no[which(Name %in% c("Tom P2", "Don P3"))])
# with(p.div@data, div.no[which(Name %in% c("HIAWATHA CANAL AT POINT OF DIVERSON NR GIMLET, ID", "Aspen 27"))])
# with(p.div@data, div.no[which(Name %in% c("COVE CANAL AT POINT OF DIVERSON NR HAILEY, ID"))])
# with(p.div@data, div.no[which(Name %in% c("DISTRICT 45 CANAL AT POINT OF DIVERSON BELLVUE, ID", "Bannon 49", "GLENDALE CANAL AT POINT OF DIVERSON NR BELLVUE, ID", "BYPASS CANAL AT POINT OF DIVERSION NR BELLEVUE, ID"))])
# with(p.div@data, div.no[which(Name %in% c("Graff 62", "Uhrig 63", "Flood 64"))])
# with(p.div@data, div.no[which(Name %in% c("Salisbury 68", "Hice 71", "Martin 72", "Martin 72A", "Cloud 74", "Pugel 75"))])
# with(p.div@data, div.no[which(Name %in% c("Rogers 0P1"))])
# with(p.div@data, div.no[which(Name %in% c("Bill 9", "Loving 12B", "Stanfield 12P", "Stanfield 13", "Stanfield 13A"))])
# with(p.div@data, div.no[which(Name %in% c("Willis 1", "Gillihan 11", "Heath 10", "Patterson 15", "Albretheson 17", "Kilpatrick 18", "Iden 19", "Iden 19B"))])
# with(p.div@data, div.no[which(Name %in% c("Mantey 14P", "Iden 19P", "Man 19P1", "Tick Tock 19TT", "Div 21-23 and 27-29"))])
d$div.no <- c(NA, "8, 27", NA, "1, 99", 100, NA, "28, 101--103", NA, NA, "64, 67, 69",
"89", NA, NA, NA, NA, NA, NA, "81, 87, 90--92", "80, 82--86, 88, 93")
d <- d[, c("BigReachNo", "ReachNo", "Reach", "UpNo", "DownNo", "TribNo", "ret.no", "div.no")]
columns <- c("Reach \\\\ No.",
"Sub- \\\\ reach \\\\ No.",
"Name",
"Upstream \\\\ Site No.",
"Down- \\\\ stream \\\\ Site No.",
"Tributary \\\\ Site No.",
"Return \\\\ No.",
"Diversion \\\\ No.")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Assigned river subreaches of the Big Wood River, Silver Creek, and spring-fed tributaries."
cap2 <- c("\\textbf{Reach No.}: identifier used to locate river reaches in \\hyperref[fig:map_reach]{figure~\\ref{fig:map_reach}}.",
"\\textbf{Subreach No.}: identifier used to locate river subreaches in \\hyperref[fig:map_subreach]{figure~\\ref{fig:map_subreach}}.",
"\\textbf{Name}: local subreach name used in this study.",
"\\textbf{Site No.}: identifier used to locate streamflow measurement sites in \\hyperref[fig:map_sites]{figure~\\ref{fig:map_sites}} and \\hyperref[table_sites]{table~\\ref{table_sites}}.",
"No upstream site number indicates that the reach is spring-fed.",
"\\textbf{Return No.}: identifier used to locate return flows in \\hyperref[fig:map_ret]{figure~\\ref{fig:map_ret}} and \\hyperref[table_ret]{table~\\ref{table_ret}}.",
"\\textbf{Diversion No.}: identifier used to locate stream diversions in \\hyperref[fig:map_div]{figure~\\ref{fig:map_div}} and \\hyperref[table_div]{table~\\ref{table_div}}.",
"\\textbf{Abbreviations}: --, not present")
tbl <- xtable::xtable(d, label="table_subreach")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "c", "p{2.0in}", "c", "c", "c", "c", "c")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="--",
sanitize.text.function=identity)
## ----table_seepage, echo=FALSE, results="asis"---------------------------
d <- subreach.recharge[, c("ReachNo", "Reach", "Aug", "Oct", "Mar")]
d[, c("Aug_cfs", "Oct_cfs", "Mar_cfs")] <- d[, c("Aug", "Oct", "Mar")] * (1 / cfs.to.m3.per.d)
columns <- c("Subreach \\\\ No.", "Name",
"Aug 2012 \\\\ (m\\textsuperscript{3}/d)",
"Oct 2012 \\\\ (m\\textsuperscript{3}/d)",
"Mar 2013 \\\\ (m\\textsuperscript{3}/d)",
"Aug 2012 \\\\ (cfs)",
"Oct 2012 \\\\ (cfs)",
"Mar 2013 \\\\ (cfs)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Estimated stream-aquifer flow exchange in river subreaches for August 2012, October 2012, and March 2013; modified from \\citet{Bartolino2014}."
cap2 <- c("\\textbf{Subreach No.}: identifier used to locate river subreaches in \\hyperref[fig:map_subreach]{figure~\\ref{fig:map_subreach}}.",
"\\textbf{Name}: local subreach name used in this study.",
"\\textbf{Abbreviations}: m\\textsuperscript{3}/d, cubic meters per day; cfs, cubic-feet per second; --, not available because of missing tributary inflows to the Big Wood River above Hailey")
tbl <- xtable::xtable(d, label="table_seepage")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "p{2.2in}", "r", "r", "r", "r", "r", "r")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE, NA.string="--",
sanitize.colnames.function=function(x){x}, size="\\small", format.args=list(big.mark=","))
## ----table_pdiff, echo=FALSE, results="asis"-----------------------------
mo <- substr(reach.recharge$YearMonth, 5, 6)
yr <- unique(substr(reach.recharge$YearMonth, 1, 4))
reach.no <- sort(unique(subreach.recharge$BigReachNo))
x <- data.frame(BigReachNo=rep(reach.no, each=length(yr)))
x$Aug <- with(reach.recharge[mo == "08", ], c(nKet_Hai, Hai_StC, SilverAbv))
x$Oct <- with(reach.recharge[mo == "10", ], c(nKet_Hai, Hai_StC, SilverAbv))
x$Mar <- with(reach.recharge[mo == "03", ], c(nKet_Hai, Hai_StC, SilverAbv))
y <- aggregate(subreach.recharge[, c("Aug", "Oct", "Mar")], by=list(BigReachNo=subreach.recharge$BigReachNo), sum)
y <- y[match(x$BigReachNo, y$BigReachNo), ]
d <- (abs(x - y) / (abs(x) + abs(y) / 2) * 100)[, -1]
d$BigReachNo <- x$BigReachNo
d$BigReach <- as.character(subreach.recharge$BigReach[match(d$BigReachNo, subreach.recharge$BigReachNo)])
d$Year <- rep(yr, length(reach.no))
d <- d[, c("BigReachNo", "BigReach", "Year", "Aug", "Oct", "Mar")]
d <- d[as.integer(d$Year) >= 2000L, ]
is.dup <- duplicated(d$BigReachNo)
d$BigReachNo[is.dup] <- ""
d$BigReach[is.dup] <- ""
columns <- c("Reach \\\\ No.", "Name", "Year",
"August \\\\ (1)",
"October \\\\ (1)",
"March \\\\ (1)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Percent difference between stream-aquifer flow exchange values estimated in river reaches during August, October, and March of 2000 through 2010; and in river subreaches aggregated by reach during August 2012, October 2012, and March 2013."
cap2 <- c("\\textbf{Subreach No.}: identifier used to locate river subreaches in \\hyperref[fig:map_subreach]{figure~\\ref{fig:map_subreach}}.",
"\\textbf{Name}: local reach name used in this study.",
"\\textbf{Year}: the measurement year.",
"\\textbf{Abbreviations}: --, not available")
tbl <- xtable::xtable(d, label="table_pdiff")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "l", "c", "r", "r", "r")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE, NA.string="--",
sanitize.colnames.function=function(x){x}, size="\\small", format.args=list(big.mark=","))
## ----table_ratio, echo=FALSE, results="asis"-----------------------------
d <- aggregate(subreach.recharge[, c("Aug", "Oct", "Mar")], by=list(BigReachNo=subreach.recharge$BigReachNo), sum)
d <- d[match(subreach.recharge$BigReachNo, d$BigReachNo), -1]
ratio <- subreach.recharge[, c("Aug", "Oct", "Mar")] / d
d <- data.frame(subreach.recharge[, c("ReachNo", "Reach")], ratio)
columns <- c("Subreach \\\\ No.", "Name",
"Aug 2012 \\\\ (1)",
"Oct 2012 \\\\ (1)",
"Mar 2013 \\\\ (1)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Stream-aquifer flow-exchange ratio between river subreaches and their corresponding reach, for August 2012, October 2012, and March 2013."
cap2 <- c("\\textbf{Subreach No.}: identifier used to locate river subreaches in \\hyperref[fig:map_subreach]{figure~\\ref{fig:map_subreach}}.",
"\\textbf{Name}: local subreach name used in this study.",
"\\textbf{Abbreviations}: --, not available")
tbl <- xtable::xtable(d, label="table_ratio")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- c(0, 0, 0, 2, 2, 2)
xtable::align(tbl) <- c("l", "c", "l", "r", "r", "r")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE, NA.string="--",
sanitize.colnames.function=function(x){x}, size="\\small", format.args=list(big.mark=","))
## ----include=FALSE-------------------------------------------------------
v <- "Location of the Silver Creek and Stanton Crossing groundwater outlet boundaries."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_drains, echo=FALSE, fig.width=fin.map.s.0[1], fig.height=fin.map.s.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
l <- rgeos::gIntersection(drains, as(alluvium.extent, "SpatialLinesDataFrame"), TRUE)
l <- SpatialLinesDataFrame(l, data=drains@data, match.ID=FALSE)
cols <- c("#F02311", "#FBB829")
PlotMap(crs(hill.shading), xlim=usr.map.s[1:2], ylim=usr.map.s[3:4], bg.image=hill.shading,
bg.image.alpha=0.6, dms.tick=TRUE, rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
plot(alluvium.extent, border="#FFFFFFCC", col=NA, add=TRUE)
leg <- c("Stanton Crossing", "Silver Creek")
plot(l[match(l@data$Name, leg), ], col=cols, lwd=2, add=TRUE)
plot(cities, pch=15, cex=0.8, col="#333333", add=TRUE)
text(cities, labels=cities@data$FEATURE_NA, col="#333333", cex=0.5, pos=3, offset=0.4)
legend("topleft", leg, lwd=2, col=cols, border=NA, inset=0.02, cex=0.7,
box.lty=1, box.lwd=0.5, xpd=NA, bg="#FFFFFFE7", title=expression(bold("Outlet Boundaries")))
AddInsetMap(alluvium.extent, width=1, main.label=list("AQUIFER", adj=c(0.25, -9)),
sub.label=list("Map area", adj=c(1.65, 0.5)), loc="topright")
## ----table_zones, echo=FALSE, results="asis"-----------------------------
d <- kriging.zones@data
FUN <- function(i) which(as.character(pilot.points@data$Zone) == i)
pnts.in.zone <- lapply(as.character(kriging.zones@data$Zone), FUN)
names(pnts.in.zone) <- kriging.zones@data$Zone
d$NumPoints <- sapply(pnts.in.zone, length)
# print(pnts.in.zone)
d$Points <- c("1, 3, 4, 6--8, 11, 14--17, 19, 23, 24, 26, 32, 35--38, 41--59",
"30, 31", "33, 34", "39, 40", 2, 5, "12, 13", "9, 10", "20--22",
18, 25, "27--29", "60--72, 74--76, 83, 84", "77--80", "73, 81, 82",
"85--95, 97, 98, 105, 106", "99--102", "96, 103, 104")
d <- d[, c("Layer", "Zone", "Name", "NumPoints", "Points")]
d$Layer[duplicated(d$Layer)] <- ""
columns <- c("Model \\\\ layer", "Zone", "Name", "No. of \\\\ points", "Point No.")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Zones and pilot-points within the model domain."
cap2 <- c("\\textbf{Zone}: identifier used to locate a zone in \\hyperref[fig:map_pilot]{figure~\\ref{fig:map_pilot}}.",
"\\textbf{Name}: local zone name used in this study.",
"\\textbf{No. of points}: contained within a zone.",
"\\textbf{Point No.}: identifier used to locate pilot points in \\hyperref[fig:map_pilot]{figure~\\ref{fig:map_pilot}}.")
tbl <- xtable::xtable(d, label="table_zones")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- 0
xtable::align(tbl) <- c("l", "c", "c", "l", "r", "p{1.5in}")
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
sanitize.colnames.function=function(x){x}, size="\\small", NA.string="NA")
## ----echo=FALSE----------------------------------------------------------
FUN <- function(layer) {
is <- kriging.zones@data$Layer == layer
zones <- kriging.zones@data$Zone
zones <- as.character(zones)[match(zones, levels(zones))][is]
kz <- kriging.zones[is, ]
r <- rasterize(kz, land.surface, "Zone")
dc <- (layer - 1L) * 0.1
Pal <- function(...) rainbow(..., s=1, v=0.5, start=0.1 + dc, end=1.0 - dc, alpha=0.6)
PlotMap(r, xlim=usr.map[1:2], ylim=usr.map[3:4], pal=Pal,
bg.image=hill.shading, dms.tick=TRUE, bg.image.alpha=0.6,
rivers=list(x=streams.rivers), lakes=list(x=lakes), draw.key=FALSE,
credit=credit, scale.loc="bottomleft")
is.layer <- pilot.points@data$Layer == layer
pp <- pilot.points[is.layer, ]
points(pp, pch=21, cex=0.6, col="#333333", bg="#333333")
text(pp, labels=seq_along(pilot.points)[is.layer], col="#333333",
cex=0.6, pos=1, offset=0.3)
text(kz, labels=zones, col="black", cex=0.7, pos=1, offset=0.5, font=2)
labs <- as.character(kz@data$Zone)
cols <- Pal(length(labs))
legend("topright", labs, pch=22, col=cols, pt.bg=cols,
pt.cex=1, inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7",
text.font=2, title=expression(bold("Zone")))
legend("topright", "Pilot point", pch=21, col="#333333", pt.bg="#333333",
pt.cex=0.6, inset=c(0.1, 0.02), cex=0.7, box.lty=1, box.lwd=0.5, bg="#FFFFFFE7")
}
## ----map_pilot_a, echo=FALSE, results="asis", fig.width=fin.map.0[1], fig.height=fin.map.0[2]----
FUN(1L)
## ----include=FALSE-------------------------------------------------------
v <- "Spatial distribution of the pilot points and zones in (\\textit{\\textbf{A}}) model layer~1, (\\textit{\\textbf{B}}) model layer~2, and (\\textit{\\textbf{C}}) model layer~3. \\label{fig:map_pilot}"
v <- c(paste("Maps showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_pilot_b, echo=FALSE, results="asis", fig.width=fin.map.0[1], fig.height=fin.map.0[2]----
FUN(2L)
## ----map_pilot_c, echo=FALSE, results="asis", fig.width=fin.map.0[1], fig.height=fin.map.0[2]----
FUN(3L)
## ----table_hk_sc, echo=FALSE, results="asis"-----------------------------
d <- zone.properties
d$zone <- c("A--M, P", "N, Q", "O", "R")
d$unit <- c("Alluvium (unconfined)", "Basalt", "Clay", "Alluvium (confined)")
d$hk <- ToScientific(d$hk, digits=1)
d$sc <- ToScientific(d$sc, digits=1)
d <- d[, c("zone", "unit", "hk", "vani", "sc")]
columns <- c("Zone",
"Hydrogeologic unit",
"Hydraulic \\\\ conductivity \\\\ (m/d)",
"Vertical \\\\ anisotropy \\\\ (1)",
"Storage \\\\ coefficient \\\\ (1)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Starting values of horizontal hydraulic conductivity, vertical anisotropy, and storage coefficient; values assigned to each zone in the model domain."
cap2 <- c("\\textbf{Hydraulic conductivity}: is the horizontal hydraulic conductivity.",
"\\textbf{Vertical anisotropy}: is the ratio of horizontal to vertical hydraulic conductivity.",
"\\textbf{Storage coefficient}: for saturated conditions it is the product of specific storage and the saturated thickness of the aquifer; for partially-saturated conditions it is virtually equal to the specific yield.",
"\\textbf{Abbreviations}: m/d, meters per day")
tbl <- xtable::xtable(d, label="table_hk_sc")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- c(0, 0, 0, 1, 0, 1)
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
format.args=list(big.mark=","), sanitize.colnames.function=function(x){x},
sanitize.text.function=identity, size="\\small")
## ----table_tribs, echo=FALSE, results="asis"-----------------------------
d <- tributaries@data
d <- data.frame(Name=d$Name, ID=seq_len(nrow(d)), d[, -1])
d <- d[, c("Name", "ID", "Flow", "PrecipFlow")]
d$s.up <- 0.2 * (d$PrecipFlow / d$Flow)
columns <- c("Name",
"Trib \\\\ No.",
"Flow \\\\ rate \\\\ $\\overline{Q}$ \\\\ (m\\textsuperscript{3}/d)",
"Precip. \\\\ flow \\\\ $\\overline{Q}_{p}$ \\\\ (m\\textsuperscript{3}/d)",
"Upper bound \\\\ on scalar \\\\ $s_{\\mathit{up}}$ \\\\ (1)")
colnames(d) <- sprintf("\\textbf{\\shortstack{%s}}", columns)
cap1 <- "Upper bound placed on scalar components of the mean tributary basin underflow."
cap2 <- c("\\textbf{Trib No.}: is an identifier used to locate the tributary model boundaries on the map in \\hyperref[fig:map_tribs]{figure~\\ref{fig:map_tribs}}.",
"\\textbf{Flow rate}: is the empirically derived estimate of the mean tributary basin underflow.",
"\\textbf{Precip. flow}: is the precipitation estimate of mean tributary basin underflow.",
"\\textbf{Abbreviations}: m\\textsuperscript{3}/d, cubic meters per day")
tbl <- xtable::xtable(d, label="table_tribs")
xtable::caption(tbl) <- c(sprintf("%s [%s]", cap1, paste(cap2, collapse=" ")), cap1)
xtable::digits(tbl) <- c(0, 0, 0, 0, 0, 1)
print(tbl, include.rownames=FALSE, caption.placement="top", booktabs=TRUE,
format.args=list(big.mark=","), sanitize.colnames.function=function(x){x},
size="\\small")
## ----include=FALSE-------------------------------------------------------
v <- "Location of underflow boundaries in the major tributary canyons and the upper part of the Wood River Valley."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_tribs, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
PlotMap(crs(alluvium.thickness), xlim=usr.map[1:2], ylim=usr.map[3:4], bg.image=hill.shading, dms.tick=TRUE,
bg.image.alpha=0.6, rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
cols <- c("#F02311", "#FFFFFFCC")
plot(alluvium.extent, border=cols[3], col="#33333366", add=TRUE)
l <- rgeos::gIntersection(as(tributaries, "SpatialLinesDataFrame"), alluvium.extent, TRUE)
trib.lines <- SpatialLinesDataFrame(l, data=tributaries@data, match.ID=FALSE)
plot(trib.lines, lwd=4, col=cols[1], add=TRUE)
pos <- c(2, 4, 2, 2, 2, 3, 1, 1, 4, 3,
4, 1, 1, 1, 2, 4, 2, 1, 1, 3,
2, 4, 1)
text(getSpatialLinesMidPoints(trib.lines), labels=rownames(trib.lines@data),
col="#333333", cex=0.6, pos=pos, offset=0.4)
plot(cities, pch=15, cex=0.8, col="#333333", add=TRUE)
text(cities, labels=cities@data$FEATURE_NA, col="#333333", cex=0.5, pos=1, offset=0.4)
leg <- c("Underflow boundaries", "Aquifer extent")
legend("topright", leg, pch=c(15, 22), lwd=NA, col=cols, pt.bg="#33333366",
pt.cex=c(0.7, 1.5), inset=0.02, cex=0.7, box.lty=1, box.lwd=0.5,
bg="#FFFFFFE7", seg.len=1.4)
## ----include=FALSE-------------------------------------------------------
v <- "Irrigation entities in the Wood River Valley, Idaho."
v <- c(paste("Map showing", paste0(tolower(substr(v, 1, 1)), substr(v, 2, nchar(v)))), v)
## ----map_eff, echo=FALSE, fig.width=fin.map.0[1], fig.height=fin.map.0[2], fig.scap=sprintf("{%s}", v[1]), fig.cap=sprintf("{%s}", v[2])----
p <- irr.entities
p@data <- dplyr::left_join(p@data[, "EntityName", drop=FALSE], efficiency, by="EntityName")
PlotMap(crs(hill.shading), xlim=usr.map[1:2], ylim=usr.map[3:4], bg.image=hill.shading,
bg.image.alpha=0.6, dms.tick=TRUE, rivers=list(x=streams.rivers), lakes=list(x=lakes),
credit=credit, scale.loc="bottomleft")
cols <- c("#66C2A5B3", "#FC8D62B3")
plot(p, col=cols[as.integer(p@data$Comment)], border="#FFFFFFCC", lwd=0.5, add=TRUE)
plot(cities, pch=15, cex=0.8, col="#333333", add=TRUE)
text(cities, labels=cities@data$FEATURE_NA, col="#333333", cex=0.5, pos=1, offset=0.4)
leg <- c("Irrigation entity", "Irrigation entity with possible natural sub-irrigation")
legend("topright", leg, fill=cols, border="#FFFFFFCC", inset=0.02, cex=0.7, box.lty=1,
box.lwd=0.5, xpd=NA, bg="#FFFFFFE7")
## ----table_weights, echo=FALSE, results="asis"---------------------------
d <- data.frame(typ=c("Groundwater level", "", "", "", "",
"Stream-aquifer flow exchange", "", "", "", "",
"Stream-aquifer flow-exchange ratio",
"Groundwater discharge", "",
"Horizontal hydraulic conductivity", "",
"Vertical anisotropy",
"Storage coefficient",
"Riverbed conductance",
"Irrigation efficiency",
"Scalar component",
"Moving average duration",
"Amplitude-reduction factor"),
grp=c("U.S. Geologic Survey monitoring network wells",
"Geolocated driller wells",
"Public Land Survey System-located driller wells",
"Sun Valley Water and Sewer production well",
"The Nature Conservancy monitoring network well",
"Big Wood River, Near Ketchum to Hailey reach",
"Big Wood River, Hailey to Stanton Crossing reach",
"Willow Creek reach",
"Silver Creek, above Sportsman Access reach",
"Silver Creek, Sportsman Access to near Picabo reach",
"Subreaches of the Big Wood River, Silver Creek, and spring-fed tributaries",
"Stanton Crossing outlet boundary",
"Silver Creek outlet boundary",
"Pilot points in each zone (\\hyperref[fig:map_pilot]{fig.~\\ref{fig:map_pilot}})",
"Pilot points in zones A, M, and P",
"Global value",
"Pilot points in each zone",
"Willow Creek reach and Silver Creek, Sportsman Access to Near Picabo reach; subreaches of the Big Wood River, Silver Creek, and spring-fed tributaries",
"Irrigated lands",
"Tributary boundaries",
"Global value for all tributary boundaries",
"Global value for all tributary boundaries"),