fluopy.analysis =============== .. py:module:: fluopy.analysis .. autoapi-nested-parse:: Analysis of a photophysical simulation. Classes ------- .. autoapisummary:: fluopy.analysis.Analysis Module Contents --------------- .. py:class:: Analysis(simulation: fluopy.simulation.Simulation) Container of simulation-derived statistical attributes and methods. :ivar simulation: Container for simulation-associated attributes. :vartype simulation: fluopy.simulation.Simulation :ivar frequency_transitions: Simulated relative frequencies of each transition. :vartype frequency_transitions: 1-D array_like :ivar frequency_states: Name of fluorophores as keys and their state's simulated relative frequencies (array) as values. :vartype frequency_states: dict :ivar transition_time_distributions: Contains 1-D array_like for each transition (time until the transition). :vartype transition_time_distributions: Collection :ivar lifetime_distributions: Name of fluorophores as keys and collections of their state's simulated lifetimes (1-D array_like) as values. :vartype lifetime_distributions: dict :ivar mean_transition_times: Simulated means of time until transition. :vartype mean_transition_times: 1-D array_like :ivar mean_lifetimes: Name of fluorophores as keys and their state's simulated lifetime means (array) as values. :vartype mean_lifetimes: dict :ivar state_occupations: Name of fluorophores as keys and their state's simulated probability of being occupied at any given point in time (array) as values. :vartype state_occupations: dict .. py:attribute:: simulation .. py:attribute:: frequency_transitions .. py:attribute:: frequency_states .. py:attribute:: mean_transition_times .. py:method:: is_absorbing() -> bool Check whether fluorophores reached Markovian absorbing states. :returns: **is_abs** -- Whether at least one of the fluorophores has reached a Markovian absorbing state. :rtype: bool .. py:method:: get_transition_occurrences() -> numpy.typing.NDArray[numpy.float64] Get the relative frequencies of transitions. :returns: **frequency_transitions** -- Simulated relative frequencies of each transition. :rtype: npt.NDArray[np.float64] .. py:method:: get_state_occurrences() -> dict[str, numpy.typing.NDArray[numpy.float64]] Get the relative frequencies of states. :returns: **frequency_states** -- Name of fluorophores as keys and their state's simulated relative frequencies (array) as values. :rtype: dict[str, npt.NDArray[np.float64]] .. py:method:: get_lifetimes() -> tuple[list[numpy.typing.NDArray[numpy.float64]], dict[str, numpy.typing.NDArray[numpy.float64]]] Get the lifetime distributions of states and the time until occurrence distributions of transitions. Note: if transition of interest is energy transfer, the time to transition is only collected from the donor's point of view. :returns: * **transition_time_distributions** (*list[npt.NDArray[np.float64]]*) -- Contains 1-D array_like for each transition (time until the transition). * **lifetime_distributions** (*dict[str, npt.NDArray[np.float64]]*) -- Name of fluorophores as keys and collections of their state's simulated lifetimes (1-D array_like) 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 simulated lifetime means (array) as values. * **state_occupations** (*dict[str, npt.NDArray[np.float64]]*) -- Name of fluorophores as keys and their state's simulated probability of being occupied at any given point in time (array) as values. .. py:method:: get_fluorescence_lifetimes(fluorophore: str | None = None) -> numpy.typing.NDArray[numpy.float64] Get the fluorescence lifetime (i.e., S1 lifetime) of the specified fluorophore. Note that this does not consider whether the S1 state decays via photon emission. :param fluorophore: The name of the fluorophore whose fluorescence lifetime is to be returned. :returns: **fluorescence_lifetimes** -- The fluorescence lifetimes of the specified fluorophore. :rtype: npt.NDArray[np.float64] .. py:method:: get_emitting_transition_lifetimes(fluorophore: str | None = None) -> numpy.typing.NDArray[numpy.float64] Get the lifetimes of the emitting transitions (i.e., S1 deexcitation via photon emission) of the specified fluorophore. :param fluorophore: The name of the fluorophore whose fluorescence lifetime is to be returned. :returns: **exp_fluorescence_lifetimes** -- The fluorescence lifetimes (photon emssion) of the specified fluorophore. :rtype: npt.NDArray[np.float64] .. py:method:: plot_frequency_transitions(prediction: fluopy.prediction.Prediction | None = None, diff_dist: bool = True, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot frequencies of transitions. :param prediction: Container of mathematically derived statistical attributes and methods. :param diff_dist: Whether to plot energy transfers distance-specific or not. :param kwargs: kwargs for fluopy.figure.universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_frequency_states(prediction: fluopy.prediction.Prediction | None = None, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot frequencies of states. :param prediction: Container of mathematically derived statistical attributes and methods. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_mean_transition_times(prediction: fluopy.prediction.Prediction | None = None, diff_dist: bool = True, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot mean times until transitions occur. :param prediction: Container of mathematically derived statistical attributes and methods. :param diff_dist: Whether to plot energy transfers distance-specific or not. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_mean_lifetimes(prediction: fluopy.prediction.Prediction | None = None, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot mean lifetimes of states. :param prediction: Container of mathematically derived statistical attributes and methods. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_state_occupations(prediction: fluopy.prediction.Prediction | None = None, **kwargs: Any) -> numpy.typing.NDArray[matplotlib.axes.Axes] Plot state occupation times (relative total time spent in state). :param prediction: Container of mathematically derived statistical attributes and methods. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_lifetime_distributions(fluorophore: str, state_identity: int, prediction: fluopy.prediction.Prediction | 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 prediction: Container of mathematically derived statistical attributes and methods. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes] .. py:method:: plot_transition_time_distributions(fluorophore: str, transition_id: int, prediction: fluopy.prediction.Prediction | 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 prediction: Container of mathematically derived statistical attributes and methods. :param kwargs: kwargs to universal_figure :returns: Contains matplotlib.axes._subplots.AxesSubplots. :rtype: npt.NDArray[mplAxes]