@@ -62,41 +62,57 @@ library(sharpshootR)
62
62
library(reshape2)
63
63
library(latticeExtra)
64
64
library(tactile)
65
- library(maps)
65
+ library(terra)
66
+ library(spData)
66
67
67
- # get basic sensor metadata for several SCAN/SNOTEL sites
68
- m <- SCAN_site_metadata(site.code= c(2072,356,2148,2187))
68
+ # get basic station metadata for several SCAN/SNOTEL sites
69
+ m <- SCAN_site_metadata(site.code = c(2072, 356, 2148, 2187))
69
70
70
- knitr::kable(m, row.names = FALSE)
71
+ # select columns from station metadata
72
+ knitr::kable(m[, c('Site', 'Name', 'Network', 'HUC', 'upedonid')], row.names = FALSE)
71
73
72
74
# result is a list
73
- x <- fetchSCAN(site.code= c(574), year= c(2016))
75
+ x <- fetchSCAN(site.code = c(574), year = c(2016))
74
76
75
- # print a list of sensor types
76
- names(x[-1] )
77
+ # print a list of sensor types and associated metadata
78
+ names(x)
77
79
```
78
80
79
81
80
82
## Metadata for all Stations
81
83
82
- ``` {r, fig.width=8, fig.height=7 }
84
+ ``` {r}
83
85
data('SCAN_SNOTEL_metadata', package = 'soilDB')
84
86
85
- map('state', lwd=2)
86
- title(main='SCAN / SNOTEL Sites')
87
- points(Latitude ~ Longitude, data=SCAN_SNOTEL_metadata, subset=Network == 'SCAN', bg='DarkRed', pch=21)
88
- points(Latitude ~ Longitude, data=SCAN_SNOTEL_metadata, subset=Network == 'SNOTEL', bg='RoyalBlue', pch=21)
87
+ # number of stations by network
88
+ table(SCAN_SNOTEL_metadata$Network)
89
+ ```
90
+
91
+ ``` {r, fig.width=8, fig.height=7}
92
+ data("us_states")
93
+ us_states <- vect(us_states)
94
+ us_states <- project(us_states, 'epsg:5070')
89
95
90
- legend('bottomleft', legend=c('SCAN', 'SNOTEL'), pch=21, pt.bg=c('DarkRed', 'RoyalBlue'), bty='n')
96
+ s <- vect(SCAN_SNOTEL_metadata, geom = c('Longitude', 'Latitude'), crs = 'epsg:4269')
97
+ s <- project(s, 'epsg:5070')
91
98
```
92
99
100
+
101
+ ``` {r, fig.width=8, fig.height=7}
102
+ plot(us_states, axes = FALSE, main = 'SCAN, SNOTEL, CSCAN, SNOWLITE Stations')
103
+ points(s[s$Network %in% c('SCAN', 'CSCAN')], col = 'firebrick')
104
+ points(s[s$Network %in% c('SNTL', 'SNTLT')], col = 'royalblue')
105
+
106
+ legend(x = -2029093, y = 801043.2, legend = c('SCAN / CSCAN', 'SNOTEL / SNOWLITE'), pch = 21, pt.bg = c('firebrick', 'royalblue'), bty = 'n')
107
+ ```
108
+
109
+
93
110
``` {r, fig.width=8, fig.height=7}
94
- map('state', lwd=2)
95
- title(main='SCAN / SNOTEL Sites')
96
- points(Latitude ~ Longitude, data=SCAN_SNOTEL_metadata, bg='RoyalBlue', pch=21, cex=0.85)
97
- points(Latitude ~ Longitude, data=SCAN_SNOTEL_metadata, subset=!is.na(pedlabsampnum), bg='DarkRed', pch=22)
111
+ plot(us_states, axes = FALSE, main = 'SCAN, SNOTEL, CSCAN, SNOWLITE Stations')
112
+ points(s, col = 'royalblue')
113
+ points(s[!is.na(s$pedlabsampnum), ], col = 'firebrick')
98
114
99
- legend('bottomleft', legend= c('All Stations', 'Linked to Lab Data'), pch=c( 21, 22), pt.bg= c('RoyalBlue ', 'DarkRed '), bty= 'n')
115
+ legend(x = -2029093, y = 801043.2, legend = c('All Stations', 'Linked to Lab Data'), pch = 21, pt.bg = c('royalblue ', 'firebrick '), bty = 'n')
100
116
```
101
117
102
118
@@ -457,7 +473,7 @@ Get KSSL data for this site, via user pedon ID. This will include estimated para
457
473
Previously the VG parameters had to be obtained manually from [ these reports] ( https://ncsslabdatamart.sc.egov.usda.gov/rptExecute.aspx?p=34942&r=6&submit1=Get+Report ) .
458
474
``` {r}
459
475
# get KSSL data
460
- s <- fetchKSSL(pedon_id = 'S08NV003003')
476
+ s <- fetchLDM(x = 'S08NV003003', what = 'upedonid ')
461
477
462
478
# VG parameters now returned by fetchKSSL() as of 2016-11-17
463
479
knitr::kable(horizons(s)[, c('hzn_desgn', 'hzn_top', 'hzn_bot', 'theta_r', 'theta_s', 'alpha', 'npar')])
0 commit comments