-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add informative error message when using bind_into_vpts() on profiles with different altitude layers #341
Comments
HI @pecard, thanks for this. Indeed Adjusting it to so it can deal with different altitude layers definitions is something for the future, I've moved that part to issue #343 I'll try to add a fix relatively soon so at least |
I also just got bitten by this problem the vpts gets lists in the data instead of arrays, see example below. in this case the altitude layers are aligned so I guess missing data could be assigned for the missing bins require(bioRad)
#> Loading required package: bioRad
#> Welcome to bioRad version 0.5.1.9344
#> Docker daemon running, Docker functionality enabled (vol2bird version 0.5.0)
(vp1<-read_vpfiles('/home/bart/bioRad_tmp_files/frmom//2019/11/25/12/frmom_vp_20191125T125500Z_0xb.h5'))
#> Vertical profile (class vp)
#>
#> radar: frmom
#> source: NOD:frmom,PLC:Momuy,WMO:07606
#> nominal time: 2019-11-25 12:45:00
#> generated by: vol2bird 0.3.20
(vp2<-read_vpfiles('/home/bart/bioRad_tmp_files/frmom//2019/09/01/10/frmom_vp_20190901T102500Z_0xb.h5'))
#> Vertical profile (class vp)
#>
#> radar: frmom
#> source: NOD:frmom,PLC:Momuy,WMO:07606
#> nominal time: 2019-09-01 10:15:00
#> generated by: vol2bird 0.3.20
vp2$attributes$where$maxheight
#> [1] 4000
vp1$attributes$where$maxheight
#> [1] 5000
vpts<-bind_into_vpts(vp1, vp2)
str(vpts$data$ff)
#> List of 2
#> $ : num [1:20] NaN 1.38 NaN NaN NaN ...
#> $ : num [1:25] NaN 3.13 4.42 6.45 NaN ...
integrate_profile(vpts)
#> Error in `rownames<-`(`*tmp*`, value = x$height): attempt to set 'rownames' on an object with no dimensions Created on 2020-04-21 by the reprex package (v0.3.0) |
One quick example for adding empty height bins (in this single case it does not seem to affect the integrated profile estimates): require(bioRad)
#> Loading required package: bioRad
#> Welcome to bioRad version 0.5.1.9344
#> Docker daemon running, Docker functionality enabled (vol2bird version 0.5.0)
vp1<-read_vpfiles('/home/bart/bioRad_tmp_files/frmom//2019/11/25/12/frmom_vp_20191125T125500Z_0xb.h5')
vp2<-read_vpfiles('/home/bart/bioRad_tmp_files/frmom//2019/09/01/10/frmom_vp_20190901T102500Z_0xb.h5')
vp2$data<-rbind(vp2$data, vp2$data[1:5,])
vp2$data[21:25,]<-NA
vp2$data$height<-(0:24)*200
vpts<-bind_into_vpts(vp1, vp2)
str(vpts$data$ff)
#> num [1:25, 1:2] NaN 1.38 NaN NaN NaN ...
integrate_profile(vpts)
#> datetime mtr vid vir rtr mt
#> 1 2019-09-01 10:15:00 0.2220192 0.04454692 1.578907 2.442211 226.7371
#> 2 2019-11-25 12:45:00 3.3966660 0.30158455 29.438553 37.363327 3695.5823
#> rt ff dd u v height
#> 1 2494.108 1.384428 177.1907 0.06785376 -1.382764 300
#> 2 40651.406 3.128537 143.1474 1.87636542 -2.503397 300 Created on 2020-04-21 by the reprex package (v0.3.0) |
fix issue #341 did not work for vp list
While trying to build a vertical profile for a specific radar, I realized that h5 files may be non-uniform, causing an error when binding several temporal profiles.
I came across this while trying to plot the vertical profile for all data from a single radar was throwing an error but it went just ok for part of the dataset.
I realized that binding the entire dataset was creating a vpts file with different data structure from the example_vpts data but with no error or warnings.
reproducible example:
I'd say that bind_into_vpts is not dealing well with non-uniform data, particularly when height profile is not aligned among layers.
The text was updated successfully, but these errors were encountered: