This function takes two profiles defined as (l1,z1) and (l2,z2) as inputs and calculates area between them

area_between(s1, s2 = NA, h = NA, sigma_z = c(NA, NA), sigma_l = c(NA, NA))

Arguments

s1

tibble with columns l and z describing first profile

s2

tibble with columns l and z describing second profile

h

if provided by user, the second profile is supposed to be horizontal, with constant height=h (defaults to NA)

sigma_z

a vector of length 1 or 2 providing an estimate of the error in measures of height z1 and z2

sigma_l

a vector of length 1 or 2 providing an estimate of the error in measures of longitudinal coordinates l1 and l2z1 and z2

Value

area

area_by_type

sigma_area

data

Examples

data(s1) data(s2) area_between(s1,s2)
#> $data #> # A tibble: 237 x 13 #> l z1 p z2 a type l_obs z_obs series zmin zmax lmin #> <dbl> <dbl> <chr> <dbl> <dbl> <fct> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> #> 1 10.1 228. observ… 228. 0 NA 10.1 228. s1 NA NA NA #> 2 10.1 228. observ… 228. 8.68e-4 upper 10.1 228. s2 NA NA NA #> 3 10.3 228. inters… 228. NA upper NA NA NA NA NA NA #> 4 10.3 228. inters… 228. -1.13e-1 lower NA NA NA NA NA NA #> 5 12.3 227. observ… 227. 0 NA 12.3 227. s1 NA NA NA #> 6 12.3 227. interp… 227. -2.40e-2 lower NA NA s2 NA NA NA #> 7 12.7 227. inters… 227. NA lower NA NA NA NA NA NA #> 8 12.7 227. inters… 227. 4.79e-3 upper NA NA NA NA NA NA #> 9 12.9 227. interp… 227. 0 NA NA NA s1 NA NA NA #> 10 12.9 227. observ… 227. 1.14e+0 upper 12.9 227. s2 NA NA NA #> # … with 227 more rows, and 1 more variable: lmax <dbl> #> #> $area #> [1] -98.07248 #> #> $area_by_type #> # A tibble: 2 x 2 #> type area #> <fct> <dbl> #> 1 upper 7.76 #> 2 lower -106. #> #> $sigma_area #> [1] 0 #>
area_between(s1,h=-5)
#> $data #> # A tibble: 122 x 13 #> l z1 p z2 a type l_obs z_obs series zmin zmax lmin #> <dbl> <dbl> <chr> <dbl> <dbl> <fct> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> #> 1 10.1 228. observed -5 0 NA 10.1 228. s1 NA NA NA #> 2 10.1 228. observed -5 500. upper 10.1 -5 s2 NA NA NA #> 3 12.3 227. observed -5 0 NA 12.3 227. s1 NA NA NA #> 4 12.3 227. interpola… -5 2089. upper NA NA s2 NA NA NA #> 5 21.3 227. observed -5 0 NA 21.3 227. s1 NA NA NA #> 6 21.3 227. interpola… -5 776. upper NA NA s2 NA NA NA #> 7 24.6 226. observed -5 0 NA 24.6 226. s1 NA NA NA #> 8 24.6 226. interpola… -5 714. upper NA NA s2 NA NA NA #> 9 27.7 226. observed -5 0 NA 27.7 226. s1 NA NA NA #> 10 27.7 226. interpola… -5 315. upper NA NA s2 NA NA NA #> # … with 112 more rows, and 1 more variable: lmax <dbl> #> #> $area #> [1] 57356.38 #> #> $area_by_type #> # A tibble: 2 x 2 #> type area #> <fct> <dbl> #> 1 upper 57356. #> 2 lower 0 #> #> $sigma_area #> [1] 0 #>