fluopy.prediction ================= .. py:module:: fluopy.prediction .. autoapi-nested-parse:: Compute a prediction for a photophysical system. Classes ------- .. autoapisummary:: fluopy.prediction.Prediction Module Contents --------------- .. py:class:: Prediction(transition_set: fluopy.transitions.TransitionSet, accuracy: float = 1000000000.0) Container of mathematically derived statistical attributes and methods. :ivar energy_transfer: Whether the prediction was carried out on energy transfer systems. :vartype energy_transfer: bool :ivar absorbing_chain: Whether the prediction was carried out on an absorbing Markov chain. Absorbing states have a lifetime of inf and a frequency / occupation of 0. Absorbing transitions have a frequency of 0. :vartype absorbing_chain: bool :ivar transition_set: Collection of all relevant transitions and related attributes. :vartype transition_set: fluopy.transitions.TransitionSet :ivar frequency_transitions: Expected relative frequencies of each transition. :vartype frequency_transitions: npt.NDArray[np.float64] :ivar frequency_states: Name of fluorophores as keys and their state's expected relative frequencies (array) as values. :vartype frequency_states: dict[str, float] :ivar transition_time_distributions: Expected distributions of time until transition. Contains objects of type scipy.stats.*.rv_frozen for each transition. None if energy transfer is True. :vartype transition_time_distributions: npt.NDArray[object] | None :ivar lifetime_distributions: Name of fluorophores as keys and their state's expected lifetime distributions (objects of type scipy.stats.*.rv_frozen) (array) as values. None if energy transfer is True. :vartype lifetime_distributions: dict[str, npt.NDArray[object]] | None :ivar mean_transition_times: Expected means of time until transition. None if energy transfer is True. :vartype mean_transition_times: npt.NDArray[np.float64] | None :ivar mean_lifetimes: Name of fluorophores as keys and their state's expected lifetime means (array) as values. None if energy transfer is True. :vartype mean_lifetimes: dict[str, npt.NDArray[np.float64]] | None :ivar state_occupations: Name of fluorophores as keys and their state's expected probability of being occupied at any given point in time (array) as values. None if energy transfer is True. :vartype state_occupations: dict[str, npt.NDArray[np.float64]] | None .. py:attribute:: energy_transfer :value: False .. py:attribute:: absorbing_chain :value: False .. py:attribute:: transition_set .. py:attribute:: frequency_states .. py:method:: predict_transition_occurrences(accuracy: int) -> numpy.typing.NDArray[numpy.float64] Predict the relative frequencies of transitions. Each different type of fluorophore's transitions frequencies sum up to 1. :param accuracy: Determines the exponent of matrix power. The higher, the more accurate up to the point floating point precision impairs the result. :returns: Expected relative frequencies of each transition. :rtype: npt.NDArray[np.float64] .. py:method:: predict_transition_occurrences_abs() -> numpy.typing.NDArray[numpy.float64] Predict the relative frequencies of transitions. Absorbing transitions will have the value 0. :returns: Expected relative frequencies of each transition. :rtype: npt.NDArray[np.float64] .. py:method:: predict_state_occurrences() -> dict[str, numpy.typing.NDArray[numpy.float64]] Predict the relative frequencies of states. Each different type of fluorophore's states frequencies sum up to 1. :returns: **frequency_states** -- Name of fluorophores as keys and their state's expected relative frequencies (array) as values. :rtype: dict[str, npt.NDArray[np.float64]] .. py:method:: predict_lifetimes() -> tuple[numpy.typing.NDArray[numpy.float64], dict[str, numpy.typing.NDArray[numpy.float64]]] Predict the lifetime distributions of states and the time until occurrence distributions of transitions. :returns: * **transition_time_distributions** (*npt.NDArray[np.float64]*) -- Expected distributions of time until transition. Contains objects of type scipy.stats.*.rv_frozen for each transition. * **lifetime_distributions** (*dict[str, npt.NDArray[np.float64]]*) -- Name of fluorophores as keys and their state's expected lifetime distributions (objects of type scipy.stats.*.rv_frozen) (array) as values. .. py:method:: infer_stats() -> tuple[dict[str, numpy.typing.NDArray[numpy.float64]], dict[str, numpy.typing.NDArray[numpy.float64]]] Infers statistics of states based on lifetime distributions and frequencies. :returns: * **mean_lifetimes** (*dict[str, npt.NDArray[np.float64]]*) -- Name of fluorophores as keys and their state's expected lifetime means (array) as values. * **state_occupations** (*dict[str, npt.NDArray[np.float64]]*) -- Name of fluorophores as keys and their state's expected probability of being occupied at any given point in time (array) as values. .. py:method:: plot_frequency_transitions(**kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot frequencies of transitions. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_frequency_states(**kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot frequencies of states. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_mean_transition_times(**kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot mean times until transitions occur. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_mean_lifetimes(**kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot mean lifetimes of states. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_state_occupations(**kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot state occupation times (relative total time spent in state). :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_lifetime_distributions(fluorophore: str, state_identity: int, x: numpy.typing.ArrayLike | None = None, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot lifetime distributions of states. :param fluorophore: The name of the fluorophore whose state's distribution is to be shown. :param state_identity: The identity of the state whose distribution is to be shown. :param x: The x values for which the distribution is to be shown. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_transition_time_distributions(fluorophore: str, transition_id: int, x: numpy.typing.ArrayLike | None = None, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot distributions of time until transition occurs. :param fluorophore: The name of the fluorophore whose transition's distribution is to be shown. :param transition_id: The identity of the transition whose distribution is to be shown. :param x: The x values for which the distribution is to be shown. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes]