curvature ========= .. py:module:: curvature .. autoapi-nested-parse:: Calculate various curvature metrics for traces. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: curvature.LOGGER Functions --------- .. autoapisummary:: curvature.angle_diff_signed curvature.discrete_angle_difference_per_nm_circular curvature.discrete_angle_difference_per_nm_linear curvature.calculate_curvature_stats_image Module Contents --------------- .. py:data:: LOGGER .. py:function:: angle_diff_signed(v1: numpy.typing.NDArray[numpy.float64], v2: numpy.typing.NDArray[numpy.float64]) Calculate the signed angle difference between two point vecrtors in 2D space. Positive angles are clockwise, negative angles are counterclockwise. :param v1: First vector. :type v1: npt.NDArray[np.float64] :param v2: Second vector. :type v2: npt.NDArray[np.float64] :returns: The signed angle difference in radians. :rtype: float .. !! processed by numpydoc !! .. py:function:: discrete_angle_difference_per_nm_circular(trace_nm: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Calculate the discrete angle difference per nm along a trace. :param trace_nm: The coordinate trace, in nanometre units. :type trace_nm: npt.NDArray[np.float64] :returns: The discrete angle difference per nm. :rtype: npt.NDArray[np.float64] .. !! processed by numpydoc !! .. py:function:: discrete_angle_difference_per_nm_linear(trace_nm: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Calculate the discrete angle difference per nm along a trace. :param trace_nm: The coordinate trace, in nanometre units. :type trace_nm: npt.NDArray[np.float64] :returns: The discrete angle difference per nm. :rtype: npt.NDArray[np.float64] .. !! processed by numpydoc !! .. py:function:: calculate_curvature_stats_image(topostats_object: topostats.classes.TopoStats) -> None Perform curvature analysis for a whole image of grains. Curvature statistics are added to the ``Molecule.curvature_stats`` attribute of the traces that are being processed. :param topostats_object: ``TopoStats`` object with attribute ``grain_crop``. Should be post-splining. :type topostats_object: TopoStats .. !! processed by numpydoc !!