PySight Post Processing

Fluorescence Lifetime Imaging

pysight.post_processing.flim.add_bins_to_df(df: pandas.core.frame.DataFrame, edges: List[numpy.ndarray], col_names: List[str])[source]

Essentially a multi-dimensions histogram within a pandas dataframe. Sets each dimension a bin_of_dim{{num_of_dimension}} column where the value is the bin of the photon. Binning is based on {{edges}}. Used to group photons by pseudo-coordinates in order to estimate lifetime of a coordinate within a frame. :return:

pysight.post_processing.flim.add_downsample_frame_idx_to_df(data: pandas.core.frame.DataFrame, chan: int, frames: pandas.core.series.Series, num_of_frames=256)[source]

Downsampling in time: Receives {data} and {frames} (series which maps line to frame) and adds a frame_idx column to {data}. a sequential {num_of_frames} will receive that same frame_idx value so that it can later be used to aggregate over {num_of_frames} at a time :return: original {data} DF with frame_idx column

pysight.post_processing.flim.calc_lifetime(data, bins_bet_pulses=125) → float[source]

calculate lifetime by creating an histogramming the photons by time of arrival, we would then expect to see an exponential decay to which we can fit an exponential curve to estimate the lifetime. a Savitzky Golay filter is applied to the histogram to smooth out noise. :param data: array of photon times of arrival :param bins_bet_pulses: number of bins to split the photons into :return: estimate lifetime (int)

pysight.post_processing.flim.flip_photons(data: pandas.core.frame.DataFrame, edges_of_lines_dim: numpy.array, lines: numpy.array, num_of_pixels: int)[source]

Receives {data} and flips every odd line by finding the mean time diff between the first 256 lines of {data}, and subtracting that mean from the odd lines.