Converts a vertical profile to a Data Frame, and optionally adds information on sunrise/sunset, day/night and derived quantities like migration traffic rates.

# S3 method for vp
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  quantities = names(x$data),
  suntime = TRUE,
  geo = TRUE,
  elev = -0.268,
  lat = NULL,
  lon = NULL,
  ...
)

Arguments

x

An object of class vp.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

If FALSE then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names and are not duplicated.

quantities

An optional character vector with the names of the quantities to include as columns in the data frame.

suntime

Logical, when TRUE, adds sunrise/sunset and day/night information to each row.

geo

Logical, when TRUE, adds latitude, longitude and antenna height of the radar to each row.

elev

Sun elevation in degrees, see sunrise/sunset.

lat

Radar latitude in decimal degrees. When set, overrides the latitude stored in x in sunrise/sunset calculations

lon

Radar longitude in decimal degrees. When set, overrides the longitude stored in x in sunrise/sunset calculations.

...

Additional arguments to be passed to or from methods.

Value

An object of class data.frame.

Details

Note that only the "dens" quantity is thresholded for radial velocity standard deviation by sd_vvp_threshold. Note that this is different from the default plot.vp, plot.vpts and get_quantity.vp functions, where quantities "eta", "dbz", "ff", "u", "v", "w", "dd" are all thresholded by sd_vvp_threshold

Examples

# load an example vertical profile time series object data(example_vp) # print some summary information example_vp
#> Vertical profile (class vp) #> #> radar: seang #> source: WMO:02606,RAD:SE50,PLC:Angelholm,NOD:seang,ORG:82,CTY:643,CMT:Swedish radar #> nominal time: 2015-10-18 18:00:00 #> generated by: vol2bird 0.3.17
# convert the object to a data.frame df <- as.data.frame(example_vp) # print the data.frame to console df
#> radar datetime ff dbz dens u #> 1 seang 2015-10-18 18:00:00 NA NA NA NA #> 2 seang 2015-10-18 18:00:00 11.53461 4.3039665 85.0995178 -3.860118 #> 3 seang 2015-10-18 18:00:00 13.35705 5.4355612 110.4298782 -5.824306 #> 4 seang 2015-10-18 18:00:00 13.77482 4.6322823 91.7822418 -6.317519 #> 5 seang 2015-10-18 18:00:00 12.37280 0.3914067 34.5677528 -5.464484 #> 6 seang 2015-10-18 18:00:00 11.62856 -1.8672314 20.5497875 -5.435530 #> 7 seang 2015-10-18 18:00:00 12.26567 -1.3853970 22.9609985 -5.871046 #> 8 seang 2015-10-18 18:00:00 12.44552 -2.0301955 19.7929668 -5.042855 #> 9 seang 2015-10-18 18:00:00 12.72011 -2.0336432 19.7772617 -4.089148 #> 10 seang 2015-10-18 18:00:00 13.16166 -2.5901840 17.3985100 -4.711092 #> 11 seang 2015-10-18 18:00:00 13.24782 -4.2063093 11.9922190 -4.695442 #> 12 seang 2015-10-18 18:00:00 12.97676 -6.4061351 7.2263165 -4.695178 #> 13 seang 2015-10-18 18:00:00 13.96152 -10.1189432 3.0735207 -5.040771 #> 14 seang 2015-10-18 18:00:00 NaN -14.6137285 0.0000000 NaN #> 15 seang 2015-10-18 18:00:00 18.53717 -16.1167755 0.7724188 -6.448045 #> 16 seang 2015-10-18 18:00:00 NaN -16.8988857 0.0000000 NaN #> 17 seang 2015-10-18 18:00:00 NaN -28.0253792 0.0000000 NaN #> 18 seang 2015-10-18 18:00:00 NaN -37.8717766 0.0000000 NaN #> 19 seang 2015-10-18 18:00:00 NaN -38.7156448 0.0000000 NaN #> 20 seang 2015-10-18 18:00:00 NaN -38.6279716 0.0000000 NaN #> 21 seang 2015-10-18 18:00:00 NaN -39.0613213 0.0000000 NaN #> 22 seang 2015-10-18 18:00:00 NaN -41.9553452 0.0000000 NaN #> 23 seang 2015-10-18 18:00:00 NaN -39.9685364 0.0000000 NaN #> 24 seang 2015-10-18 18:00:00 NaN -44.7469788 0.0000000 NaN #> 25 seang 2015-10-18 18:00:00 NaN -40.6572495 0.0000000 NaN #> v gap w n_dbz dd n DBZH height n_dbz_all #> 1 NA 1 NA 0 NA 0 NA 0 0 #> 2 -10.86953 0 -8.255996 9786 199.5516 4384 4.853236 200 27593 #> 3 -12.02032 0 -3.870171 10807 205.8520 5680 4.977803 400 24154 #> 4 -12.24070 0 -15.429576 10874 207.2986 5456 4.296990 600 18282 #> 5 -11.10070 0 -7.646388 9343 206.2094 4067 0.749139 800 13321 #> 6 -10.28000 0 2.433591 9025 207.8676 3628 -1.486296 1000 10471 #> 7 -10.76928 0 3.606835 6743 208.5977 3126 -1.220092 1200 7308 #> 8 -11.37807 0 2.602238 6873 203.9033 3180 -2.030195 1400 6873 #> 9 -12.04492 0 1.397334 6516 198.7519 2962 -2.033643 1600 6516 #> 10 -12.28962 0 5.478257 5871 200.9738 2284 -2.590184 1800 5871 #> 11 -12.38780 0 6.864256 2960 200.7586 1034 -4.206309 2000 2960 #> 12 -12.09759 0 4.974006 3640 201.2117 859 -6.406135 2200 3640 #> 13 -13.01978 0 0.743979 3989 201.1645 374 -10.118943 2400 3989 #> 14 NaN 1 NaN 2998 NaN 125 -14.613729 2600 2998 #> 15 -17.37957 0 -2.458026 3656 200.3555 72 -16.116776 2800 3656 #> 16 NaN 1 NaN 3660 NaN 51 -16.898886 3000 3660 #> 17 NaN 1 NaN 3995 NaN 2 -28.025379 3200 3995 #> 18 NaN 1 NaN 3656 NaN 0 -37.871777 3400 3656 #> 19 NaN 1 NaN 2989 NaN 0 -38.715645 3600 2989 #> 20 NaN 1 NaN 2654 NaN 0 -38.627972 3800 2654 #> 21 NaN 1 NaN 1991 NaN 0 -39.061321 4000 1991 #> 22 NaN 1 NaN 1991 NaN 0 -41.955345 4200 1991 #> 23 NaN 1 NaN 2326 NaN 0 -39.968536 4400 2326 #> 24 NaN 1 NaN 2319 NaN 0 -44.746979 4600 2319 #> 25 NaN 1 NaN 1991 NaN 0 -40.657249 4800 1991 #> eta sd_vvp n_all lat lon height_antenna day #> 1 NA NA 0 56.3675 12.8517 209 FALSE #> 2 9.360947e+02 4.349111 11472 56.3675 12.8517 209 FALSE #> 3 1.214729e+03 4.015257 9936 56.3675 12.8517 209 FALSE #> 4 1.009605e+03 3.286927 8026 56.3675 12.8517 209 FALSE #> 5 3.802453e+02 3.546942 5282 56.3675 12.8517 209 FALSE #> 6 2.260477e+02 3.821268 4078 56.3675 12.8517 209 FALSE #> 7 2.525710e+02 3.926216 3304 56.3675 12.8517 209 FALSE #> 8 2.177226e+02 3.797443 3180 56.3675 12.8517 209 FALSE #> 9 2.175499e+02 3.670397 2962 56.3675 12.8517 209 FALSE #> 10 1.913836e+02 3.618254 2284 56.3675 12.8517 209 FALSE #> 11 1.319144e+02 3.535195 1034 56.3675 12.8517 209 FALSE #> 12 7.948948e+01 3.134931 859 56.3675 12.8517 209 FALSE #> 13 3.380873e+01 2.994742 374 56.3675 12.8517 209 FALSE #> 14 1.201020e+01 NaN 125 56.3675 12.8517 209 FALSE #> 15 8.496607e+00 4.066769 72 56.3675 12.8517 209 FALSE #> 16 7.096342e+00 NaN 51 56.3675 12.8517 209 FALSE #> 17 5.475014e-01 NaN 2 56.3675 12.8517 209 FALSE #> 18 5.672123e-02 NaN 0 56.3675 12.8517 209 FALSE #> 19 4.670447e-02 NaN 0 56.3675 12.8517 209 FALSE #> 20 4.765693e-02 NaN 0 56.3675 12.8517 209 FALSE #> 21 4.313115e-02 NaN 0 56.3675 12.8517 209 FALSE #> 22 2.215075e-02 NaN 0 56.3675 12.8517 209 FALSE #> 23 3.500013e-02 NaN 0 56.3675 12.8517 209 FALSE #> 24 1.164730e-02 NaN 0 56.3675 12.8517 209 FALSE #> 25 2.986746e-02 NaN 0 56.3675 12.8517 209 FALSE #> sunrise sunset #> 1 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 2 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 3 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 4 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 5 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 6 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 7 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 8 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 9 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 10 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 11 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 12 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 13 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 14 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 15 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 16 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 17 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 18 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 19 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 20 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 21 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 22 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 23 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 24 2015-10-18 05:50:07 2015-10-18 15:56:28 #> 25 2015-10-18 05:50:07 2015-10-18 15:56:28
# do not compute sunrise/sunset information df <- as.data.frame(example_vp, suntime = FALSE) # override the latitude/longitude information stored in the object # when calculating sunrise / sunset df <- as.data.frame(example_vp, suntime = TRUE, lat = 50, lon = 4)