Project

General

Profile

« Previous | Next » 

Revision 7cf747b0

Added by Jim Regetz over 13 years ago

  • ID 7cf747b082743603bbcf9022e5ed1303b448bb4b

updated boundary assessment code to use multires spline results

View differences:

terrain/slope/slope-assessment.R
14 14
s.aster <- raster(file.path(datadir, "aster_300straddle_s.tif"))
15 15
s.srtm <- raster(file.path(datadir, "srtm_150below_s.tif"))
16 16
s.uncor <- raster(file.path(datadir, "fused_300straddle_s.tif"))
17
s.eramp <- raster(file.path(datadir, "fused_300straddle_rampexp_s.tif"))
17
s.enblend <- raster(file.path(datadir, "fused_300straddle_enblend_s.tif"))
18 18
s.bg <- raster(file.path(datadir, "fused_300straddle_blendgau_s.tif"))
19 19
s.can <- raster(file.path(datadir, "cdem_300straddle_s.tif"))
20 20

  
......
31 31
#
32 32

  
33 33
par(mfrow=c(2,2), omi=c(1,1,1,1))
34

  
34 35
ylim <- c(1, 6)
35 36

  
36
plot(lats300, rowMeans(as.matrix(s.uncor), na.rm=TRUE), type="l",
37
plot(lats300, rowMeans(as.matrix(s.can), na.rm=TRUE), type="l",
37 38
    xlab="Latitude", ylab="Mean slope", ylim=ylim)
38
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="uncorrected")
39
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="Original DEMs")
40
lines(lats300, rowMeans(as.matrix(s.aster), na.rm=TRUE), col="blue")
41
lines(lats150, rowMeans(as.matrix(s.srtm), na.rm=TRUE), col="red")
42
legend("topright", legend=c("ASTER", "SRTM", "CDED"), col=c("blue",
43
    "red", "black"), lty=c(1, 1), bty="n")
39 44
abline(v=60, col="red", lty=2)
40 45
mtext(expression(paste("Latitudinal profiles of mean slope (",
41 46
    136*degree, "W to ", 96*degree, "W)")), adj=0, line=2, font=2)
42 47

  
43
plot(lats300, rowMeans(as.matrix(s.can), na.rm=TRUE), type="l",
48
plot(lats300, rowMeans(as.matrix(s.uncor), na.rm=TRUE), type="l",
44 49
    xlab="Latitude", ylab="Mean slope", ylim=ylim)
45
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="Canada DEM")
50
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="simple fused")
46 51
abline(v=60, col="red", lty=2)
47 52

  
48
plot(lats300, rowMeans(as.matrix(s.eramp), na.rm=TRUE), type="l",
53
plot(lats300, rowMeans(as.matrix(s.enblend), na.rm=TRUE), type="l",
49 54
    xlab="Latitude", ylab="Mean slope", ylim=ylim)
50
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="exponential ramp")
55
text(min(lats300), max(ylim)-0.5, pos=4, font=3, labels="multires spline")
51 56
abline(v=60, col="red", lty=2)
52 57

  
53 58
plot(lats300, rowMeans(as.matrix(s.bg), na.rm=TRUE), type="l",
......
75 80
lines(lats150, rmse(crop(s.uncor, extent(s.srtm)), s.srtm), col="blue")
76 81
legend("topright", legend=c("ASTER", "SRTM"), col=c("black", "blue"),
77 82
    lty=c(1, 1), bty="n")
78
text(min(lats300), 4.5, pos=4, font=3, labels="uncorrected")
83
text(min(lats300), 4.5, pos=4, font=3, labels="simple fused")
79 84
abline(v=60, col="red", lty=2)
80 85
mtext(expression(paste(
81 86
    "Slope discrepancies with respect to separate ASTER/SRTM components (",
82 87
    136*degree, "W to ", 96*degree, "W)")), adj=0, line=2, font=2)
83 88

  
84
plot(lats300, rmse(s.eramp, s.aster), type="l", xlab="Latitude",
89
plot(lats300, rmse(s.enblend, s.aster), type="l", xlab="Latitude",
85 90
    ylab="RMSE", ylim=c(0, 5))
86
lines(lats150, rmse(crop(s.eramp, extent(s.srtm)), s.srtm), col="blue")
91
lines(lats150, rmse(crop(s.enblend, extent(s.srtm)), s.srtm), col="blue")
87 92
legend("topright", legend=c("ASTER", "SRTM"), col=c("black", "blue"),
88 93
    lty=c(1, 1), bty="n")
89
text(min(lats300), 4.5, pos=4, font=3, labels="exponential ramp")
94
text(min(lats300), 4.5, pos=4, font=3, labels="multires spline")
90 95
abline(v=60, col="red", lty=2)
91 96

  
92 97
plot(lats300, rmse(s.bg, s.aster), type="l", xlab="Latitude",
......
100 105
# ...with respect to CDEM
101 106
plot(lats300, rmse(s.uncor, s.can), type="l", xlab="Latitude",
102 107
    ylab="RMSE", ylim=c(0, 5))
103
text(min(lats300), 4.5, pos=4, font=3, labels="uncorrected")
108
text(min(lats300), 4.5, pos=4, font=3, labels="simple fused")
104 109
abline(v=60, col="red", lty=2)
105 110
mtext(expression(paste(
106 111
    "Slope discrepancies with respect to Canada DEM (",
107 112
    136*degree, "W to ", 96*degree, "W)")), adj=0, line=2, font=2)
108 113

  
109
plot(lats300, rmse(s.eramp, s.can), type="l", xlab="Latitude",
114
plot(lats300, rmse(s.enblend, s.can), type="l", xlab="Latitude",
110 115
    ylab="RMSE", ylim=c(0, 5))
111
text(min(lats300), 4.5, pos=4, font=3, labels="exponential ramp")
116
text(min(lats300), 4.5, pos=4, font=3, labels="multires spline")
112 117
abline(v=60, col="red", lty=2)
113 118

  
114 119
plot(lats300, rmse(s.bg, s.can), type="l", xlab="Latitude",
......
142 147
lines(lats150, corByLat(crop(s.uncor, extent(s.srtm)), s.srtm), col="blue")
143 148
legend("bottomright", legend=c("ASTER", "SRTM"), col=c("black", "blue"),
144 149
    lty=c(1, 1), bty="n")
145
text(min(lats300), min(ylim), pos=4, font=3, labels="uncorrected")
150
text(min(lats300), min(ylim), pos=4, font=3, labels="simple fused")
146 151
abline(v=60, col="red", lty=2)
147 152
mtext(expression(paste(
148 153
    "Slope correlations with respect to separate ASTER/SRTM components (",
149 154
    136*degree, "W to ", 96*degree, "W)")), adj=0, line=2, font=2)
150 155

  
151
plot(lats300, corByLat(s.eramp, s.aster), type="l", xlab="Latitude",
156
plot(lats300, corByLat(s.enblend, s.aster), type="l", xlab="Latitude",
152 157
    ylab="Correlation", ylim=ylim)
153
lines(lats150, corByLat(crop(s.eramp, extent(s.srtm)), s.srtm), col="blue")
158
lines(lats150, corByLat(crop(s.enblend, extent(s.srtm)), s.srtm), col="blue")
154 159
legend("bottomright", legend=c("ASTER", "SRTM"), col=c("black", "blue"),
155 160
    lty=c(1, 1), bty="n")
156
text(min(lats300), min(ylim), pos=4, font=3, labels="exponential ramp")
161
text(min(lats300), min(ylim), pos=4, font=3, labels="multires spline")
157 162
abline(v=60, col="red", lty=2)
158 163

  
159 164
plot(lats300, corByLat(s.bg, s.aster), type="l", xlab="Latitude",
......
167 172
# ...with respect to CDEM
168 173
plot(lats300, corByLat(s.uncor, s.can), type="l", xlab="Latitude",
169 174
    ylab="Correlation", ylim=ylim)
170
text(min(lats300), min(ylim), pos=4, font=3, labels="uncorrected")
175
text(min(lats300), min(ylim), pos=4, font=3, labels="simple fused")
171 176
abline(v=60, col="red", lty=2)
172 177
mtext(expression(paste(
173 178
    "Slope correlations with respect to Canada DEM (",
174 179
    136*degree, "W to ", 96*degree, "W)")), adj=0, line=2, font=2)
175 180

  
176
plot(lats300, corByLat(s.eramp, s.can), type="l", xlab="Latitude",
181
plot(lats300, corByLat(s.enblend, s.can), type="l", xlab="Latitude",
177 182
    ylab="Correlation", ylim=ylim)
178
text(min(lats300), min(ylim), pos=4, font=3, labels="exponential ramp")
183
text(min(lats300), min(ylim), pos=4, font=3, labels="multires spline")
179 184
abline(v=60, col="red", lty=2)
180 185

  
181 186
plot(lats300, corByLat(s.bg, s.can), type="l", xlab="Latitude",

Also available in: Unified diff