clear.Rd
Clear a set of voxels. Clearing means that the state variables of the selected voxels are altered as if they were clear of any vegetation. Namely:
number of echo set to zero
intercepted beam surface set to zero (if variable is outputted)
plant area density set to zero (if variable is outputted)
transmittance set to one (if variable is outputted)
any attenuation variable set to zero
Other state variables such as sampling intensity, mean angle, entering beam surface, etc. are unaltered. A cleared voxel is not the same as an unsampled voxel (not "crossed" by any beam).
clear(vxsp, vx)
# S4 method for VoxelSpace,data.table
clear(vxsp, vx)
# S4 method for VoxelSpace,vector
clear(vxsp, vx)
# S4 method for VoxelSpace,matrix
clear(vxsp, vx)
a VoxelSpace
object.
(i, j, k) voxel coordinates as a data.table::data.table
with i, j, k columns, a vector (i, j, k) or a matrix with i, j, k columns.
# load a voxel file
vxsp <- readVoxelSpace(system.file("extdata", "tls_sample.vox", package = "AMAPVox"))
# clear 1st voxel
clear(vxsp, c(0, 0, 0)) # clear 1st voxel
#> i j k ground_distance nbEchos nbSampling lgTotal lMeanTotal
#> <int> <int> <int> <num> <int> <int> <num> <num>
#> 1: 0 0 0 0.25 0 3369 1100.3662 0.3266151
#> 2: 0 0 1 0.75 0 3129 904.9130 0.2892020
#> 3: 0 0 2 1.25 0 2406 751.1223 0.3121872
#> 4: 0 0 3 1.75 0 2106 659.1803 0.3130011
#> 5: 0 0 4 2.25 0 1919 602.4054 0.3139163
#> ---
#> 416: 6 5 5 2.75 0 1533 495.9831 0.3235376
#> 417: 6 5 6 3.25 0 1394 458.5256 0.3289280
#> 418: 6 5 7 3.75 0 1261 422.9537 0.3354113
#> 419: 6 5 8 4.25 0 823 283.2120 0.3441215
#> 420: 6 5 9 4.75 0 813 288.8458 0.3552839
#> sdLength angleMean bsPotential bsEntering bsIntercepted transmittance
#> <num> <num> <num> <num> <num> <num>
#> 1: 0.1866441 68.74669 0.18236696 0.18164480 0 1
#> 2: 0.1943504 61.30513 0.17215119 0.17109131 0 1
#> 3: 0.1980757 54.47612 0.13515397 0.13368462 0 1
#> 4: 0.1985490 52.09007 0.12226181 0.12128547 0 1
#> 5: 0.1975347 51.82097 0.11477382 0.11332583 0 1
#> ---
#> 416: 0.1947745 51.03537 0.09570192 0.09483800 0 1
#> 417: 0.1926026 52.84722 0.08968004 0.08821365 0 1
#> 418: 0.1887876 54.56818 0.08480823 0.08081702 0 1
#> 419: 0.1861656 71.59585 0.06110164 0.05498709 0 1
#> 420: 0.1826305 72.38877 0.06070402 0.05445548 0 1
#> PadBVTotal attenuation_FPL_biasedMLE attenuation_FPL_biasCorrection
#> <num> <num> <num>
#> 1: 0 0 0
#> 2: 0 0 0
#> 3: 0 0 0
#> 4: 0 0 0
#> 5: 0 0 0
#> ---
#> 416: 0 0 0
#> 417: 0 0 0
#> 418: 0 0 0
#> 419: 0 0 0
#> 420: 0 0 0
#> attenuation_FPL_unbiasedMLE weightedEffectiveFreepathLength
#> <num> <num>
#> 1: 0 0.05982848
#> 2: 0 0.04976479
#> 3: 0 0.04226232
#> 4: 0 0.03827859
#> 5: 0 0.03578283
#> ---
#> 416: 0 0.03092307
#> 417: 0 0.02917568
#> 418: 0 0.02708526
#> 419: 0 0.01887177
#> 420: 0 0.01926193
#> weightedFreepathLength attenuation_PPL_MLE distLaser
#> <num> <num> <num>
#> 1: 0.05956666 0 3.585220
#> 2: 0.04955374 0 3.768980
#> 3: 0.04207453 0 3.980582
#> 4: 0.03810857 0 4.410619
#> 5: 0.03562487 0 4.757694
#> ---
#> 416: 0.03078603 0 5.328756
#> 417: 0.02904613 0 5.649271
#> 418: 0.02696477 0 5.863010
#> 419: 0.01878658 0 6.421073
#> 420: 0.01917410 0 6.466489
# clear butterflies
clear(vxsp, butterfly(vxsp))
# clear voxels with less than two hits
clear(vxsp, vxsp@data[nbEchos < 2])
#> i j k ground_distance nbEchos nbSampling lgTotal lMeanTotal
#> <int> <int> <int> <num> <int> <int> <num> <num>
#> 1: 0 0 0 0.25 0 3369 1100.3662 0.3266151
#> 2: 0 0 1 0.75 0 3129 904.9130 0.2892020
#> 3: 0 0 2 1.25 0 2406 751.1223 0.3121872
#> 4: 0 0 3 1.75 0 2106 659.1803 0.3130011
#> 5: 0 0 4 2.25 0 1919 602.4054 0.3139163
#> ---
#> 416: 6 5 5 2.75 0 1533 495.9831 0.3235376
#> 417: 6 5 6 3.25 0 1394 458.5256 0.3289280
#> 418: 6 5 7 3.75 0 1261 422.9537 0.3354113
#> 419: 6 5 8 4.25 0 823 283.2120 0.3441215
#> 420: 6 5 9 4.75 0 813 288.8458 0.3552839
#> sdLength angleMean bsPotential bsEntering bsIntercepted transmittance
#> <num> <num> <num> <num> <num> <num>
#> 1: 0.1866441 68.74669 0.18236696 0.18164480 0 1
#> 2: 0.1943504 61.30513 0.17215119 0.17109131 0 1
#> 3: 0.1980757 54.47612 0.13515397 0.13368462 0 1
#> 4: 0.1985490 52.09007 0.12226181 0.12128547 0 1
#> 5: 0.1975347 51.82097 0.11477382 0.11332583 0 1
#> ---
#> 416: 0.1947745 51.03537 0.09570192 0.09483800 0 1
#> 417: 0.1926026 52.84722 0.08968004 0.08821365 0 1
#> 418: 0.1887876 54.56818 0.08480823 0.08081702 0 1
#> 419: 0.1861656 71.59585 0.06110164 0.05498709 0 1
#> 420: 0.1826305 72.38877 0.06070402 0.05445548 0 1
#> PadBVTotal attenuation_FPL_biasedMLE attenuation_FPL_biasCorrection
#> <num> <num> <num>
#> 1: 0 0 0
#> 2: 0 0 0
#> 3: 0 0 0
#> 4: 0 0 0
#> 5: 0 0 0
#> ---
#> 416: 0 0 0
#> 417: 0 0 0
#> 418: 0 0 0
#> 419: 0 0 0
#> 420: 0 0 0
#> attenuation_FPL_unbiasedMLE weightedEffectiveFreepathLength
#> <num> <num>
#> 1: 0 0.05982848
#> 2: 0 0.04976479
#> 3: 0 0.04226232
#> 4: 0 0.03827859
#> 5: 0 0.03578283
#> ---
#> 416: 0 0.03092307
#> 417: 0 0.02917568
#> 418: 0 0.02708526
#> 419: 0 0.01887177
#> 420: 0 0.01926193
#> weightedFreepathLength attenuation_PPL_MLE distLaser
#> <num> <num> <num>
#> 1: 0.05956666 0 3.585220
#> 2: 0.04955374 0 3.768980
#> 3: 0.04207453 0 3.980582
#> 4: 0.03810857 0 4.410619
#> 5: 0.03562487 0 4.757694
#> ---
#> 416: 0.03078603 0 5.328756
#> 417: 0.02904613 0 5.649271
#> 418: 0.02696477 0 5.863010
#> 419: 0.01878658 0 6.421073
#> 420: 0.01917410 0 6.466489