Revision 19c867b6
Added by Jim Regetz over 13 years ago
- ID 19c867b60534beb658bcd46fad6d2b08ec7f9106
terrain/dem/dem-fusion.txt | ||
---|---|---|
120 | 120 |
|
121 | 121 |
# 2a: exponential distance-weighting of LOESS predicted deltas |
122 | 122 |
r <- -0.045 |
123 |
w <- exp(ydistN*r)
|
|
123 |
w <- exp(r*ydistN)
|
|
124 | 124 |
aster.north.smooth <- aster.north |
125 | 125 |
aster.north.smooth[] <- values(aster.north) + as.integer(round(t(w * |
126 | 126 |
as.matrix(aster.north.pdelta)))) |
... | ... | |
128 | 128 |
|
129 | 129 |
# 2b: gaussian distance-weighting of LOESS predicted deltas |
130 | 130 |
r <- -0.001 # weight drops to 0.5 at ~26 cells, ie 2.4km at 3" res |
131 |
w <- exp(-0.001*ydistN^2)
|
|
131 |
w <- exp(r*ydistN^2)
|
|
132 | 132 |
aster.north.smooth <- aster.north |
133 | 133 |
aster.north.smooth[] <- values(aster.north) + as.integer(round(t(w * |
134 | 134 |
as.matrix(aster.north.pdelta)))) |
... | ... | |
202 | 202 |
|
203 | 203 |
library(raster) |
204 | 204 |
|
205 |
uncorrected <- raster("fused_300straddle_hs.tif")
|
|
206 |
rampexp <- raster("fused_300straddle_rampexp_hs.tif")
|
|
207 |
blendgau <- raster("fused_300straddle_blendgau_hs.tif")
|
|
205 |
uncorrected <- raster("fused_300straddle_h.tif") |
|
206 |
rampexp <- raster("fused_300straddle_rampexp_h.tif") |
|
207 |
blendgau <- raster("fused_300straddle_blendgau_h.tif") |
|
208 | 208 |
|
209 | 209 |
window <- extent(-135, -134, 59.875, 60.125) |
210 | 210 |
|
211 |
png("boundary-hillshade.png", height=8, width=8, units="in", res=600)
|
|
212 |
par(mfrow=c(3,1)) |
|
211 |
png("boundary-hillshade.png", height=10, width=7.5, units="in", res=600)
|
|
212 |
par(mfrow=c(3,1), mar=c(2,4,4,2))
|
|
213 | 213 |
plot(crop(uncorrected, window), main="uncorrected (hillshade)") |
214 | 214 |
plot(crop(rampexp, window), main="north exponential ramp (hillshade)") |
215 | 215 |
plot(crop(blendgau, window), main="south gaussian blend (hillshade)") |
Also available in: Unified diff
superficial tweaks to DEM fusion R code