Project

General

Profile

« Previous | Next » 

Revision d126363c

Added by Jim Regetz over 13 years ago

  • ID d126363c25cea14c43c551dc6f0c2528220fbef4

more boundary analysis updates, especially discussion of stats

View differences:

terrain/boundary/boundary.Rnw
43 43
\thispagestyle{plain}
44 44

  
45 45
\title{SRTM/ASTER boundary analysis}
46
\author{Jim Regetz}
47
\date{Last update: 12 Jul 2011}
46
\author{Jim Regetz, NCEAS}
47
\date{Last update: 13 Jul 2011}
48 48

  
49 49
\begin{document}
50 50

  
......
53 53
% don't number document sections
54 54
\setcounter{secnumdepth}{-1}. 
55 55

  
56
\paragraph{Summary of findings}
56
% first compute some values to use in the text
57
<<echo=FALSE,results=hide>>=
58
  # Gaussian weighted average parameters
59
  gwa.r <- 0.001
60
  gwa.50.pix <- round(sqrt(-log(0.5)/gwa.r))
61
  gwa.50.km <- gwa.50.pix * 90 / 1000
62
  gwa.01.pix <- round(sqrt(-log(0.01)/gwa.r))
63
  gwa.01.km <- gwa.01.pix * 90 / 1000
64

  
65
  # mean/median ASTER-SRTM elevation differences
66
  library(raster)
67
  demdir <- "/home/regetz/media/temp/terrain/dem/"
68
  d.srtm <- raster(file.path(demdir, "srtm_150below.tif"))
69
  d.aster <- raster(file.path(demdir, "aster_300straddle.tif"))
70
  d.delta.vals <- values(crop(d.aster, extent(d.srtm))) - values(d.srtm)
71
  delta.median <- median(d.delta.vals)
72
  delta.mean <- mean(d.delta.vals)
73
  delta.sd <- sd(d.delta.vals)
74
  delta.q <- quantile(d.delta.vals, c(0.1, 0.25, 0.75, 0.9))
75
@
76

  
77
\paragraph{Brief summary of findings}
57 78
\begin{itemize}
58
 \item Big SRTM vs ASTER differences:
79
 \item SRTM vs ASTER differences
59 80
  \begin{itemize}
60
   \item ASTER is generally lower, by 12 meters in the median case
61
   \item ASTER has numerous spurious spikes
81
   \item ASTER is systematically lower, by 12 meters in the median case
82
   \item \ldots but with variability: standard deviation of
83
     $\mbox{ASTER}_i-\mbox{SRTM}_i$ is \Sexpr{round(delta.sd, 1)}
84
   \item ASTER also has numerous spurious spikes
62 85
   \item ASTER has more high-frequency variability (``texture''),
63 86
     affecting slope/aspect?
64 87
  \end{itemize}
65
 \item Northward exponential rampdown of boundary delta
88
 \item Fusion via northward exponential rampdown of boundary delta
66 89
  \begin{itemize}
67
   \item fixes seam itself
90
   \item eliminates elevation cliff at 60\N
68 91
   \item leaves abrupt transition in SRTM/ASTER textural differences
69
   \item introduces ridging
92
   \item introduces north-south ridging artifacts
93
   \item (\emph{no further treatment in this document})
70 94
  \end{itemize}
71
 \item Blending via multiresolution spline
95
 \item Fusion via multiresolution spline
72 96
  \begin{itemize}
73
   \item fixes seam itself
74
   \item leaves abrupt transition in SRTM/ASTER textural differences
97
   \item eliminates elevation cliff at 60\N
98
   \item leaves abrupt transition in derived slope and aspect
99
   \item unclear whether derived values of aspect and flow direction
100
     in the transition zone are acceptable
75 101
  \end{itemize}
76
 \item Blending via Gaussian weighted average of SRTM/ASTER
102
 \item Fusion via Gaussian weighted average of SRTM/ASTER
77 103
  \begin{itemize}
78
   \item fixes seam itself
79
   \item smooths transition in textural differences
104
   \item eliminates elevation cliff at 60\N
105
   \item also smooths transition slope and aspect
106
   \item unclear whether derived values of aspect and flow direction in
107
     the transition zone are acceptable
80 108
  \end{itemize}
81 109
 \item Canada DEM itself has problems
82 110
  \begin{itemize}
......
88 116
  \begin{itemize}
89 117
   \item N/S bias to aspect, flow direction computed on unprojected data
90 118
     at higher latitudes?
91
   \item Routing will be a big ball of wax
92 119
  \end{itemize}
93 120
\end{itemize}
94 121

  
95 122
\paragraph{To do (possibly)}
96 123
\begin{itemize}
97
 \item add constant offset to ASTER?
98
 \item smooth ASTER?
124
 \item add constant offset of \Sexpr{-delta.median}m to ASTER
125
 \item apply low pass filter to ASTER to reduce high frequency
126
 variation?
127
 \item apply algorithm to remove spikes (\ldots but maybe beyond scope?)
99 128
\end{itemize}
100 129

  
101 130
\clearpage
......
104 133
\section{Terrain layer production methodology}
105 134
%-----------------------------------------------------------------------
106 135

  
107
For the purposes of assessing artifacts associated with the 60\N boundary
108
between SRTM and ASTER, I used a narrow band along the 60\N boundary in
109
Canada (Figure \ref{focal-area}). The latitudinal extent of this band is
110
59.875\N - 60.125\N (i.e., 300 3" pixels straddling 60\N), and the
111
longitudinal extent is 136\W to 96\W (i.e., 48000 pixels wide). For flow
112
direction, a smaller longitudinal swath from 125\W to 100\W was used, due
113
to a $\sim$30k ($2^{15}$) limit to the input raster dimension size in
114
the pre-built GRASS \texttt{r.terraflow} module I used.
136
For the purposes of assessing artifacts associated with the northern
137
boundary between SRTM and ASTER, I focused on a narrow band along the
138
60\N boundary in Canada (Figure \ref{focal-area}). The latitudinal
139
extent of this band is 59.875\N - 60.125\N (i.e., 300 3" pixels
140
straddling 60\N), and the longitudinal extent is 136\W to 96\W (i.e.,
141
48,000 pixels wide). See Listing \ref{code-gdalwarp} for code. Within
142
this focal region, I generated latitudinal profiles of mean elevation,
143
slope, aspect, and flow direction, using the separate SRTM and ASTER
144
component DEMs themselves, using several different fused ASTER/SRTM DEMs
145
(see below), and using the Canadian Digital Elevation Data (CDED) as an
146
independent reference layer
147
(\url{http://www.geobase.ca/geobase/en/data/cded/index.html}). I also
148
then computed latitudinal correlations and RMSEs between the fused
149
layers and each of SRTM, ASTER, and CDED.
115 150

  
116 151
\paragraph{Elevation} This document includes latitudinal
117 152
characterizations of terrain values based on three different variants of
118
a fused ASTER/SRTM DEM. I also explored (and briefly describe below) two
153
a fused 3" ASTER/SRTM DEM. I also explored (and briefly describe below) two
119 154
additional approaches to fusing the layers, but do not include further
120 155
assessment of these here.
121 156

  
......
125 160

  
126 161
\subparagraph{Multiresolution spline} Application of Burt \& Adelson's
127 162
(1983) method for blending overlapping images using multiresolution
128
splines, as implemented in the \emph{enblend} software package (version
129
4.0, http://enblend.sourceforge.net). Data prep and post-processing were
130
handled in R (see Listing \ref{code-enblend}). As presented here, the
131
ASTER and SRTM inputs were prepared such that the overlap zone is 75
132
latitudinal rows (6.75km) (Figure \ref{blend-multires}).
163
splines, as implemented in the \emph{Enblend} software package (version
164
4.0, \url{http://enblend.sourceforge.net}). Data preparation and
165
post-processing were handled in R (see Listing \ref{code-enblend}). As
166
presented here, the SRTM and ASTER inputs were prepared such that the
167
overlap zone is 75 latitudinal rows (6.75km) (Figure
168
\ref{blend-multires}).
133 169

  
134 170
\subparagraph{Gaussian weighted average} Blend of the two layers using
135 171
weighted averaging such that the relative contribution of the SRTM
136
elevation is zero at 60\N, and increases according to a Gaussian function
137
of distance moving south away from 60\N (Equation \ref{eq-gaussian}).
172
elevation is zero at 60\N, and increases as a function of distance
173
moving south away from 60\N (Equation \ref{eq-gaussian}).
138 174
\begin{eqnarray}
139 175
\label{eq-gaussian}
140 176
&fused_{x,y} =
......
149 185
  \mbox{ and }
150 186
  D_{y} \mbox{ is the distance from } 60^\circ \mbox{N in units of pixels.} \nonumber
151 187
\end{eqnarray}
152
For the assessment presented here, the Gaussian weighting function
153
function was parameterized using $r=0.001$, which means that the ASTER
154
and SRTM are equally weighted at a distance of $\sim$2.4km (26 cells)
155
south of the the boundary, and the influence of ASTER is negligible by
156
$\sim$5km (Figure \ref{blend-gaussian}).
157

  
158
\subparagraph{Others not shown} Fused with exponential ramp north of
159
60\N. The first step is to take the pixel-wise difference between ASTER
160
and SRTM in the row immediately below 60\N (i.e., the northmost extent of
161
SRTM). An exponentially declining fraction of this difference is then
162
then added back into the ASTER values north of 60\N. This does a fine job
163
of eliminating the artificial shelf and thus the appearance of a seam
164
right along the 60\N boundary, but it does not address the abrupt
188
For the assessment presented here, the weighting function function was
189
parameterized using $r$=\Sexpr{gwa.r}, producing equal weights for SRTM
190
and ASTER at a distance of $\sim$\Sexpr{round(gwa.50.km, 1)}km
191
(\Sexpr{gwa.50.pix} cells) south of the the boundary, and a relative
192
weight for ASTER of only 1\% by $\sim$\Sexpr{round(gwa.01.km, 1)}km
193
(\Sexpr{gwa.01.pix} cells) (Figure \ref{blend-gaussian}). See
194
\texttt{OPTION 3} in Listing \ref{code-correct}.
195

  
196
\subparagraph{Others not shown} I also experimented with some additional
197
fusion approaches, but have excluded them from further analysis in this
198
document.
199

  
200
\emph{Fused with exponential ramp north of 60\N.}
201
The first step was to take the pixel-wise difference between SRTM and
202
ASTER in the row immediately below 60\N (i.e., the northmost extent of
203
SRTM). An exponentially declining fraction of this difference was then
204
then added back into the ASTER values north of 60\N. This does a fine
205
job of eliminating the artificial shelf and thus the appearance of a
206
seam right along the 60\N boundary, but it does not address the abrupt
165 207
transition in texture (i.e., the sudden appearance of high frequency
166 208
variability moving north across the boundary). Additionally, it
167 209
introduces vertical ``ridges'' running north from the boundary. These
......
170 212
from one pixel to the next lead to adjacent ramps with different
171 213
inclines.
172 214

  
173
I also tried a simple LOESS predictive model. This involved first
174
calculating the difference between ASTER and SRTM everywhere south of
175
60\N, and then fitting a LOESS line to these differences using the actual
176
ASTER elevation as a predictor. I then used the fitted model to predict
177
the ASTER-SRTM difference for ASTER cells north of 60\N, and add a
178
declining fraction (based on a Gaussian curve) of this difference to the
179
ASTER values north of 60\N. Conceptually, this amounts to applying an
180
ASTER-predicted correction to the ASTER elevation values, where the
181
correction term declines to zero according with increasing distance
182
north of the bonudary. However, this method alone didn't yield
183
particularly promising results in removing the 60\N seam itself,
184
presumably because adding a predicted correction at the boundary does
185
not close the SRTM-ASTER gap nearly as efficiently as do corrections
186
that are based on the actual elevation values. I therefore haven't
215
\emph{Simple LOESS predictive model.}
216
This involved first calculating the difference between SRTM and ASTER
217
everywhere south of 60\N, and then fitting a LOESS curve to these
218
differences using the actual ASTER elevation as a predictor. I then used
219
the fitted model to predict the ASTER-SRTM difference for each ASTER
220
cell north of 60\N, and added a declining fraction (based on a Gaussian
221
curve) of this difference to the corresponding ASTER elevation.
222
Conceptually, this amounts to applying an ASTER-predicted SRTM
223
correction to the ASTER elevation values, where the correction term has
224
a weight that declines to zero with increasing distance (north) away
225
from the boundary. However, this method alone didn't yield particularly
226
promising results in removing the 60\N seam itself, presumably because
227
adding a predicted correction at the boundary does not close the
228
SRTM-ASTER gap nearly as efficiently as do corrections based directly on
229
the observed SRTM vs ASTER elevation differences. I therefore haven't
187 230
pursued this any further, although it (or something like it) may prove
188 231
useful in combination with one of the other methods.
189 232

  
190 233
\paragraph{Slope}
191 234
For each of the three main fused DEM variants described above, slope was
192
calculated using \texttt{gdaldem}:
235
calculated using \texttt{gdaldem} (GDAL 1.8.0, released 2011/01/12):
193 236
\begin{verbatim}
194 237
    $ gdaldem slope -s 111120 <input_elevation> <output_slope>
195 238
\end{verbatim}
196 239
Note that the scale option used here is as recommended in the
197 240
\texttt{gdaldem} documentation:
198 241
\begin{quote}
199
  \emph{If the horizontal unit of the source DEM is degrees (e.g
200
  Lat/Long WGS84 projection), you can use scale=111120 if the vertical
201
  units are meters}
242
  ``\emph{If the horizontal unit of the source DEM is degrees (e.g
243
  Lat/Long WGS84 projection), you can use scale=111120 if the vertical'
244
  units are meters}''
202 245
\end{quote}
203 246
The output slope raster is in units of degrees.
204 247

  
......
212 255
degrees, with 0=North and proceeding clockwise.
213 256

  
214 257
\paragraph{Flow direction}
215
Flow direction was calculated using the GRASS \texttt{r.terraflow}
216
module; see code listing \ref{code-flowdir}. The default flow direction
217
output of this module is encoded so as to indicate \emph{all} downslope
218
neighbors, also known as the Multiple Flow Direction (MFD) model.
219
However, to simplify post-processing and summarization, the results here
220
are based on an alternative Single Flow Direction (SFD, \emph{a.k.a.}
221
D8) model, which indicates the neighbor associated with the steepest
222
downslope gradient. Note that this is equivalent to what ArcGIS GRID
223
\texttt{flowaccumulation} command does. I then recoded the output raster
224
to use the same azimuth directions used by \texttt{gdaldem aspect}, as
225
described above for aspect.
258

  
259
Flow direction was calculated using the GRASS (GRASS GIS 6.4.1)
260
\texttt{r.terraflow} module; see code listing \ref{code-flowdir}.
261
Because of a $\sim$30k ($2^{15}$) limit to the input raster dimension
262
size in the pre-built GRASS \texttt{r.terraflow} module I used, this
263
analysis was restricted to a smaller longitudinal subset of the data,
264
spanning 125\W to 100\W.
265

  
266
The default flow direction output of this module is encoded so as to
267
indicate \emph{all} downslope neighbors, also known as the Multiple Flow
268
Direction (MFD) model. However, to simplify post-processing and
269
summarization, the results here are based on an alternative Single Flow
270
Direction (SFD, \emph{a.k.a.} D8) model, which indicates the neighbor
271
associated with the steepest downslope gradient. Note that this is
272
equivalent to what ArcGIS GRID \texttt{flowaccumulation} command does. I
273
then recoded the output raster to use the same azimuth directions used
274
by \texttt{gdaldem aspect}, as described above for aspect.
226 275

  
227 276

  
228 277
%-----------------------------------------------------------------------
229 278
\section{Latitudinal mean terrain profiles}
230 279
%-----------------------------------------------------------------------
231 280

  
232
% first compute some values to use in the text
233
<<echo=FALSE,results=hide>>=
234
  library(raster)
235
  demdir <- "/home/regetz/media/temp/terrain/dem/"
236
  d.srtm <- raster(file.path(demdir, "srtm_150below.tif"))
237
  d.aster <- raster(file.path(demdir, "aster_300straddle.tif"))
238
  delta.median <- median(values(d.srtm) - values(crop(d.aster,
239
      extent(d.srtm))))
240
  delta.mean <- mean(values(d.srtm) - values(crop(d.aster,
241
      extent(d.srtm))))
242
@
243 281

  
244
\paragraph{Elevation} ASTER, SRTM, and the Canada DEM all share a very
282
\paragraph{Elevation} SRTM, ASTER, and CDED all share a very
245 283
similarly shaped mean elevation profile, but with differing heights
246 284
(Figure \ref{mean-elevation}). SRTM tends to be highest, ASTER is
247
lowest, and the Canada DEM is intermediate. The magnitude of average
248
difference between SRTM and ASTER is fairly consistent not only across
249
latitudes, but also across elevations (Figure \ref{aster-srtm}). The
250
overall median difference between ASTER and SRTM is \Sexpr{delta.median}
251
meters (mean=\Sexpr{round(delta.mean, 2)}), and this more or less holds
252
(within a few meters) across the observed range of elevations (Figure
253
\ref{aster-srtm-bins}). However, while this \emph{average} offset is
254
consistent, considerably more variation is evident at the pixel level.
255
The interquartile range in ASTER-SRTM differences spans $\sim$10 meters
256
(Figure \ref{aster-srtm-bins}), and there are many pixels for which the
257
elevation difference is on the order of 100 meters (note width of cloud
258
about the diagonal lines in Figure \ref{aster-srtm-scatter}). Figure
259
\ref{aster-srtm-scatter} also highlights the existence of numerous ASTER
260
spurious spikes of >1000m; although not shown here, these tend to occur
261
in small clumps of pixels, perhaps corresponding to false elevation
262
readings associated with clouds?
285
lowest, and CDED is intermediate. The magnitude of average difference
286
between SRTM and ASTER is fairly consistent not only across latitudes,
287
but also across elevations (Figure \ref{aster-srtm}). The overall median
288
difference between ASTER and SRTM (i.e., considering
289
$\mbox{ASTER}_i-\mbox{SRTM}_i$ for all pixels $i$ where the two DEMs
290
co-occur) is \Sexpr{delta.median} meters, with a mean of
291
\Sexpr{round(delta.mean, 2)}, and this more or less holds (within a few
292
meters) across the observed range of elevations (Figure
293
\ref{aster-srtm-bins}). However, while this average offset is broadly
294
consistent across latitudes and across elevation zones, additional
295
variation is evident at the pixel level. Again focusing on the
296
pixel-wise differences, they appear to be symmetrically distributed
297
about the mean with a standard deviation of \Sexpr{round(delta.sd, 1)}
298
and quartiles ranging from \Sexpr{delta.q["25%"]} to
299
\Sexpr{delta.q["75%"]} meters; ASTER elevations are actually greater
300
than SRTM for \Sexpr{round(100*mean(d.delta.vals>0))}\% of pixels (see
301
Figure \ref{aster-srtm-scatter}). Thus, although adding a constant
302
offset of \Sexpr{-delta.median} meters to the ASTER DEM would clearly
303
center it with respect to the STRM (at least in the Canada focal
304
region), appreciable differences would remain. Figure
305
\ref{aster-srtm-scatter} also highlights the existence of several
306
obviously spurious ASTER spikes of >1000m; although not shown here,
307
these tend to occur in small clumps of pixels, perhaps corresponding to
308
false elevation readings associated with clouds?
263 309

  
264 310
Not surprisingly, simple fusion produces an artificial $\sim$12m cliff
265 311
in the mean elevation profile (Figure \ref{mean-elevation}). At least in
......
278 324
some of the high frequency ``noise'' that remains in ASTER?
279 325
\textbf{\color{red}[todo: check!]}
280 326

  
281
Note that the the Canada DEM tends to be flatter than both ASTER and
282
SRTM (presumably because it is at least partially derived from
283
contour-based data \textbf{\color{red}[todo: check!]}. Moreover, this
284
figure makes it clear that the Canada DEM has some major artifacts at
327
Note that the CDED tends to be flatter than both SRTM and
328
ASTER (presumably because it is at least partially derived from
329
contour-based data \textbf{\color{red}[todo: check!]}). Moreover, this
330
figure makes it clear that CDED has some major artifacts at
285 331
regular intervals. The spike especially at 60\N (which coincides with
286 332
provincial boundaries across the entirety of western Canada) means we
287
probably need to scuttle our plans to use this DEM as a reference
333
probably need to scuttle our plans to use this DEM as a formal reference
288 334
dataset for boundary analysis.
289 335

  
290 336
The simple fused layer exhibits a dramatic spike in slope at the
291 337
immediate 60\N boundary, undoubtedly associated with the artificial
292 338
elevation cliff. This artifact is eliminated by both the multiresolution
293
spline and gaussian weighting. However, the former exhibits a sudden step
339
spline and Gaussian weighting. However, the former exhibits a sudden step
294 340
change in slope in the SRTM-ASTER overlap region, whereas the transition
295 341
is smoothed out in the latter. This likely reflects the fact that the
296 342
multiresolution spline effectively uses a very narrow transition zone
......
312 358
where $x_i$ is the aspect value (in radians) of pixel $i$.
313 359

  
314 360
As indicated in Figure \ref{mean-aspect}, the circular mean aspect
315
values of ASTER and SRTM are generally similar across all latitudes in
316
the area of overlap, and mean aspect values calculated on the Canada DEM
361
values of SRTM and ASTER are generally similar across all latitudes in
362
the area of overlap, and mean aspect values calculated on CDED
317 363
are similar at most but not all latitudes. The mean values at nearly all
318 364
latitudes are directed either nearly north or nearly south, though
319 365
almost always with a slight eastward rather than westward inclination.
......
340 386
expect in the presence of a cliff artifact at the seam.
341 387

  
342 388
Interestingly, the aspect layers derived from the two blended DEMs
343
(muliresolution spline and weighted Gaussian average) exhibit a
389
(muliresolution spline and Gaussian weighted average) exhibit a
344 390
consistent mean northward inclination at all latitudes in their
345 391
respective fusion zones. This pattern is visually obvious at latitudes
346 392
between 59.95\N and 60\N in the bottom two panels of Figure
347 393
\ref{mean-aspect}. This is almost certainly a signal of the blending of
348 394
the lower elevation ASTER to the north with higher elevation SRTM to the
349
south. 
395
south, introducing a north-facing tilt (however slight) to the data
396
throughout this zone. 
350 397

  
351 398
\paragraph{Flow direction} With the exception of edge effects at the
352
margins of the input rasters, mean ASTER-derived flow is northward at
353
all latitudes, and SRTM-derived flow is northward at nearly all
354
latitudes (Figure \ref{mean-flowdir}). This seems reasonable considering
355
that most pixels in this Canada test region fall in the Arctic drainage.
356
For unknown reasons, the Canada DEM produces southward mean flow
357
direction at numerous latitudes, and generally seems to have a slightly
358
more eastward tendency. As was the case with aspect, note that a general
359
north-south bias is evident (Figure \ref{rose-diag-flowdir}), again
360
likely due to use of an unprojected raster at high latitudes.
399
margins of the input rasters, mean ASTER-derived flow is nearly
400
northward at all latitudes, and SRTM-derived flow is nearly northward at
401
all but a few latitudes (Figure \ref{mean-flowdir}). This seems
402
reasonable considering that most pixels in this Canada test region fall
403
in the Arctic drainage. For unknown reasons, CDED produces southward
404
mean flow direction at numerous latitudes, and generally seems to have a
405
slightly more eastward tendency. As was the case with aspect, note that
406
a general north-south bias is evident (Figure \ref{rose-diag-flowdir}),
407
again likely due to use of an unprojected raster at high latitudes.
361 408

  
362 409
The various fused layer profiles look as one would expect (Figure
363 410
\ref{mean-flowdir}), although the overall lack of latitudinal
......
369 416
%-----------------------------------------------------------------------
370 417

  
371 418
\paragraph{Elevation}
372
Correlations between ASTER and SRTM are quite high, typically >0.999,
373
and RMSEs are on the order of 10-15 meters (Figures \ref{corr-elevation}
374
and \ref{rmse-elevation}). Spikes (downward for correlation, upward for
375
RMSE) occur at some latitudes, which I speculate are associated with
376
the observed extreme spikes in the ASTER DEM itself. As expected, the
377
multiresolution spline and Gaussian weighted average both produce layers
378
that gradually become less similar to ASTER and more similar to SRTM
379
moving south from 60\N, but in slightly different ways. This gradual
380
transition is less evident when considering associations with the Canada
381
DEM (bottom panels of Figures \ref{corr-elevation} and
419
Pearson correlations between SRTM and ASTER are quite high, typically
420
>0.999, and RMSEs are on the order of 10-15 meters (Figures
421
\ref{corr-elevation} and \ref{rmse-elevation}). Spikes (downward for
422
correlation, upward for RMSE) occur at some latitudes, quite possibly
423
associated with the observed extreme spikes in the ASTER DEM itself. As
424
expected, the multiresolution spline and Gaussian weighted average both
425
produce layers that gradually become less similar to ASTER and more
426
similar to SRTM moving south from 60\N, but in slightly different ways.
427
This gradual transition is less evident when considering associations
428
with CDED (bottom panels of Figures \ref{corr-elevation} and
382 429
\ref{rmse-elevation}), which in general is less correlated with SRTM,
383
and even less with ASTER, than those two layers are with each others.
430
and even less with ASTER, than those two layers are with each other.
384 431

  
385 432
\paragraph{Slope}
386 433
The patterns of slope layer similarity are much like those described
......
393 440
transition from ASTER to SRTM, whereas the multiresolution spline yields
394 441
an abrupt transition. Not surprisingly, the simple fused layer is even
395 442
worse, producing not only a sudden transiton but also abberant values
396
right at the fusion seam; note downward (upward) spikes in correlation
443
at the fusion seam itself; note downward (upward) spikes in correlation
397 444
(RMSE) at 60\N in the first column of plots in Figures \ref{corr-slope}
398 445
and \ref{rmse-slope}.
399 446

  
......
413 460
$\bar{x}$ and $\bar{y}$ are circular means calculated as in Equation
414 461
\ref{eq-cmean}.
415 462

  
416
To calculate RMSEs for aspect, I did not use trigonometric properties in
417
the same way as for computing correlation, but instead imposed a simple
418
correction whereby all pairwise differences were computed using the
419
shorter of the two paths around the compass wheel (Equation
420
\ref{eq-circ-rmse}). For example, the difference between 0$^\circ$ and
421
150$^\circ$ is 150$^\circ$, but the difference between 0$^\circ$ and
422
250$^\circ$ is 110$^\circ$.
463
To calculate RMSEs for aspect, I did not attempt to use trigonometric
464
properties analogous to computation of the circular correlation, but
465
instead just imposed a simple correction whereby all pairwise
466
differences were computed using the shorter of the two paths around the
467
compass wheel (Equation \ref{eq-circ-rmse}). For example, the difference
468
between 0$^\circ$ and 150$^\circ$ is 150$^\circ$, but the difference
469
between 0$^\circ$ and 250$^\circ$ is 110$^\circ$.
423 470

  
424 471
\begin{eqnarray}
425 472
\label{eq-circ-rmse}
......
433 480
latitudes (Figure \ref{corr-flowdir}). The corresponding RMSE is close
434 481
to 70 at all latitudes, surprisingly high considering that the maximum
435 482
difference between any two pixels is 180$^\circ$ (Figure
436
\ref{rmse-flowdir}). Comparison of SRTM and ASTER with the Canada DEM
483
\ref{rmse-flowdir}). Comparison of SRTM and ASTER with CDED
437 484
yields similar patterns.
438 485

  
439 486
For both of the blended layers (multiresolution spline and Gaussian
......
444 491
between fused aspect and aspect based on the original SRTM and ASTER
445 492
images are substantially \emph{negative} for many latitudes in the zone
446 493
of overlap. I don't have a good feel for what's going on here, although
447
it part that may be because I don't have a great intuition for how the
448
circular correlation statistic might be responding to patterns in the
449
data. Note that the latitudinal profile of aspect RMSEs is less
450
worrisome (upper middle and upper right panels of Figure
451
\ref{rmse-flowdir}) and more closely resembles the profile of slope
452
RMSEs discussed above, particularly as regards the more gradual
494
it may just involve properties of the circular correlation statistic
495
that I don't have a good feel for. Note that the latitudinal profile of
496
aspect RMSEs is less worrisome (upper middle and upper right panels of
497
Figure \ref{rmse-flowdir}) and more closely resembles the profile of
498
slope RMSEs discussed above, particularly as regards the more gradual
453 499
transition in case of Gaussian weighted averaging compared to the
454 500
multiresolution spline.
455 501

  
456 502
\paragraph{Flow direction}
457 503
As with aspect, circular correlation coefficients and adjusted RMSEs
458
were calculated for each latitudinal band. Flow direciton correlations
504
were calculated for each latitudinal band. Flow direction correlations
459 505
between SRTM and ASTER are slightly lower than for aspect, typically
460 506
around 0.40 but spiking negative at a handful of latitudes (Figure
461
\ref{corr-flowdir}). RMSEs hover consistenly around $\sim$75, slightly
507
\ref{corr-flowdir}). RMSEs hover consistently around $\sim$75, slightly
462 508
lower than was the case with aspect (Figure \ref{rmse-flowdir}).
463 509

  
464
Aside from an expected artifact at the southern image edge, and an
510
Aside from an expected flow artifact at the southern image edge, and an
465 511
unexpected (and as-yet unexplained) negative spike at $\sim$59.95\N, the
466 512
correlation profiles are fairly well-behaved for both blended layers,
467 513
and don't show the same odd behavior as was the case for aspect. Again
......
594 640
  \caption{ASTER vs SRTM elevation comparisons}
595 641
  \centering
596 642
  \subfloat[Boxplots of the arithmetic difference in elevations (ASTER -
597
  SRTM), summarized across a series of ASTER elevation bins. Boxes
643
  SRTM), summarized across a series of SRTM elevation bins. Boxes
598 644
  include the median (horizontal band), 1st and 3rd quartiles (box
599
  extents), and $\pm$1.5$\times$IQR (whiskers). Gray numbers above each
600
  whisker indicates how many thousands of pixels are included in the
601
  corresponding summary. Dashed red line indicates the median difference
602
  across all pixels south of 60\N.]{
603
    \includegraphics[width=\linewidth]{../dem/aster-srtm-bins.png}
645
  extents), and $\pm$1.5$\times$IQR (whiskers); outliers not shown. Gray
646
  numbers above each whisker indicates how many thousands of pixels are
647
  included in the corresponding summary. Dashed red line indicates the
648
  median difference across all pixels south of 60\N.]{
649
    \includegraphics[width=\linewidth, trim=0 0 0 0.5in, clip=TRUE]{../dem/aster-srtm-bins.png}
604 650
    \label{aster-srtm-bins}
605 651
  }\\
606
  \subfloat[Pixel-wise plot of ASTER vs SRTM for all values in the 150
652
  \subfloat[Pixel-wise plot of SRTM vs ASTER for all values in the 150
607 653
  latitudinal rows of overlap south of 60\N. Dashed blue line indicates
608 654
  the 1:1 diagonal, and the parallel red line is offset lower by the
609
  observed median difference between ASTER and SRTM
610
  (\Sexpr{delta.median}).]{
611
    \includegraphics[width=\linewidth]{../dem/aster-srtm-scatter.png}
655
  observed median difference between SRTM and ASTER (\Sexpr{delta.median}m).
656
  Inset histogram shows distribution of differences, excluding absolute
657
  differences >60.]{
658
    \includegraphics[width=\linewidth, trim=0 0 0 0.5in, clip=TRUE]{../dem/aster-srtm-scatter.png}
612 659
    \label{aster-srtm-scatter}
613 660
  }
614 661
  \label{aster-srtm}
......
695 742
  mtext(paste("(a)", round(yFromRow(sfd.bg, y1), 3), "degrees"))
696 743
  axis.circular(at=circular(c(pi/2, pi, 3*pi/2, 2*pi)),
697 744
      labels=c("N", "W", "S", "E"))
698
  #points(mean.circular(cx[1,], na.rm=TRUE), col="red")
745
  points(mean.circular(cx[1,], na.rm=TRUE), col="red")
699 746
  lines.circular(c(mean.circular(cx[1,], na.rm=TRUE), 0), c(0,-1),
700 747
      lwd=2, col="red")
701 748
  rose.diag(cx[2,], bins=1000, border="blue", ticks=FALSE, axes=FALSE)
702 749
  mtext(paste("(b)", round(yFromRow(sfd.bg, y2), 3), "degrees"))
703 750
  axis.circular(at=circular(c(pi/2, pi, 3*pi/2, 2*pi)),
704 751
      labels=c("N", "W", "S", "E"))
705
  #points(mean.circular(cx[2,], na.rm=TRUE), col="red")
752
  points(mean.circular(cx[2,], na.rm=TRUE), col="red")
706 753
  lines.circular(c(mean.circular(cx[2,], na.rm=TRUE), 0), c(0,-1),
707 754
      lwd=2, col="red")
708 755
@
......
765 812
\end{figure}
766 813

  
767 814

  
768
\clearpage
769
\appendix
770 815
%-----------------------------------------------------------------------
771 816
\section{Code listings}
772 817
%-----------------------------------------------------------------------
773 818

  
774
\lstinputlisting[language=R, caption={R wrapper code for multiresolution
775
    spline}, label=code-enblend]{../dem/enblend.R}
819
\clearpage
820
\appendix
776 821

  
822
\lstinputlisting[language=bash, caption={GDAL commands for assembling
823
    and resampling SRTM and ASTER tiles into GeoTIFFs for use as inputs
824
    to the boundary correction routines described in this document.},
825
    label=code-gdalwarp]{../dem/boundary-assembly.sh}
777 826
\clearpage
827

  
828
\lstinputlisting[language=R, caption={R code implementing several
829
    SRTM-ASTER boundary corrections, including the Gaussian weighted
830
    average layer discussed in this document (see \texttt{OPTION 3}, as
831
    identified in code comments).},
832
    label=code-correct]{../dem/boundary-correction.R}
833
\clearpage
834

  
835
\lstinputlisting[language=bash, caption={GDAL commands for assembling
836
    boundary-corrected DEM components above and below 60\N, for each of
837
    several correction approaches implemented in Listing
838
    \ref{code-correct}. Note that multiresolution spline blending is
839
    treated separately (see Listing \ref{code-enblend}).},
840
    label=code-fuse]{../dem/boundary-fusion.sh}
841
\clearpage
842

  
843
\lstinputlisting[language=R, caption={R wrapper code for multiresolution
844
    spline of SRTM and ASTER.}, label=code-enblend]{../dem/enblend.R}
845
\clearpage
846

  
778 847
\lstinputlisting[language=bash, caption={GRASS code for computing
779
    flow directions}, label=code-flowdir]{../flow/flow-boundary.sh}
848
    flow directions using the various fused elevation rasters and their
849
    components DEMS as inputs.},
850
    label=code-flowdir]{../flow/flow-boundary.sh}
780 851

  
781 852
\end{document}
782 853

  

Also available in: Unified diff