darsia.MultiphaseTimeSeriesAnalysis#

class MultiphaseTimeSeriesAnalysis(geometry)[source]#

Bases: object

Class for analyzing a single run of the multiphase flow experiment. Includes data tracking, time series data management, and plotting of results.

Methods

clean(threshold)

Remove faulty data from tracked time series data.

load(path)

Load the multiphase time series data from a csv file.

plot_contour_mass(img, mass_analysis_result, ...)

Plot contours of the mass on the image.

plot_contour_signal(img, ...[, thickness])

Plot contours of the aqueous and gaseous signals on the image.

plot_mass_over_time(path, **kwargs)

Plot the time series mass data of gaseous and aqueous phases.

plot_result(mass_analysis_result, component, ...)

Plot the result of the mass analysis for a specific component.

plot_volume_over_time(path, **kwargs)

Plot the time series volume of gaseous and aqueous phases.

reset()

Reset the tracking time series data to empty lists.

save(path)

Save the multiphase time series data to a csv file.

track(mass_analysis_result)

Track the mass analysis result and add to time series data.

Attributes

geometry

Geometry for integration of mass and volume.

data

Time series data for multiphase mass and volume tracking.

color_aq

Color for aqueous phase in plots.

color_g

Color for gaseous phase in plots.

color_mass

Color for mass in plots.

clean(threshold)[source]#

Remove faulty data from tracked time series data.

Parameters:
thresholdfloat

Threshold for cleaning the data. Data points with absolute values below this threshold will be removed.

load(path)[source]#

Load the multiphase time series data from a csv file.

Parameters:
pathPath

Path to the csv file containing the time series data.

plot_contour_mass(img, mass_analysis_result, values, path, thickness=5)[source]#

Plot contours of the mass on the image.

Parameters:
imgdarsia.Image

The image on which to plot the contours.

mass_analysis_resultdarsia.MassAnalysisResults

The mass analysis results containing the mass data.

valueslist[float]

List of mass values to create contours for.

pathPath

Path to save the contour image.

thicknessint, optional

Thickness of the contour lines. Defaults to 5.

Returns:
darsia.Image

The contour image with mass contours plotted.

plot_contour_signal(img, mass_analysis_result, values_aq, values_g, path, thickness=5)[source]#

Plot contours of the aqueous and gaseous signals on the image.

Parameters:
imgdarsia.Image

The image on which to plot the contours.

mass_analysis_resultdarsia.MassAnalysisResults

The mass analysis results containing the signals.

values_aqlist[float]

List of aqueous signal values to create contours for.

values_glist[float]

List of gaseous signal values to create contours for.

pathPath

Path to save the contour image.

thicknessint, optional

Thickness of the contour lines. Defaults to 5.

Returns:
darsia.Image

The contour image with aqueous and gaseous signal contours plotted.

plot_mass_over_time(path, **kwargs)[source]#

Plot the time series mass data of gaseous and aqueous phases.

Parameters:
pathPath

Path to save the plot.

**kwargs

Additional keyword arguments, e.g., ‘upper_time_limit’ to limit the time range.

plot_result(mass_analysis_result, component, path, vmax=None)[source]#

Plot the result of the mass analysis for a specific component.

Parameters:
mass_analysis_resultdarsia.MassAnalysisResults

The mass analysis results containing the component data.

componentstr

The component to plot, e.g., ‘normalized_signal_aq’, ‘normalized_signal_g’, or ‘mass’.

pathdarsia.Path

Path to save the plot.

vmaxOptional[float]

Maximum value for the color scale. If None, the maximum value of the image is used.

plot_volume_over_time(path, **kwargs)[source]#

Plot the time series volume of gaseous and aqueous phases.

Parameters:
pathPath

Path to save the plot.

**kwargs

Additional keyword arguments, e.g., ‘upper_time_limit’ to limit the time range.

reset()[source]#

Reset the tracking time series data to empty lists.

save(path)[source]#

Save the multiphase time series data to a csv file.

Parameters:
pathPath

Path to the csv file to save the time series data.

abstractmethod track(mass_analysis_result)[source]#

Track the mass analysis result and add to time series data.

Use: self.data.append(…) to add data to the time series.

Parameters:
mass_analysis_resultdarsia.MassAnalysisResults

The mass analysis results containing the component data. This should include the mass and volume data for gaseous and aqueous phases.

color_aq#

Color for aqueous phase in plots.

color_g#

Color for gaseous phase in plots.

color_mass#

Color for mass in plots.

data#

Time series data for multiphase mass and volume tracking.

geometry#

Geometry for integration of mass and volume.