Heteroegenous media analysis workflows (darsia.presets.fluidflower)#

Submodules#

darsia.presets.fluidflower.benchmarkco2model module#

Module containing presets for concentration analyses as used for analyzing the benchmark experiments.

benchmark_binary_cleaning_preset(base, options)[source]#

Cleaning methods also used in the benchmark_concentration_analysis_preset.

Parameters:
  • base (darsia.Image) – baseline image

  • options (dict) – options same as in benchmark_concentration_analysis_preset.

benchmark_concentration_analysis_preset(base, labels, options)[source]#

The strategy for identifying any phase is constructed as a pipeline of the following steps:

  1. Use monochromatic signal reduction

  2. Restoration (upscaling) of signal

  3. Prior strategy providing a first detection.
    1. Thresholding.

    2. binary inpainting

    3. resizing and smoothing

    4. conversion to boolean data

  4. Posterior strategy reviewing the first three steps.

Parameters:
  • base (darsia.Image) – baseline image

  • labels (np.ndarray) – labeling of domain in facies

  • options (dict) – dictionary holding all tuning parameters

Returns:

concentration analysis for detecting CO2.

Return type:

darsia.ConcentrationAnalysis

darsia.presets.fluidflower.fluidflowerco2analysis module#

Standardized FluidFlower analysis.

It will require further information for specific rigs to be obtained through multiple inheritance.

class FluidFlowerCO2Analysis(baseline, config, results, update_setup=False, verbosity=0)[source]#

Bases: CO2Analysis

Class for managing the FluidFlower CO2 images as those acquired in the benchmark analysis.

batch_analysis(images, **kwargs)#

Standard batch analysis.

Parameters:
  • images (list of Path) – paths to batch of images.

  • kwargs – optional keyword arguments used in single_image_analysis.

define_co2_analysis()[source]#

FluidFlower Benchmark preset for detecting CO2.

Returns:

detector for CO2

Return type:

PriorPosteriorConcentrationAnalysis

define_co2_gas_analysis()[source]#

FluidFlower Benchmark preset for detecting CO2 gas.

Returns:

detector for CO2(g)

Return type:

PriorPosteriorConcentrationAnalysis

determine_co2()#

Extract CO2 from currently loaded image, based on a reference image.

Returns:

binary image of spatial CO2 distribution.

Return type:

darsia.Image

determine_co2_gas()#

Extract CO2(g) from currently loaded image, based on a reference image.

Returns:

binary image of spatial CO2(g) distribution.

Return type:

darsia.Image

determine_co2_gas_mask(co2)[source]#

Determine CO2.

Parameters:

co2 (darsia.Image) – boolean image detecting all co2.

Returns:

boolean image detecting CO2(g).

Return type:

darsia.Image

determine_co2_mask()[source]#

Determine CO2.

Returns:

boolean image detecting CO2.

Return type:

darsia.Image

load_and_process_image(path)#

Load image for further analysis. Do all corrections and processing needed.

Parameters:

path (str or Path) – path to image

Returns:

processed image

Return type:

darsia.Image

single_image_analysis(img, **kwargs)[source]#

Standard workflow to analyze CO2 phases.

Parameters:
  • image (Path or Image) – path to single image.

  • kwargs

    optional keyword arguments: plot_contours (bool): flag controlling whether the original image

    is plotted with contours of the two CO2 phases; default False.

    write_contours_to_file (bool): flag controlling whether the plot from

    plot_contours is written to file; default False.

    write_segmentation_to_file (bool): flag controlling whether the

    CO2 segmentation is written to file, where water, dissolved CO2 and CO2(g) get decoded 0, 1, 2, respectively; default False.

    write_coarse_segmentation_to_file (bool): flag controlling whether

    a coarse (280 x 150) representation of the CO2 segmentation from write_segmentation_to_file is written to file; default False.

color_correction#

Color correction based on reference colors.

config#

Config dict from file.

curvature_correction#

Curvature correction.

deformation_correction#

Local deformation correction wrt. baseline image.

drift_corrected_base#

Baseline image corrected for drift only.

drift_correction#

Drift correction wrt. baseline image.

height#

Physical height of image.

origin#

Physical origin of origin voxel.

processed_baseline_images#

List of corrected baseline images.

reference_date#
translation_correction#

Translation correction based on fixed absolute translation.

uncorrected_base#

Baseline image stored as physical image but without corrections.

width#

Physical width of image.

darsia.presets.fluidflower.fluidflowerrig module#

Module containing the general setup for a fluidflower rig with segmented geometry.

class FluidFlowerRig(baseline, config, update_setup=False)[source]#

Bases: AnalysisBase

batch_analysis(images, **kwargs)#

Standard batch analysis.

Parameters:
  • images (list of Path) – paths to batch of images.

  • kwargs – optional keyword arguments used in single_image_analysis.

load_and_process_image(path)#

Load image for further analysis. Do all corrections and processing needed.

Parameters:

path (str or Path) – path to image

Returns:

processed image

Return type:

darsia.Image

single_image_analysis(img, **kwargs)#

Standard workflow to analyze CO2 phases.

Parameters:
  • image (Path or Image) – path to single image.

  • kwargs – optional keyword arguments

color_correction#

Color correction based on reference colors.

config#

Config dict from file.

curvature_correction#

Curvature correction.

deformation_correction#

Local deformation correction wrt. baseline image.

drift_corrected_base#

Baseline image corrected for drift only.

drift_correction#

Drift correction wrt. baseline image.

height#

Physical height of image.

origin#

Physical origin of origin voxel.

processed_baseline_images#

List of corrected baseline images.

reference_date#
translation_correction#

Translation correction based on fixed absolute translation.

uncorrected_base#

Baseline image stored as physical image but without corrections.

width#

Physical width of image.

darsia.presets.fluidflower.fluidflowertraceranalysis module#

Standardized tracer concentration analysis.

Applicable for the tracer experiments in the FluidFlower (and other similar assets), allowing for heterogeneous media.

class FluidFlowerTracerAnalysis(baseline, config, results, update_setup=False, verbosity=0)[source]#

Bases: TracerAnalysis

Class for managing the well test of the FluidFlower benchmark.

batch_analysis(images, **kwargs)#

Standard batch analysis.

Parameters:
  • images (list of Path) – paths to batch of images.

  • kwargs – optional keyword arguments used in single_image_analysis.

calibrate_balancing(calibration_images, options)[source]#

Calibration routine aiming at decreasing the discontinuity modulus across interfaces of the labeling.

Parameters:
  • calibration_images (list of Path) – calibration images.

  • options (dict) – parameters for calibration.

calibrate_model(calibration_images, options)[source]#

Calibration routine aiming at matching the injection rate

NOTE: Calling this routine will require the definition of a geometry for data integration.

Parameters:
  • calibration_images (list of Path) – calibration images.

  • options (dict) – parameters for calibration.

define_tracer_analysis()[source]#

Identify tracer concentration using a reduction to the grayscale space.

determine_tracer(return_volume=False)#

Extract tracer from currently loaded image, based on a reference image.

Parameters:

return_volume (bool) – flag controlling whether the volume of the fluid in the porous geometry is returned.

Returns:

image array of spatial concentration map float, optional: occupied volume by the fluid in porous geometry

Return type:

darsia.Image

load_and_process_image(path)#

Load image for further analysis. Do all corrections and processing needed.

Parameters:

path (str or Path) – path to image

Returns:

processed image

Return type:

darsia.Image

single_image_analysis(img, **kwargs)[source]#

Standard workflow to analyze the tracer concentration.

Parameters:
  • image (Path) – path to single image.

  • kwargs – optional keyword arguments, see batch_analysis.

Returns:

tracer concentration map dict: dictinary with all stored results from the post-analysis.

Return type:

np.ndarray

color_correction#

Color correction based on reference colors.

config#

Config dict from file.

curvature_correction#

Curvature correction.

deformation_correction#

Local deformation correction wrt. baseline image.

drift_corrected_base#

Baseline image corrected for drift only.

drift_correction#

Drift correction wrt. baseline image.

height#

Physical height of image.

origin#

Physical origin of origin voxel.

processed_baseline_images#

List of corrected baseline images.

reference_date#
translation_correction#

Translation correction based on fixed absolute translation.

uncorrected_base#

Baseline image stored as physical image but without corrections.

width#

Physical width of image.