pedarProbe.node.DataNode#
- class pedarProbe.node.DataNode[source]#
Bases:
PedarNodeDerived from
PedarNodewhich is actually the leaf node of the node tree, storing the raw data prepared for analysis.Note
Class Attributes
- self.df
pandas.core.frame.DataFrame Pandasdata frame that stores the sensor value of within a selected stance. Columns of theself.dfis the sensor ID, from 0 ~ 98 belongs to the left foot and form 99 ~ 197 belongs to the right foot. It can be accessed with:self.df.columns
Rows of the
self.dfis the time value, . It can be accessed with:self.df.index
To access a data item with specific sensor id and time:
id = 188 time = 1.58 self.df[id][time]
- self.start
float the start time of the selected stance.
- self.end
float the end time of the selected stance.
- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)add_branch(branch_node)Add branch to the node.
branch_names()Return a list of branch nodes' names.
branches()Return a list of branch nodes objects.
change_loc_map(start_level, layout)Change
loc_mapwith a restructured layer layout representation.clean_copy()Create and return a deep copy of the node only with its major attributes, including
name,loc, andlevel.clear()collect_layer(layer, nodes)In the node tree starting from this node, recursively collect all nodes of a specific layer.
collect_leaf(nodes)Recursively collect all leaf nodes starting from this node.
copy()fromkeys([value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
heatmap([attr_name, range, is_export, ...])Generate, plot, and export the heatmap for an attribute.
is_layer(layer)Judgment of whether the node belongs to a specific layer.
is_leaf()Judgment of whether the node is a leaf node or not.
items()keys()layer_layout()Get the layer layout representation of the node tree starting from this node.
pop(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised
popitem()2-tuple; but raise KeyError if D is empty.
print()Recursively print the structure of the node tree starting from this node.
restructure([layout])Return the restructured the node tree from this node.
sensor_peak([is_export, export_layer, ...])Analyse the peak pressure of each sensor in the leaf node level, and then average up layer by layer up to the this node.
sensor_pti([is_export, export_layer, ...])Analyse the pressure-time integral (PTI) of each sensor in the leaf node level, and then average up layer by layer up to the this node.
set_source(source_node)Set the source node of the node.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
setup(df, start, end, *args, **kwargs)Compared with
setup()of the base classPedarNode, initialisations of theself.df,self.start, andself.endare added.update([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- self.df