pyopia.statistics

pyopia.statistics#

Module containing tools for handling particle image statistics after processing

Functions

add_best_guesses_to_stats(stats)

Calculates the most likely tensorflow classification and adds best guesses to stats dataframe.

add_depth_to_stats(stats, time, depth)

If you have a depth time-series, use this function to find the depth of each line in stats

bright_norm(im[, brightness])

Eye-candy function for normalising the image brightness

count_images_in_stats(stats)

count the number of raw images used to generate stats

crop_stats(stats, crop_stats)

Filters stats file based on whether the particles are within a rectangle specified by crop_stats.

d50_from_stats(stats, pixel_size)

Calculate the d50 from the stats and settings

d50_from_vd(volume_distribution, dias)

Calculate d50 from a volume distribution

explode_contrast(im)

Eye-candy function for exploding the contrast of a particle iamge (roi)

extract_latest_stats(stats, window_size)

Extracts the stats data from within the last number of seconds specified by window_size.

extract_nth_largest(stats[, n])

Return statistics of the nth largest particle

extract_nth_longest(stats[, n])

Return statistics of the nth longest particle

extract_oil(stats[, probability_threshold, ...])

Creates a new stats dataframe containing only oil, based on some thresholds on calculated statistics

gen_roifiles(stats[, auto_scaler])

Generates a list of filenames suitable for making montages with

get_j(dias, number_distribution)

Calculates the junge slope from a correctly-scale number distribution (number per micron per litre must be the units of nd)

get_sample_volume(pix_size, path_length[, ...])

calculate the sample volume of one image

get_size_bins()

Retrieve log-spaced size bins for PSD analysis by doing the same binning as LISST-100x, but with 53 size bins

make_montage(stats_file_or_df, pixel_size, ...)

Makes nice looking montage from a directory of extracted particle images

make_timeseries_vd(stats, pixel_size, ...)

Makes a dataframe of time-series volume distribution and d50 similar to Sequoia LISST-100 output, and exportable to things like Excel or csv.

nc_from_nd(number_distribution, sample_volume)

Calculate the number concentration from the count and sample volume

nc_vc_from_stats(stats, pix_size, path_length)

Calculates important summary statistics from a stats DataFrame

nd_from_stats(stats, pix_size)

Calculate number distirbution from stats units are number per bin per sample volume

nd_from_stats_scaled(stats, pix_size, ...)

Calcualte a scaled number distribution from stats.

nd_rescale(dias, number_distribution, ...)

Rescale a number distribution from number per bin per sample volume to number per micron per litre.

roi_from_export_name(exportname, path)

Returns an image from the export_name string in the -STATS.h5 file

show_h5_meta(h5file)

prints metadata from an exported hdf5 file created from silcam process

statscsv_to_statshdf(stats_file)

Convert old STATS.csv file to a STATS.h5 file

trim_stats(stats_file, start_time, end_time)

Chops a STATS.h5 file given a start and end time

vd_from_nd(number_distribution, dias[, ...])

Calculate volume concentration from particle count

vd_from_stats(stats, pix_size)

Calculate volume distribution from stats units of miro-litres per sample volume

vd_to_nc(volume_distribution, dias)

calculate number concentration from volume distribution

vd_to_nd(volume_distribution, dias)

convert volume distribution to number distribution

Classes

PerClassConcentration(output_csv[, ...])

PyOpia pipeline-compatible class for computing per-class number concentrations (in numbers/litre) for each processed image, and appending the result as a timestamp-indexed row to a CSV file.