adokter / bioRad

R package for analysis and visualisation of biological signals in weather radar data
http://adokter.github.io/bioRad
Other
28 stars 16 forks source link

altitude shift in flight altitude quantiles calculated by in integrate_profile() #627

Closed adokter closed 10 months ago

adokter commented 11 months ago

Flight height quantiles (when using argument height_quantile) are incorrectly shifted down by up to one height bin. This issue has appeared after an earlier fix https://github.com/adokter/bioRad/issues/532.

For example, for a radar with lowest available bin at 200 meter:

> example_vp$attributes$where$height
[1] 209

We find the lower end of the distribution starting at 100 meter instead of 200 meter:

> integrate_profile(example_vp, height_quantile=.00000001)
  radar            datetime      mtr      vid      vir      rtr mt rt       ff       dd         u
1 seang 2015-10-18 18:00:00 4108.289 89.08468 983.9208 45191.18 NA NA 12.81019 204.4764 -5.298934
          v height
1 -11.64013    100
adokter commented 11 months ago

This issue also gives rise to error message:

Error in if (is.na(delta_linear_interpolation)) delta_linear_interpolation = 0 : 
  argument is of length zero