forked from carlos-alberto-silva/rGEDI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgediWFMetrics.Rd
273 lines (195 loc) · 7.61 KB
/
gediWFMetrics.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/C_processExtractMetrics.R
\name{gediWFMetrics}
\alias{gediWFMetrics}
\title{GEDI full waveform data processing}
\usage{
gediWFMetrics(
input,
outRoot,
writeFit = FALSE,
writeGauss = FALSE,
bounds = NULL,
ground = FALSE,
useInt = FALSE,
useFrac = FALSE,
rhRes = 5,
laiRes = 10,
laiH = 30,
noRHgauss = FALSE,
gTol = 0,
fhdHistRes = 0.001,
forcePsigma = FALSE,
bayesGround = FALSE,
dontTrustGround = FALSE,
noRoundCoord = FALSE,
noCanopy = FALSE,
dcBias = 0,
nSig = 0,
seed = NULL,
hNoise = 0,
linkNoise = NULL,
linkFsig = NULL,
linkPsig = NULL,
trueSig = NULL,
bitRate = NULL,
maxDN = NULL,
renoise = FALSE,
newPsig = -1,
oldPsig = 0.764331,
addDrift = NULL,
missGround = FALSE,
minGap = NULL,
photonCount = FALSE,
pcl = FALSE,
nPhotons = 2.1,
photonWind = 200,
noiseMult = 0.1,
rhoVrhoG = 1,
nPhotC = 2.1,
nPhotG = -1,
photHDF = FALSE,
meanN = 0,
thresh = 1e-14,
varNoise = FALSE,
varScale = NULL,
statsLen = NULL,
noiseTrack = FALSE,
sWidth = NULL,
psWidth = 0,
msWidth = NULL,
preMatchF = FALSE,
postMatchF = FALSE,
pFile = NULL,
gWidth = 1.2,
minGsig = 0.764331,
minWidth = 0,
medNoise = FALSE,
varDrift = NULL,
driftFac = NULL,
rhoG = 0.4,
rhoC = 0.57,
pSigma = NULL,
gold = FALSE,
deconTol = NULL
)
}
\arguments{
\item{input}{\code{\link[rGEDI:gedi.level1bSim-class]{gedi.level1bSim}} (may be a list of objects). Simulated waveform input object(s).}
\item{outRoot}{name. output filename root}
\item{writeFit}{write fitted waveform}
\item{writeGauss}{write Gaussian parameters}
\item{bounds}{minX minY maxX maxY. only analyse data within bounds}
\item{ground}{read true ground from file}
\item{useInt}{use discrete intensity instead of count}
\item{useFrac}{use fractional hits rather than counts}
\item{rhRes}{r. percentage energy resolution of RH metrics}
\item{laiRes}{res. lai profile resolution in metres}
\item{laiH}{h. height to calculate LAI to}
\item{noRHgauss}{do not fit Gaussians}
\item{gTol}{tol. ALS ground tolerance. Used to calculate slope.}
\item{fhdHistRes}{res. waveform intensity resolution to use when calculating FHD from histograms}
\item{forcePsigma}{do not read pulse sigma from file}
\item{bayesGround}{use Bayseian ground finding}
\item{dontTrustGround}{don't trust ground in waveforms, if included}
\item{noRoundCoord}{do not round up coords when outputting}
\item{noCanopy}{do not calculate FHD histograms and LAI profiles}
\item{dcBias}{n. mean noise level}
\item{nSig}{sig. noise sigma}
\item{seed}{n. random number seed}
\item{hNoise}{n. hard threshold noise as a fraction of integral}
\item{linkNoise}{linkM cov. apply Gaussian noise based on link margin at a cover}
\item{linkFsig}{sig. footprint width to use when calculating and applying signal noise}
\item{linkPsig}{sig. pulse width to use when calculating and applying signal noise}
\item{trueSig}{sig. true sigma of background noise}
\item{bitRate}{n. digitisation bit rate}
\item{maxDN}{max. maximum DN}
\item{renoise}{remove noise from truth before applying new noise level}
\item{newPsig}{sig. new value for pulse width, when lengthening pulse}
\item{oldPsig}{sig. old value for pulse width if not defined in waveform file, when lengthening pulse}
\item{addDrift}{xi. apply detector background drift}
\item{missGround}{assume ground is missed to assess RH metrics}
\item{minGap}{gap. delete signal beneath min detectable gap fraction}
\item{photonCount}{output point cloud from photon counting}
\item{pcl}{convert to photon counting pulsecompressed}
\item{nPhotons}{n. mean number of photons}
\item{photonWind}{x. window length for photon counting search, metres}
\item{noiseMult}{x. noise multiplier for photoncounting}
\item{rhoVrhoG}{x. ratio of canopy to ground reflectance at this wavelength. Not different from rhoV and rhoG}
\item{nPhotC}{n. mean number of canopy photons (replaces nPhotons and rhoVrhoG)}
\item{nPhotG}{n. mean number of ground photons (replaces nPhotons and rhoVrhoG)}
\item{photHDF}{write photoncounting}
\item{meanN}{n. mean noise level, if using a predefined mean level}
\item{thresh}{n. noise threshold, if using a predefined noise threshold}
\item{varNoise}{use a variable noise threshold}
\item{varScale}{x. variable noise threshold scale (multiple of stdev above mean to set threshold)}
\item{statsLen}{len. length to calculate noise stats over for varNoise}
\item{noiseTrack}{use noise tracking}
\item{sWidth}{sig. smoothing width, after densoising}
\item{psWidth}{sigma. smoothing width, before denoising}
\item{msWidth}{sig. smoothing width, after noise stats, before denoising}
\item{preMatchF}{matched filter before denoising}
\item{postMatchF}{matched filter after denoising}
\item{pFile}{file. read pulse file, for deconvoltuion and matched filters}
\item{gWidth}{sig. Gaussian parameter selection smoothing width}
\item{minGsig}{sig. minimum Gaussian sigma to fit}
\item{minWidth}{n. minimum feature width in bins}
\item{medNoise}{use median stats rather than mean}
\item{varDrift}{correct detector drift with variable factor}
\item{driftFac}{xi. fix drift with constant drift factor}
\item{rhoG}{rho. ground reflectance}
\item{rhoC}{rho. canopy reflectance}
\item{pSigma}{sig. pulse width to smooth by if using Gaussian pulse}
\item{gold}{deconvolve with Gold's method}
\item{deconTol}{deconvolution tolerance}
}
\value{
A S4 object of class \code{\link[hdf5r:H5File-class]{hdf5r::H5File}} in the \emph{hdf5r} package.
}
\description{
GEDI full waveform data processing and metrics extraction
}
\examples{
\dontshow{
rm(list=ls())
}
libsAvailable = require(lidR) && require(plot3D)
if (libsAvailable) {
# specify the path to ALS data (zip)
alsfile_Amazon_zip <- system.file("extdata", "Amazon.zip", package="rGEDI")
alsfile_Savanna_zip <- system.file("extdata", "Savanna.zip", package="rGEDI")
# Unzipping ALS data
alsfile_Amazon_filepath <- unzip(alsfile_Amazon_zip,exdir = dirname(alsfile_Amazon_zip))
alsfile_Savanna_filepath <- unzip(alsfile_Savanna_zip,exdir = dirname(alsfile_Savanna_zip))
# Reading and plot ALS file (las file)
als_Amazon<-readLAS(alsfile_Amazon_filepath)
als_Savanna<-readLAS(alsfile_Savanna_filepath)
# Extracting plot center geolocations
xcenter_Amazon = mean(als_Amazon@bbox[1,])
ycenter_Amazon = mean(als_Amazon@bbox[2,])
xcenter_Savanna = mean(als_Savanna@bbox[1,])
ycenter_Savanna = mean(als_Savanna@bbox[2,])
# Simulating GEDI full-waveform
wf_Amazon<-gediWFSimulator(input=alsfile_Amazon_filepath,
output=file.path(getwd(),"gediWF_amazon_simulation.h5"),
coords = c(xcenter_Amazon, ycenter_Amazon))
wf_Savanna<-gediWFSimulator(input=alsfile_Savanna_filepath,
output=file.path(getwd(),"gediWF_Savanna_simulation.h5"),
coords = c(xcenter_Savanna, ycenter_Savanna))
# Extracting GEDI full-waveform derived metrics
wf_amazon_metrics<-gediWFMetrics(input=wf_Amazon,outRoot=file.path(getwd(), "amazon"))
wf_savanna_metrics<-gediWFMetrics(input=wf_Savanna,outRoot=file.path(getwd(), "Savanna"))
close(wf_Amazon)
close(wf_Savanna)
metrics<-rbind(wf_amazon_metrics,wf_savanna_metrics)
rownames(metrics)<-c("Amazon","Savanna")
head(metrics)
}
}
\seealso{
i) Hancock, S., Armston, J., Hofton, M., Sun, X., Tang, H., Duncanson, L.I., Kellner,
J.R. and Dubayah, R., 2019. The GEDI simulator: A large‐footprint waveform lidar simulator
for calibration and validation of spaceborne missions. Earth and Space Science.
https://doi.org/10.1029/2018EA000506
ii) gediSimulator: https://bitbucket.org/StevenHancock/gedisimulator/src/master/
}