Converts vertical profile time series (objects of class vpts) to a data Frame, and optionally adds information on sunrise/sunset, day/night and derived quantities like migration traffic rates.

# S3 method for vpts
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 vpts.

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_vpts) example_vpts
#> Irregular time series of vertical profiles (class vpts) #> #> radar: KBGM #> # profiles: 1934 #> time range (UTC): 2016-09-01 00:02:00 - 2016-09-10 11:56:00 #> time step (s): min: 180 max: 16320
# convert the object to a data.frame df <- as.data.frame(example_vpts) # do not compute sunrise/sunset information df <- as.data.frame(example_vpts, suntime = FALSE) # override the latitude/longitude information stored in the object # when calculating sunrise / sunset df <- as.data.frame(example_vpts, suntime = TRUE, lat = 50, lon = 4) # print first then rows of data.frame to console: df[1:10, ]
#> radar datetime height u v w ff dd sd_vvp gap #> 1 KBGM 2016-09-01 00:02:00 0 NaN NaN NaN NaN NaN NaN TRUE #> 2 KBGM 2016-09-01 00:02:00 200 NaN NaN NaN NaN NaN NaN TRUE #> 3 KBGM 2016-09-01 00:02:00 400 NaN NaN NaN NaN NaN 2.81 TRUE #> 4 KBGM 2016-09-01 00:02:00 600 4.14 3.84 12.17 5.65 47.2 2.80 FALSE #> 5 KBGM 2016-09-01 00:02:00 800 5.06 0.24 15.17 5.07 87.2 2.42 FALSE #> 6 KBGM 2016-09-01 00:02:00 1000 4.74 -2.69 18.48 5.45 119.6 2.38 FALSE #> 7 KBGM 2016-09-01 00:02:00 1200 4.41 -4.09 -2.49 6.02 132.9 2.29 FALSE #> 8 KBGM 2016-09-01 00:02:00 1400 4.78 -3.55 -2.96 5.96 126.6 2.34 FALSE #> 9 KBGM 2016-09-01 00:02:00 1600 3.75 -3.03 -7.32 4.82 128.9 2.62 FALSE #> 10 KBGM 2016-09-01 00:02:00 1800 4.14 -2.03 -5.69 4.61 116.1 3.06 FALSE #> dbz eta dens DBZH n n_dbz n_all n_dbz_all lat lon #> 1 NaN NaN NaN NaN 0 0 0 0 50 4 #> 2 NaN NaN NaN NaN 0 0 0 0 50 4 #> 3 1.54 30.8 2.800000000 3.77 326 356 22485 28416 50 4 #> 4 3.36 46.9 4.263636364 0.50 9006 13442 65947 104455 50 4 #> 5 -7.89 3.5 0.318181818 -10.33 2313 11145 21321 63542 50 4 #> 6 -16.17 0.5 0.045454545 -15.58 652 8851 11789 38006 50 4 #> 7 -19.61 0.2 0.018181818 -16.93 990 8026 8434 25583 50 4 #> 8 -22.72 0.1 0.009090909 -19.60 407 9945 2718 20376 50 4 #> 9 -24.65 0.1 0.009090909 -24.28 247 11786 442 14716 50 4 #> 10 -25.29 0.1 0.009090909 -25.38 154 10878 163 11482 50 4 #> height_antenna day sunrise sunset #> 1 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 2 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 3 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 4 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 5 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 6 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 7 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 8 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 9 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38 #> 10 519 FALSE 2016-09-01 05:03:05 2016-09-01 18:23:38