Skip to content

Commit

Permalink
use pm_leaf_extended for leaf length when available
Browse files Browse the repository at this point in the history
  • Loading branch information
christian34 committed Dec 5, 2024
1 parent 895bec6 commit 29cffe6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/openalea/phenomenal/tracking/phenomenal_coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ def phm_leaf_features(phm_leaf):
if phm_leaf.info["pm_label"] == "mature_leaf":
features["mature"] = True
features["azimuth"] = phm_leaf.info["pm_azimuth_angle"]
features["length"] = phm_leaf.info["pm_length"]
if "pm_length_extended" in phm_leaf.info:
features["length"] = phm_leaf.info["pm_length_extended"]
else:
features["length"] = phm_leaf.info["pm_length"]
warnings.warn(
"Extented leaf length is not available, using polyline length instead"
)

if "pm_z_base_voxel" in phm_leaf.info:
features["height"] = phm_leaf.info["pm_z_base_voxel"]
else:
features["height"] = phm_leaf.info["pm_z_base"]
warnings.warn(
"Insertion height computed from voxels is not available: wrong Phenomenal version"
"Insertion height computed from voxels is not available, using polyline base instead"
)

elif phm_leaf.info["pm_label"] == "growing_leaf":
Expand Down

0 comments on commit 29cffe6

Please sign in to comment.