measurements API#
Module that provide measuring tools on continuous RSML-type MTG
- class openalea.rsml.measurements.RSML_Measurements[source]#
Bases:
listClass to store a list of root measurements
Root are stored in tree order (i.e. depth-first-order) Each row is a dictionary of measurements
use the add method to add measurements from a root MTG
- append(object, /)#
Append object to the end of the list.
- clear()#
Remove all items from list.
- copy()#
Return a shallow copy of the list.
- count(value, /)#
Return number of occurrences of value.
- export_csv(filename, sep='\t')[source]#
export file filename with csv format
Use sep as csv file separator
- extend(iterable, /)#
Extend list by appending elements from the iterable.
- index(value, start=0, stop=9223372036854775807, /)#
Return first index of value.
Raises ValueError if the value is not present.
- insert(index, object, /)#
Insert object before index.
- pop(index=-1, /)#
Remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(value, /)#
Remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse()#
Reverse IN PLACE.
- sort(*, key=None, reverse=False)#
Sort the list in ascending order and return None.
The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).
If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.
The reverse flag can be set to sort in descending order.
- openalea.rsml.measurements.parent_position(g, distance2tip=False, roots=None)[source]#
(Try to) compute the parent postion of root sub-axes
- The parent position is computed as follow:
Use the root axe ‘parent-position’ property, if present,
Otherwise, compute it using ‘parent-node’, if present,
Otherwise, return None
The values are returned as a dictionary of (root-id, root-parent-position) for all root-id in roots, if given, or all root axes in g otherwise
if `distance2tip`==True, the return calues are the distance from the branching position to the tip of the parent axes.
- openalea.rsml.measurements.root_length(g, roots=None)[source]#
return a dictionary of (root, root-length)
Download the source file ../../src/openalea/rsml/measurements.py.