locan.analysis.localizations_per_frame.LocalizationsPerFrame¶
- class locan.analysis.localizations_per_frame.LocalizationsPerFrame(meta=None, norm=None, time_delta='integration_time', resample=None, **kwargs)[source]¶
Bases:
_AnalysisCompute localizations per frame.
- Parameters:
meta (locan.analysis.metadata_analysis_pb2.AMetadata) – Metadata about the current analysis routine.
norm (int | float | str | None) – Normalization factor that can be None, a number, or another property in locdata.
time_delta (int | float | str | pd.Timedelta | None) – Time per frame in milliseconds. String must specify the unit like ‘10ms’. For ‘integration_time’ the time is taken from locdata.meta.experiment.setups[0].optical_units[0].detection.camera.integration_time
resample (DateOffset | Timedelta | str) – Parameter for
pandas.Series.resample(): The offset string or object representing target conversion.kwargs (
Any) – Other parameters passed topandas.Series.resample().
- Variables:
count (int) – A counter for counting instantiations.
parameter (dict) – A dictionary with all settings for the current computation.
meta (locan.analysis.metadata_analysis_pb2.AMetadata) – Metadata about the current analysis routine.
results (pandas.Series) – Computed results.
distribution_statistics (Distribution_fits object | None) – Distribution parameters derived from MLE fitting of results.
Methods
__init__([meta, norm, time_delta, resample])compute(locdata)Run the computation.
fit_distributions(**kwargs)Fit probability density functions to the distributions of ` loc_property` values in the results using MLE (scipy.stats).
hist([ax, fit, bins])Provide histogram as
matplotlib.axes.Axesobject showing hist(results).plot([ax, window, cumulative, normalize])Provide plot as
matplotlib.axes.Axesobject showing the running average of results over window size.report(*args, **kwargs)Show a report about analysis results.
Attributes
A counter for counting Analysis class instantiations (class attribute).
- compute(locdata)[source]¶
Run the computation.
- Parameters:
locdata (
Union[LocData,_Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[bool|int|float|complex|str|bytes]]) – Points in time: either localization data that contains a column frame or an array with time points.- Return type:
Self
-
count:
int= 0¶ A counter for counting Analysis class instantiations (class attribute).
- fit_distributions(**kwargs)[source]¶
Fit probability density functions to the distributions of ` loc_property` values in the results using MLE (scipy.stats).
- Parameters:
loc_property (str) – The LocData property for which to fit an appropriate distribution; if None all plots are shown.
- Return type:
None
- hist(ax=None, fit=True, bins='auto', **kwargs)[source]¶
Provide histogram as
matplotlib.axes.Axesobject showing hist(results).- Parameters:
ax (
Axes|None) – The axes on which to show the imagebins (
int|Sequence[int|float] |str) – Bin specifications (passed to matplotlib.hist).fit (
bool) – Flag indicating if distributions fit are shown.kwargs (
Any) – Other parameters passed tomatplotlib.pyplot.hist().
- Returns:
Axes object with the plot.
- Return type:
matplotlib.axes.Axes
- plot(ax=None, window=1, cumulative=False, normalize=False, **kwargs)[source]¶
Provide plot as
matplotlib.axes.Axesobject showing the running average of results over window size.- Parameters:
ax (
Axes|None) – The axes on which to show the imagewindow (
int) – Window for running average that is applied before plotting.cumulative (
bool) – Plot the cumulated results if true.normalize (
bool) – Normalize cumulative plot to the last valuekwargs (
Any) – Other parameters passed tomatplotlib.pyplot.plot().
- Returns:
Axes object with the plot.
- Return type:
matplotlib.axes.Axes