openSkiesStateVectorSet | R Documentation |
R6Class
object representing an ensemble of aircraft
state vectorsR6Class
object representing an ensemble of aircraft state vectors.
Contains a list of objects of class openSkiesStateVector
. The
ensemble can either represent a time series of state vectors of a single
aircraft, or represent state vectors corresponding to multiple different
aircrafts. For details on the information stored in each state vector, see
the documentation for the openSkiesStateVector
class. New instances can be manually
created by providing a list of openSkiesStateVector
objects.
Alternatively, getSingleTimeStateVectors
and getAircraftStateVectorsSeries
will return an openSkiesStateVectorSet
object if multiple state
vectors matching the query conditions are found.
openSkiesStateVectorSet
state_vectors
List of openSkiesStateVector
objects
time_series
Logical indicating if the openSkiesStateVectorSet
object represents a time series of state vectors of a single aircraft.
add_state_vector(state_vector)
This method adds a new state vector to the openSkiesAircraft object, which
will be set as the new last_state_vector
and will be added to
state_vector_history
. state_vector
should be an
openSkiesStateVector
object
get_values(fields, removeNAs=FALSE, unwrapAngles=FALSE)
This method retrieves all the values for the specified fields in the
ensemble of openSkiesStateVector
objects. One or several
field names can be provided through the fields
argument. The values
will be returned as a vector if a single field was provided, or as a data
frame if multiple fields were provided. Field names should match those of
the fields of openSkiesStateVector
objects. If removeNAs=TRUE
,
NA values will be omitted from the output (if multiple fields were provided,
only state vectors for which all of the fields were NA will be omitted).
If unwrapAngles=TRUE
and values for the true_track
field
were requested, the values will be unwrapped to be a smooth succession of
values without sudden discontinuities when crossing from 360º to 0º
(this will likely make multiple values become higher than 360).
get_uniform_interpolation(n, fields, method="fmm")
This method obtains a data frame with an interpolation of the specified fields along the
route represented by the state vector set across n evenly distributed points. fields
should be a character vector with the name of the fields that will be interpolated.
Only numeric fields are accepted. method
represents the interpolation method.
"linear" will result in linear interpolation, while "fmm", "periodic", or "natural" will result
in different types of spline interpolation.
get_time_points_interpolation(fields, time_field, timestamps, method="fmm")
This method obtains a data frame with an interpolation of the specified fields along the
route represented by the state vector set across the specified timestamps. fields
should be a character vector with the name of the fields that will be interpolated.
Only numeric fields are accepted. method
represents the interpolation method.
"linear" will result in linear interpolation, while "fmm", "periodic", or "natural" will result
in different types of spline interpolation. time_field
indicates the
name of the field of the openSkiesStateVectorSet object from which the
timestamps of the original state vectors will be retrieved. Possible values
are c("requested_time", "last_position_update_time", "last_any_update_time")
.
The time points at which the interpolations should be calculated should be
provided as a vector through the timestamps
argument.
sort_by_field(field, decreasing=FALSE)
This method sorts the state vectors of the openSkiesStateVectorSet object
by the values of the field provided through field
. By default,
decreasing=FALSE
and the state vectors will be sorted by increasing
order of field
. If decreasing=TRUE
, decreasing order will be
used.
split_into_flights(timeOnLandThreshold=300, timeDiffThreshold=1800)
This method automatically detects different flights contained in the
openSkiesStateVectorSet object and returns a list of objects of class
openSkiesFlight
. Separate flights are detected based on two
conditions: either the aircraft staying on ground for a given amount of
time, or the aircraft not sending any status update for a given period. The
thresholds are controlled, respectively, through the timeOnLandThreshold
and timeDiffThreshold
arguments. In both cases, the value should be
provided in seconds.
remove_redundants(updateType="position")
This method removes redundant state vectors, i.e., those that do not
contain updated information with respect to older state vectors. What is
considered as a redundant state vector is defined by the updateType
argument. If updateType="position"
, which is also the default
behavior, state vectors for which there was no update of positional
information will be considered as redundant (even if there might have been
an update of other information). If updateType="any"
, only state
vectors for which no information was updated (positional or any other) will
be considered as redundant. It should be noted that applying this method
will also sort the state vectors from older to more recent. The method
is intended to be applied to time series, and therefore a warning will be
given if it is applied on an openSkiesStateVectorSet
with
field time_series=FALSE
.
# Obtain a time series of state vectors for the aircraft with ICAO 24-bit
# address 403003 for the 8th of October, 2020 between 16:50 and 16:53 (London
# time), with a time resolution of 1 minute.
if(interactive()){
test_stateVectorSet <- getAircraftStateVectorsSeries("403003", startTime="2020-10-08 16:50:00",
endTime="2020-10-08 16:52:00", timeZone="Europe/London", timeResolution=60)
test_stateVectorSet
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.