roboglia.base.PVLList¶
-
class
PVLList(p=[], v=[], ld=[])[source]¶ Bases:
objectA class that holds a list of PVL commands and provides a number of extra manipulation functions.
The constructor pads the supplied lists with
nanin case the lists are unequal in size.- Parameters
p (list of [float or
nan]) –The position commands as a list of float or
nanlike this:p=[1, 2, nan, 30, nan, 20, 10, nan]
v (list of [float or
nan]) – The velocity commands as a list of float ornanld (list of [float or
nan]) – The load commands as a list of float ornan
-
property
items¶ Returns the raw items of the list.
-
__repr__()[source]¶ Provides a representation of the PVLList for convenience. It will show a list of PVLs.
-
property
positions¶ Returns the full list of positions (p) commands, including
nanfrom the list.
-
property
velocities¶ Returns the full list of velocities (v) commands, including
nanfrom the list.
-
property
loads¶ Returns the full list of load (ld) commands, including
nanfrom the list.
-
append(p=nan, v=nan, ld=nan, p_list=[], v_list=[], l_list=[], pvl=None, pvl_list=[])[source]¶ Appends items to the PVL List. Depending on the way you call it you can:
append one item defined by parameters
p,vandlappend a list of items defined by paramters
p_list,v_listandl_list; this works similar with the constructor by padding the lists if they have unequal lengthappend one PVL object is provided as
pvlappend a list of PVL objects provided as
pvl_list
-
process(p_func=<function mean>, v_func=<function mean>, ld_func=<function mean>)[source]¶ Performs an aggregation function on all the elements in the list by applying the provided functions to the
p,vandldcomponents of all the items in the list.- Parameters
p_func (function) – An aggregation function to be used for
pvalues in the list. Default isstatistics.mean.v_func (function) – An aggregation function to be used for
vvalues in the list. Default isstatistics.mean.ld_func (function) – An aggregation function to be used for
ldvalues in the list. Default isstatistics.mean.
- Returns
A PVL object with the aggregated result. If any of the components is missing any values in the list it will be reflected with
nanvalue in that position.- Return type