diff --git a/docs/2D_Inference/index.html b/docs/2D_Inference/index.html new file mode 100644 index 00000000..35ce85c1 --- /dev/null +++ b/docs/2D_Inference/index.html @@ -0,0 +1,120 @@ + + + + + + + Inference 2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference 2D

+
+

2D Posterior analysis of the Bayesian inference

+
2D Posterior analysis of the Bayesian inference
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/2D_Inference/inference_2d_plotting.html b/docs/2D_Inference/inference_2d_plotting.html new file mode 100644 index 00000000..62558aed --- /dev/null +++ b/docs/2D_Inference/inference_2d_plotting.html @@ -0,0 +1,279 @@ + + + + + + + 2D Posterior analysis of the Bayesian inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Posterior analysis of the Bayesian inference

+

All plotting in GeoBIPy can be carried out using the 3D inference class

+
import argparse
+import matplotlib.pyplot as plt
+import numpy as np
+from geobipy import Inference2D
+from create_model import create_model
+
+
+
def create_plots(folder, data_type, model_type):
+    #%%
+    # Inference for a line of inferences
+    # ++++++++++++++++++++++++++++++++++
+    #
+    # We can instantiate the inference handler by providing a path to the directory containing
+    # HDF5 files generated by GeoBIPy.
+    #
+    # The InfereceXD classes are low memory.  They only read information from the HDF5 files
+    # as and when it is needed.
+    #
+    # The first time you use these classes to create plots, expect longer initial processing times.
+    # I precompute expensive properties and store them in the HDF5 files for later use.
+
+    from numpy.random import Generator
+    from numpy.random import PCG64DXSM
+    generator = PCG64DXSM(seed=0)
+    prng = Generator(generator)
+
+    #%%
+    results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng)
+
+    kwargs = {
+            "log" : 10,
+            "cmap" : 'jet'
+            }
+
+    fig = plt.figure(figsize=(16, 4))
+    plt.suptitle("{} {}".format(data_type, model_type))
+    gs0 = fig.add_gridspec(3, 4)
+    ax1 = fig.add_subplot(gs0[0, 0])
+    true_model = create_model(model_type)
+
+    if data_type == 'resolve':
+        true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1
+
+    kwargs['vmin'] = np.log10(np.min(true_model.values))
+    kwargs['vmax'] = np.log10(np.max(true_model.values))
+
+    true_model.pcolor(**kwargs)
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    if data_type == 'resolve':
+        plt.ylim([-240, 60])
+    else:
+        plt.ylim([-550, 60])
+
+    ax1 = fig.add_subplot(gs0[1, 0])
+    results_2d.plot_mean_model(**kwargs);
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    # By adding the useVariance keyword, we can make regions of lower confidence more transparent
+    ax1 = fig.add_subplot(gs0[2, 0])
+    results_2d.plot_mode_model(use_variance=False, **kwargs);
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    # # We can also choose to keep parameters above the DOI opaque.
+    # results_2d.compute_doi()
+    # plt.subplot(313)
+    # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs);
+    # results_2d.plot_data_elevation(linewidth=0.3);
+    # results_2d.plot_elevation(linewidth=0.3);
+
+    #%%
+    # We can plot the parameter values that produced the highest posterior
+    ax = fig.add_subplot(gs0[0, 1])
+    results_2d.plot_k_layers()
+
+    ax1 = fig.add_subplot(gs0[1, 1], sharex=ax)
+    results_2d.plot_best_model(**kwargs);
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+
+    del kwargs['vmin']
+    del kwargs['vmax']
+
+    ax1 = fig.add_subplot(gs0[0, 2])
+    plt.title('5%')
+    results_2d.plot_percentile(percent=0.05, **kwargs)
+    ax1 = fig.add_subplot(gs0[1, 2])
+    plt.title('50%')
+    results_2d.plot_percentile(percent=0.5, **kwargs)
+    ax1 = fig.add_subplot(gs0[2, 2])
+    plt.title('95%')
+    results_2d.plot_percentile(percent=0.95, **kwargs)
+
+
+
+    #%%
+    # Now we can start plotting some more interesting posterior properties.
+    # How about the confidence?
+    ax1 = fig.add_subplot(gs0[0, 3])
+    results_2d.plot_confidence();
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    #%%
+    # We can take the interface depth posterior for each data point,
+    # and display an interface probability cross section
+    # This posterior can be washed out, so the clim_scaling keyword lets me saturate
+    # the top and bottom 0.5% of the colour range
+    ax1 = fig.add_subplot(gs0[1, 3])
+    plt.title('P(Interface)')
+    results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5);
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    ax1 = fig.add_subplot(gs0[2, 3])
+    results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5);
+    results_2d.plot_data_elevation(linewidth=0.3);
+    results_2d.plot_elevation(linewidth=0.3);
+
+    # plt.show(block=True)
+    plt.savefig('{}_{}_{}.png'.format(folder, data_type, model_type), dpi=300)
+
+
+if __name__ == '__main__':
+
+    Parser = argparse.ArgumentParser(description="Plotting 2D inferences",
+                                        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--data_type', dest='data_type', default=None, help='Skip the creation of the HDF5 files.  Only do this if you know they have been created.')
+    Parser.add_argument('--model_type', dest='model_type', default=None, help='Specify a numpy seed file to fix the random number generator. Only used in serial mode.')
+
+    args = Parser.parse_args()
+
+    data_types = ['skytem_512', 'resolve', 'tempest'] if args.data_type is None else args.data_type
+    model_types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] if args.model_type is None else args.model_type
+
+    if not isinstance(data_types, list): data_types = [data_types]
+    if not isinstance(model_types, list): model_types = [model_types]
+
+    for data in data_types:
+        print(data)
+        for model in model_types:
+            print('   ',model)
+            create_plots("no_reverse_jump", data, model)
+
+
+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/2D_Inference/readme.html b/docs/2D_Inference/readme.html new file mode 100644 index 00000000..1d2b04b4 --- /dev/null +++ b/docs/2D_Inference/readme.html @@ -0,0 +1,115 @@ + + + + + + + Inference 2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference 2D

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/2D_Inference/sg_execution_times.html b/docs/2D_Inference/sg_execution_times.html new file mode 100644 index 00000000..7f65e0b1 --- /dev/null +++ b/docs/2D_Inference/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 1 file from examples/2D_Inference:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

2D Posterior analysis of the Bayesian inference (inference_2d_plotting.py)

00:00.000

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/Parallel_Inference/index.html b/docs/Parallel_Inference/index.html new file mode 100644 index 00000000..56fb5bf5 --- /dev/null +++ b/docs/Parallel_Inference/index.html @@ -0,0 +1,158 @@ + + + + + + + Parallel Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Parallel Inference

+

The best way to run geobipy with MPI is through the command line entry point. +Upon install, pip will create the “geobipy” entry point into the code base. +This entry point can be used for both serial and parallel modes.

+
srun geobipy options.py <output folder> --mpi
+
+
+

Please refer to the installation instructions for getting your Python environment setup with mpi4py and mpi enabled hdf5. +Install those two packages first before installing geobipy otherwise pip might inadvertently install the non-parallel-enabled hdf5 library.

+
+

Parallelization

+

Geopbipy is currently parallelized using only MPI. We do not use single machine parallel libraries like multiprocessing or joblib because we wanted scalability from the start. +We currently have no dependence between data points in a data set, so we can treat each data point independently from its neighbours. This lends itself well to distributed parallelization using MPI. +One of the biggest bottlenecks of any parallel enabled program is file IO, we therefore alleviate this bottleneck by writing results to HDF5 files (With future scope to have these be properly georeferenced netcdf files) +Each unique line number in a data file will have its own separate hdf5 file.

+

Here is a sample slurm script to submit an mpi enabled job to the queue. Since we only care about total cores available, we dont need to worry too much about cores per node, or increasing RAM per core. Geobipy operates with relatively small memory requirements, and we have tested with only 256MB per core available. +The code is currently showing linear scalability upto 9000 cores (which was our maximum available at the time).

+
#!/bin/bash
+#SBATCH --job-name=geobipy
+#SBATCH -n 5000
+#SBATCH -p <partition>
+#SBATCH --account=<account name>
+#SBATCH --time=dd-hh:mm:ss
+#SBATCH -o %j.out
+
+# Your module load section to enable python
+module load cray-hdf5-parallel cray-python
+# FFTW is required when compiling the time domain forward modeller from Geoscience Australia
+module load cray-fftw
+
+# We use Numba to compile the Python frequency domain forward modeller into C
+export OMP_NUM_THREADS=1
+export NUMBA_CPU_NAME='skylake'  # Change your CPU name
+
+# Source your python environment how you need, either conda or venv
+source <Path to env /bin/activate>
+conda activate geobipy
+
+mkdir <output_folder>
+rm <output_folder>/*.h5  # We recommend this in case you have to restart a run.  HDF5 files can corrupt on unsuccessful exit.
+srun geobipy options.py <output_folder> --mpi
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/Parallel_Inference/readme.html b/docs/Parallel_Inference/readme.html new file mode 100644 index 00000000..b8a6c74a --- /dev/null +++ b/docs/Parallel_Inference/readme.html @@ -0,0 +1,158 @@ + + + + + + + Parallel Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Parallel Inference

+

The best way to run geobipy with MPI is through the command line entry point. +Upon install, pip will create the “geobipy” entry point into the code base. +This entry point can be used for both serial and parallel modes.

+
srun geobipy options.py <output folder> --mpi
+
+
+

Please refer to the installation instructions for getting your Python environment setup with mpi4py and mpi enabled hdf5. +Install those two packages first before installing geobipy otherwise pip might inadvertently install the non-parallel-enabled hdf5 library.

+
+

Parallelization

+

Geopbipy is currently parallelized using only MPI. We do not use single machine parallel libraries like multiprocessing or joblib because we wanted scalability from the start. +We currently have no dependence between data points in a data set, so we can treat each data point independently from its neighbours. This lends itself well to distributed parallelization using MPI. +One of the biggest bottlenecks of any parallel enabled program is file IO, we therefore alleviate this bottleneck by writing results to HDF5 files (With future scope to have these be properly georeferenced netcdf files) +Each unique line number in a data file will have its own separate hdf5 file.

+

Here is a sample slurm script to submit an mpi enabled job to the queue. Since we only care about total cores available, we dont need to worry too much about cores per node, or increasing RAM per core. Geobipy operates with relatively small memory requirements, and we have tested with only 256MB per core available. +The code is currently showing linear scalability upto 9000 cores (which was our maximum available at the time).

+
#!/bin/bash
+#SBATCH --job-name=geobipy
+#SBATCH -n 5000
+#SBATCH -p <partition>
+#SBATCH --account=<account name>
+#SBATCH --time=dd-hh:mm:ss
+#SBATCH -o %j.out
+
+# Your module load section to enable python
+module load cray-hdf5-parallel cray-python
+# FFTW is required when compiling the time domain forward modeller from Geoscience Australia
+module load cray-fftw
+
+# We use Numba to compile the Python frequency domain forward modeller into C
+export OMP_NUM_THREADS=1
+export NUMBA_CPU_NAME='skylake'  # Change your CPU name
+
+# Source your python environment how you need, either conda or venv
+source <Path to env /bin/activate>
+conda activate geobipy
+
+mkdir <output_folder>
+rm <output_folder>/*.h5  # We recommend this in case you have to restart a run.  HDF5 files can corrupt on unsuccessful exit.
+srun geobipy options.py <output_folder> --mpi
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/Parallel_Inference/sg_execution_times.html b/docs/Parallel_Inference/sg_execution_times.html new file mode 100644 index 00000000..f4d671ab --- /dev/null +++ b/docs/Parallel_Inference/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from examples/Parallel_Inference:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/_downloads/021b6cf14de4fd76c7a3e2f90a173578/hdf5.ipynb b/docs/_downloads/021b6cf14de4fd76c7a3e2f90a173578/hdf5.ipynb new file mode 100644 index 00000000..f8ce94a9 --- /dev/null +++ b/docs/_downloads/021b6cf14de4fd76c7a3e2f90a173578/hdf5.ipynb @@ -0,0 +1,144 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Using HDF5 within GeoBIPy\n\nInference for large scale datasets in GeoBIPy is handled using MPI and distributed memory systems.\nA common bottleneck with large parallel algorithms is the input output of information to disk.\nWe use HDF5 to read and write data in order to leverage the parallel capabililties of the HDF5 API.\n\nEach object within GeoBIPy has a create_hdf, write_hdf, and read_hdf routine.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import numpy as np\nimport h5py\nfrom geobipy import StatArray" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "StatArray\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Instantiate a StatArray\nx = StatArray(np.arange(10.0), name = 'an Array', units = 'some units')\n\n# Write the StatArray to a HDF file.\nwith h5py.File(\"x.h5\", 'w') as f:\n x.toHdf(f, \"x\")\n\n# Read the StatArray back in.\nwith h5py.File(\"x.h5\", 'r') as f:\n y = StatArray.fromHdf(f, 'x')\n\nprint('x', x)\nprint('y', y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There are actually steps within the \"toHdf\" function.\nFirst, space is created within the HDF file and second, the data is written to that space\nThese functions are split because during the execution of a parallel enabled program,\nall the space within the HDF file needs to be allocated before we can write to the file\nusing multiple cores.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Write the StatArray to a HDF file.\nwith h5py.File(\"x.h5\", 'w') as f:\n x.createHdf(f, \"x\")\n x.writeHdf(f, \"x\")\n\n# Read the StatArray back in.\nwith h5py.File(\"x.h5\", 'r') as f:\n y = StatArray.fromHdf(f, 'x')\n\nprint('x', x)\nprint('y', y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The create and write HDF methods also allow extra space to be allocated so that\nthe extra memory can be written later, perhaps by multiple cores.\nHere we specify space for 2 arrays, the memory is stored contiguously as a numpy array.\nWe then write to only the first index.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Write the StatArray to a HDF file.\nwith h5py.File(\"x.h5\", 'w') as f:\n x.createHdf(f, \"x\", nRepeats=2)\n x.writeHdf(f, \"x\", index=0)\n\n# Read the StatArray back in.\nwith h5py.File(\"x.h5\", 'r') as f:\n y = StatArray.fromHdf(f, 'x', index=0)\n\nprint('x', x)\nprint('y', y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The duplication can also be a shape.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Write the StatArray to a HDF file.\nwith h5py.File(\"x.h5\", 'w') as f:\n x.createHdf(f, \"x\", nRepeats=(2, 2))\n x.writeHdf(f, \"x\", index=(0, 0))\n\n# Read the StatArray back in.\nwith h5py.File(\"x.h5\", 'r') as f:\n y = StatArray.fromHdf(f, 'x', index=(0, 0))\n\nprint('x', x)\nprint('y', y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Similarly, we can duplicate a 2D array with an extra 2D duplication\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.random.randn(2, 2), name = 'an Array', units = 'some units')\n# Write the StatArray to a HDF file.\nwith h5py.File(\"x.h5\", 'w') as f:\n x.createHdf(f, \"x\", nRepeats=(2, 2))\n x.writeHdf(f, \"x\", index=(0, 0))\n\n# Read the StatArray back in.\nwith h5py.File(\"x.h5\", 'r') as f:\n y = StatArray.fromHdf(f, 'x', index=(0, 0))\n\nprint('x', x)\nprint('y', y)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/066a96b3e7333f9a789eb7e687c45875/plot_histogram_2d.py b/docs/_downloads/066a96b3e7333f9a789eb7e687c45875/plot_histogram_2d.py new file mode 100644 index 00000000..bc582e6a --- /dev/null +++ b/docs/_downloads/066a96b3e7333f9a789eb7e687c45875/plot_histogram_2d.py @@ -0,0 +1,305 @@ +""" +Histogram 2D +------------ + +This 2D histogram class allows efficient updating of histograms, plotting and +saving as HDF5. + +""" + +#%% +import h5py +import geobipy +from geobipy import StatArray +from geobipy import Histogram +import matplotlib.pyplot as plt +import matplotlib.gridspec as gridspec +from geobipy import RectilinearMesh2D +import numpy as np + + +#%% +# Create some histogram bins in x and y +x = StatArray(np.linspace(-4.0, 4.0, 100), 'Variable 1') +y = StatArray(np.linspace(-4.0, 4.0, 105), 'Variable 2') + +mesh = RectilinearMesh2D(x_edges=x, y_edges=y) +#%% +# Instantiate +H = Histogram(mesh) + +#%% +# Generate some random numbers +a = np.random.randn(1000000) +b = np.random.randn(1000000) + +#%% +# Update the histogram counts +H.update(a, b) + +#%% +plt.figure() +plt.subplot(131) +plt.title("2D Histogram") +_ = H.plot(cmap='gray_r') +plt.subplot(132) +H.pdf.plot(cmap='gray_r') +plt.subplot(133) +H.pmf.plot(cmap='gray_r') + + +plt.figure() +plt.subplot(131) +H.cdf(axis=0).plot() +plt.subplot(132) +H.cdf(axis=1).plot() +plt.subplot(133) +H.cdf().plot() + +#%% +# We can overlay the histogram with its credible intervals +plt.figure() +plt.title("90% credible intervals overlain") +H.pcolor(cmap='gray_r') +H.plotCredibleIntervals(axis=0, percent=95.0) +_ = H.plotCredibleIntervals(axis=1, percent=95.0) + +#%% +# Generate marginal histograms along an axis +h1 = H.marginalize(axis=0) +h2 = H.marginalize(axis=1) + +#%% +# Note that the names of the variables are automatically displayed +plt.figure() +plt.suptitle("Marginals along each axis") +plt.subplot(121) +h1.plot() +plt.subplot(122) +_ = h2.plot() + +#%% +# Create a combination plot with marginal histograms. +# sphinx_gallery_thumbnail_number = 3 +plt.figure() +gs = gridspec.GridSpec(5, 5) +gs.update(wspace=0.3, hspace=0.3) +ax = [plt.subplot(gs[1:, :4])] +H.pcolor(colorbar = False) + +ax.append(plt.subplot(gs[:1, :4])) +h = H.marginalize(axis=0).plot() +plt.xlabel(''); plt.ylabel('') +plt.xticks([]); plt.yticks([]) +ax[-1].spines["left"].set_visible(False) + +ax.append(plt.subplot(gs[1:, 4:])) +h = H.marginalize(axis=1).plot(transpose=True) +plt.ylabel(''); plt.xlabel('') +plt.yticks([]); plt.xticks([]) +ax[-1].spines["bottom"].set_visible(False) + +#%% +# Take the mean or median estimates from the histogram +mean = H.mean() +median = H.median() + +#%% +plt.figure(figsize=(9.5, 5)) +plt.suptitle("Mean, median, and credible interval overlain") +ax = plt.subplot(121) +H.pcolor(cmap='gray_r', colorbar=False) +H.plotCredibleIntervals(axis=0) +H.plotMedian(axis=0, color='g') +H.plotMean(axis=0, color='y') +plt.legend() + +plt.subplot(122, sharex=ax, sharey=ax) +H.pcolor(cmap='gray_r', colorbar=False) +H.plotCredibleIntervals(axis=1) +H.plotMedian(axis=1, color='g') +H.plotMean(axis=1, color='y') +plt.legend() + +#%% +# Get the range between credible intervals +H.credible_range(percent=95.0) + +#%% +# We can map the credible range to an opacity or transparency +H.opacity() +H.transparency() + +# H.animate(0, 'test.mp4') + +import h5py +with h5py.File('h2d.h5', 'w') as f: + H.toHdf(f, 'h2d') + +with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + +plt.close('all') + +x = StatArray(5.0 + np.linspace(-4.0, 4.0, 100), 'Variable 1') +y = StatArray(10.0 + np.linspace(-4.0, 4.0, 105), 'Variable 2') + +mesh = RectilinearMesh2D(x_edges=x, x_relative_to=5.0, y_edges=y, y_relative_to=10.0) +#%% +# Instantiate +H = Histogram(mesh) + +#%% +# Generate some random numbers +a = np.random.randn(1000000) + 5.0 +b = np.random.randn(1000000) + 10.0 + +#%% +# Update the histogram counts +H.update(a, b) + +#%% +plt.figure() +plt.subplot(131) +plt.title("2D Histogram") +_ = H.plot(cmap='gray_r') +plt.subplot(132) +H.pdf.plot(cmap='gray_r') +plt.subplot(133) +H.pmf.plot(cmap='gray_r') + +plt.figure() +plt.subplot(131) +H.cdf(axis=0).plot() +plt.subplot(132) +H.cdf(axis=1).plot() +plt.subplot(133) +H.cdf().plot() + +#%% +# We can overlay the histogram with its credible intervals +plt.figure() +plt.title("90% credible intervals overlain") +H.pcolor(cmap='gray_r') +H.plotCredibleIntervals(axis=0, percent=95.0) +_ = H.plotCredibleIntervals(axis=1, percent=95.0) + +# Generate marginal histograms along an axis +h1 = H.marginalize(axis=0) +h2 = H.marginalize(axis=1) + +#%% +# Note that the names of the variables are automatically displayed +plt.figure() +plt.suptitle("Marginals along each axis") +plt.subplot(121) +h1.plot() +plt.subplot(122) +_ = h2.plot() + +#%% +# Create a combination plot with marginal histograms. +# sphinx_gallery_thumbnail_number = 3 +plt.figure() +gs = gridspec.GridSpec(5, 5) +gs.update(wspace=0.3, hspace=0.3) +ax = [plt.subplot(gs[1:, :4])] +H.pcolor(colorbar = False) + +ax.append(plt.subplot(gs[:1, :4])) +h = H.marginalize(axis=0).plot() +plt.xlabel(''); plt.ylabel('') +plt.xticks([]); plt.yticks([]) +ax[-1].spines["left"].set_visible(False) + +ax.append(plt.subplot(gs[1:, 4:])) +h = H.marginalize(axis=1).plot(transpose=True) +plt.ylabel(''); plt.xlabel('') +plt.yticks([]); plt.xticks([]) +ax[-1].spines["bottom"].set_visible(False) + +#%% +# Take the mean or median estimates from the histogram +mean = H.mean() +median = H.median() + +#%% +plt.figure(figsize=(9.5, 5)) +plt.suptitle("Mean, median, and credible interval overlain") +ax = plt.subplot(121) +H.pcolor(cmap='gray_r', colorbar=False) +H.plotCredibleIntervals(axis=0) +H.plotMedian(axis=0, color='g') +H.plotMean(axis=0, color='y') +plt.legend() + +plt.subplot(122, sharex=ax, sharey=ax) +H.pcolor(cmap='gray_r', colorbar=False) +H.plotCredibleIntervals(axis=1) +H.plotMedian(axis=1, color='g') +H.plotMean(axis=1, color='y') +plt.legend() + +#%% +# Get the range between credible intervals +H.credible_range(percent=95.0) + +#%% +# We can map the credible range to an opacity or transparency +H.opacity() +H.transparency() + +# # H.animate(0, 'test.mp4') + +with h5py.File('h2d.h5', 'w') as f: + H.toHdf(f, 'h2d') + +with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + +plt.figure(figsize=(9.5, 5)) +plt.suptitle("Mean, median, and credible interval overlain") +ax = plt.subplot(121) +H1.pcolor(cmap='gray_r', colorbar=False) +H1.plotCredibleIntervals(axis=0) +H1.plotMedian(axis=0, color='g') +H1.plotMean(axis=0, color='y') +plt.legend() + +plt.subplot(122, sharex=ax, sharey=ax) +H1.pcolor(cmap='gray_r', colorbar=False) +H1.plotCredibleIntervals(axis=1) +H1.plotMedian(axis=1, color='g') +H1.plotMean(axis=1, color='y') +plt.legend() + +with h5py.File('h2d.h5', 'w') as f: + H.createHdf(f, 'h2d', add_axis=StatArray(np.arange(3.0), name='Easting', units="m")) + for i in range(3): + H.writeHdf(f, 'h2d', index=i) + +with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d'], index=0) + +plt.figure(figsize=(9.5, 5)) +plt.suptitle("Mean, median, and credible interval overlain") +ax = plt.subplot(121) +H1.pcolor(cmap='gray_r', colorbar=False) +H1.plotCredibleIntervals(axis=0) +H1.plotMedian(axis=0, color='g') +H1.plotMean(axis=0, color='y') +plt.legend() + +plt.subplot(122, sharex=ax, sharey=ax) +H1.pcolor(cmap='gray_r', colorbar=False) +H1.plotCredibleIntervals(axis=1) +H1.plotMedian(axis=1, color='g') +H1.plotMean(axis=1, color='y') +plt.legend() + +with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + +H1.pyvista_mesh().save('h3d_read.vtk') + +plt.show() diff --git a/docs/_downloads/09f048ba9debdfb740a9a828a370954b/plot_inference_1d_resolve.py b/docs/_downloads/09f048ba9debdfb740a9a828a370954b/plot_inference_1d_resolve.py new file mode 100644 index 00000000..50ae8ebc --- /dev/null +++ b/docs/_downloads/09f048ba9debdfb740a9a828a370954b/plot_inference_1d_resolve.py @@ -0,0 +1,89 @@ +""" +Running GeoBIPy to invert Resolve data +++++++++++++++++++++++++++++++++++++++ +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] +data_type = "Resolve" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +supplementary = "..//..//supplementary//" + +parameter_file = supplementary + "//options_files//{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' +kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename'] + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=30, **kwargs) \ No newline at end of file diff --git a/docs/_downloads/16ec1efc89ed8eeea10bd844b92557de/plot_rectilinear_mesh_1d.ipynb b/docs/_downloads/16ec1efc89ed8eeea10bd844b92557de/plot_rectilinear_mesh_1d.ipynb new file mode 100644 index 00000000..e9ac490b --- /dev/null +++ b/docs/_downloads/16ec1efc89ed8eeea10bd844b92557de/plot_rectilinear_mesh_1d.ipynb @@ -0,0 +1,285 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 1D Rectilinear Mesh\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from copy import deepcopy\nfrom geobipy import StatArray\nfrom geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh2D_stitched\nimport matplotlib.gridspec as gridspec\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport h5py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The basics\nInstantiate a new 1D rectilinear mesh by specifying cell centres, edges, or widths.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.cumsum(np.arange(0.0, 10.0)), 'Depth', 'm')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Cell edges\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm = RectilinearMesh1D(edges=x, centres=None, widths=None)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the grid of the mesh\nOr Pcolor the mesh showing. An array of cell values is used as the colour.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "arr = StatArray(np.random.randn(*rm.shape), \"Name\", \"Units\")\np=0; plt.figure(p)\nplt.subplot(121)\n_ = rm.plotGrid(transpose=True, flip=True)\nplt.subplot(122)\n_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)\n\n# Mask the mesh cells by a distance\nrm_masked, indices, arr2 = rm.mask_cells(2.0, values=arr)\np+=1; plt.figure(p)\n_ = rm_masked.pcolor(StatArray(arr2), grid=True, transpose=True, flip=True)\n\n# Writing and reading to/from HDF5\n# ++++++++++++++++++++++++++++++++\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.toHdf(f, 'rm1d')\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(122)\n_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\n\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.createHdf(f, 'rm1d', add_axis=10)\n for i in range(10):\n rm.writeHdf(f, 'rm1d', index=i)\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)\nwith h5py.File('rm1d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(131)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(132)\n_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)\nplt.subplot(133)\n_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Log-space rectilinear mesh\nInstantiate a new 1D rectilinear mesh by specifying cell centres or edges.\nHere we use edges\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.logspace(-3, 3, 10), 'Depth', 'm')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm = RectilinearMesh1D(edges=x, log=10)\n\n# We can plot the grid of the mesh\n# Or Pcolor the mesh showing. An array of cell values is used as the colour.\np+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.plotGrid(transpose=True, flip=True)\nplt.subplot(122)\narr = StatArray(np.random.randn(rm.nCells), \"Name\", \"Units\")\n_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)\n\n# Writing and reading to/from HDF5\n# ++++++++++++++++++++++++++++++++\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.toHdf(f, 'rm1d')\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(122)\n_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\n\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.createHdf(f, 'rm1d', add_axis=10)\n for i in range(10):\n rm.writeHdf(f, 'rm1d', index=i)\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)\nwith h5py.File('rm1d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(131)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(132)\n_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)\nplt.subplot(133)\n_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## RelativeTo\nInstantiate a new 1D rectilinear mesh by specifying cell centres or edges.\nHere we use edges\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(11.0), 'Deviation', 'm')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm = RectilinearMesh1D(edges=x, relativeTo=5.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the grid of the mesh\nOr Pcolor the mesh showing. An array of cell values is used as the colour.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "p+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.plotGrid(transpose=True, flip=True)\nplt.subplot(122)\narr = StatArray(np.random.randn(rm.nCells), \"Name\", \"Units\")\n_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)\n\n# Writing and reading to/from HDF5\n# ++++++++++++++++++++++++++++++++\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.createHdf(f, 'rm1d')\n rm.writeHdf(f, 'rm1d')\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(122)\n_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\n\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.createHdf(f, 'rm1d', add_axis=3)\n for i in range(3):\n rm.relativeTo += 0.5\n rm.writeHdf(f, 'rm1d', index=i)\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)\nwith h5py.File('rm1d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(131)\n_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)\nplt.subplot(132)\n_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)\nplt.subplot(133)\n_ = rm2.pcolor(np.repeat(arr[None, :], 3, 0), grid=True, flipY=True)\n\n\n# Making a mesh perturbable\n# +++++++++++++++++++++++++\nn_cells = 2\nwidths = StatArray(np.full(n_cells, fill_value=10.0), 'test')\nrm = RectilinearMesh1D(widths=widths, relativeTo=0.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Randomness and Model Perturbations\nWe can set the priors on the 1D model by assigning minimum and maximum layer\ndepths and a maximum number of layers. These are used to create priors on\nthe number of cells in the model, a new depth interface, new parameter values\nand the vertical gradient of those parameters.\nThe halfSpaceValue is used as a reference value for the parameter prior.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from numpy.random import Generator\nfrom numpy.random import PCG64DXSM\ngenerator = PCG64DXSM(seed=0)\nprng = Generator(generator)\n\n# Set the priors\nrm.set_priors(min_edge = 1.0,\n max_edge = 150.0,\n max_cells = 30,\n prng = prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can evaluate the prior of the model using depths only\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print('Log probability of the Mesh given its priors: ', rm.probability)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To propose new meshes, we specify the probabilities of creating, removing, perturbing, and not changing\nan edge interface\nHere we force the creation of a layer.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm.set_proposals(probabilities = [0.25, 0.25, 0.25, 0.25], prng=prng)\nrm.set_posteriors()\n\nrm0 = deepcopy(rm)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then perturb the layers of the model\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i in range(1000):\n rm = rm.perturb()\n rm.update_posteriors()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "p+=1; fig = plt.figure(p)\nax = rm._init_posterior_plots(fig)\n\nrm.plot_posteriors(axes=ax)\n\nwith h5py.File('rm1d.h5', 'w') as f:\n rm.createHdf(f, 'rm1d', withPosterior = True)\n rm.writeHdf(f, 'rm1d', withPosterior = True)\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(121)\n_ = rm.pcolor(StatArray(rm.shape), grid=True, transpose=True, flip=True)\nplt.subplot(122)\n_ = rm1.pcolor(StatArray(rm1.shape), grid=True, transpose=True, flip=True)\n\np+=1; fig = plt.figure(p)\nax = rm1._init_posterior_plots(fig)\nrm1.plot_posteriors(axes=ax)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expanded\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with h5py.File('rm1d.h5', 'w') as f:\n tmp = rm.pad(rm.max_cells)\n tmp.createHdf(f, 'rm1d', withPosterior=True, add_axis=StatArray(np.arange(3.0), name='Easting', units=\"m\"))\n\n rm.relativeTo = 5.0\n rm.writeHdf(f, 'rm1d', withPosterior = True, index=0)\n\n rm = deepcopy(rm0)\n for i in range(1000):\n rm = rm.perturb(); rm.update_posteriors()\n rm.relativeTo = 10.0\n rm.writeHdf(f, 'rm1d', withPosterior = True, index=1)\n\n rm = deepcopy(rm0)\n for i in range(1000):\n rm = rm.perturb(); rm.update_posteriors()\n rm.relativeTo = 25.0\n rm.writeHdf(f, 'rm1d', withPosterior = True, index=2)\n\nwith h5py.File('rm1d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])\n\np+=1; plt.figure(p)\nplt.subplot(121)\narr = np.random.randn(3, rm.max_cells) * 10\n_ = rm0.pcolor(arr[0, :rm0.nCells.item()], grid=True, transpose=True, flip=True)\nplt.subplot(122)\n_ = rm2.pcolor(arr, grid=True, flipY=True, equalize=True)\n\nfrom geobipy import RectilinearMesh2D\nwith h5py.File('rm1d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['rm1d'], index=0)\n\nplt.figure()\nplt.subplot(121)\nrm2.plotGrid(transpose=True, flip=True)\nplt.subplot(122)\nrm2.edges.posterior.pcolor(transpose=True, flip=True)\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/29d06c7b2b9a8473c8472010e9733584/plot_inference_1d_skytem.py b/docs/_downloads/29d06c7b2b9a8473c8472010e9733584/plot_inference_1d_skytem.py new file mode 100644 index 00000000..65a10930 --- /dev/null +++ b/docs/_downloads/29d06c7b2b9a8473c8472010e9733584/plot_inference_1d_skytem.py @@ -0,0 +1,87 @@ +""" +Running GeoBIPy to invert Skytem data +------------------------------------- +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + +data_type = "Skytem_512" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +parameter_file = "../../supplementary/options_files/{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=2, **kwargs) \ No newline at end of file diff --git a/docs/_downloads/2b313676e6ab4e7fef5cb85211b43803/plot_model_3d.py b/docs/_downloads/2b313676e6ab4e7fef5cb85211b43803/plot_model_3d.py new file mode 100644 index 00000000..0d0aadaa --- /dev/null +++ b/docs/_downloads/2b313676e6ab4e7fef5cb85211b43803/plot_model_3d.py @@ -0,0 +1,171 @@ +""" +3D Rectilinear Model +-------------------- +This 3D rectilinear model defines a grid with straight cell boundaries. + +""" + +#%% +from geobipy import StatArray +from geobipy import RectilinearMesh3D +from geobipy import Model +import matplotlib.pyplot as plt +import numpy as np +import h5py + + +""" +3D Rectilinear Mesh +------------------- +This 3D rectilinear mesh defines a grid with straight cell boundaries. + +""" + +#%% +from geobipy import StatArray +from geobipy import RectilinearMesh3D +from geobipy import Model +import matplotlib.pyplot as plt +import numpy as np +import h5py + + +#%% +# Specify some cell centres in x and y +x = StatArray(np.arange(10.0), 'Easting', 'm') +y = StatArray(np.arange(15.0), 'Northing', 'm') +z = StatArray(np.arange(20.0), 'Depth', 'm') + +mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + +xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) +values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Height") +values = np.repeat(values[:, :, None], mesh.z.nCells, 2) + +model = Model(mesh=mesh, values=values) + +model1 = model[:5, :5, :5] +model2 = model[:, :, 5] +model3 = model[:, 5, :] +model4 = model[5, :, :] + +plt.figure() +plt.subplot(231) +model2.pcolor() +plt.subplot(232) +model3.pcolor() +plt.subplot(233) +model4.pcolor() + +#%% +model2 = model[:, 5, 5] +model3 = model[5, :, 5] +model4 = model[5, 5, :] + +plt.subplot(234) +model2.pcolor() +plt.subplot(235) +model3.pcolor() +plt.subplot(236) +model4.pcolor() + +#%% +with h5py.File('model3d.h5', 'w') as f: + model.createHdf(f, 'test') + model.writeHdf(f, 'test') + +with h5py.File('model3d.h5', 'r') as f: + model2 = Model.fromHdf(f['test']) + +model.pyvista_mesh().save('model3d.vtk') + + +xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) +z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") +mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re) +model = Model(mesh=mesh, values=values) + +model1 = model[:5, :5, :5] +model2 = model[:, :, 5] +model3 = model[:, 5, :] +model4 = model[5, :, :] + +plt.figure() +plt.subplot(231) +model2.pcolor() +plt.subplot(232) +model3.pcolor() +plt.subplot(233) +model4.pcolor() + +#%% +# We can plot the mesh in 3D! +pv = model.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +model.pyvista_mesh().save('model3d_re1.vtk') + + +x_re = StatArray(np.sin(np.repeat(mesh.y.centres[:, None], mesh.z.nCells, 1)), "x_re") +mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re) +model = Model(mesh=mesh, values=values) + +model1 = model[:5, :5, :5] +model2 = model[:, :, 5] +model3 = model[:, 5, :] +model4 = model[5, :, :] + +plt.figure() +plt.subplot(231) +model2.pcolor() +plt.subplot(232) +model3.pcolor() +plt.subplot(233) +model4.pcolor() + +#%% +# We can plot the mesh in 3D! +pv = model.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +model.pyvista_mesh().save('model3d_re2.vtk') + + +xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres) +y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + +mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) +model = Model(mesh=mesh, values=values) + +model1 = model[:5, :5, :5] +model2 = model[:, :, 5] +model3 = model[:, 5, :] +model4 = model[5, :, :] + +plt.figure() +plt.subplot(231) +model2.pcolor() +plt.subplot(232) +model3.pcolor() +plt.subplot(233) +model4.pcolor() + +#%% +# We can plot the mesh in 3D! +pv = model.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +model.pyvista_mesh().save('model3d_re3.vtk') + +# with h5py.File('mesh3d.h5', 'w') as f: +# mesh.toHdf(f, 'test') + +# with h5py.File('mesh3d.h5', 'r') as f: +# mesh2 = RectilinearMesh3D.fromHdf(f['test']) + +# mesh2.pyvista_mesh().save('mesh3d_read.vtk') + +plt.show() diff --git a/docs/_downloads/2dd62cc642303de6b0d2af1a789eccaa/plot_skytem_datapoint.py b/docs/_downloads/2dd62cc642303de6b0d2af1a789eccaa/plot_skytem_datapoint.py new file mode 100644 index 00000000..378c4f9f --- /dev/null +++ b/docs/_downloads/2dd62cc642303de6b0d2af1a789eccaa/plot_skytem_datapoint.py @@ -0,0 +1,240 @@ +""" +Skytem Datapoint Class +---------------------- +""" + +#%% +# Credits: +# We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +# https://github.com/GeoscienceAustralia/ga-aem +# +# For ground-based time domain data, we are using Dieter Werthmuller's python package Empymod +# https://empymod.github.io/ +# +# Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy + +#%% +from os.path import join +import numpy as np +import h5py +import matplotlib.pyplot as plt +from geobipy import Waveform +from geobipy import SquareLoop, CircularLoop +from geobipy import butterworth +from geobipy import TdemSystem +from geobipy import TdemData +from geobipy import TdemDataPoint +from geobipy import RectilinearMesh1D +from geobipy import Model +from geobipy import StatArray +from geobipy import Distribution + +dataFolder = "..//..//supplementary//data//" + +# Obtaining a datapoint from a dataset +# ++++++++++++++++++++++++++++++++++++ +# More often than not, our observed data is stored in a file on disk. +# We can read in a dataset and pull datapoints from it. +# +# For more information about the time domain data set, see :ref:`Time domain dataset` + +# The data file name +dataFile=dataFolder + 'skytem_512_saline_clay.csv' +# The EM system file name +systemFile=[dataFolder + 'SkytemHM_512.stm', dataFolder + 'SkytemLM_512.stm'] + +#%% +# Initialize and read an EM data set +# Prepare the dataset so that we can read a point at a time. +Dataset = TdemData._initialize_sequential_reading(dataFile, systemFile) +# Get a datapoint from the file. +tdp = Dataset._read_record() + +Dataset._file.close() + +#%% +# Using a time domain datapoint +# +++++++++++++++++++++++++++++ + +#%% +# We can define a 1D layered earth model, and use it to predict some data +par = StatArray(np.r_[500.0, 20.0], "Conductivity", "$\frac{S}{m}$") +mod = Model(RectilinearMesh1D(edges=np.r_[0, 75.0, np.inf]), values=par) + +#%% +# Forward model the data +tdp.forward(mod) + +#%% +plt.figure() +plt.subplot(121) +_ = mod.pcolor() +plt.subplot(122) +_ = tdp.plot() +_ = tdp.plot_predicted() +plt.tight_layout() + +#%% +plt.figure() +tdp.plotDataResidual(yscale='log', xscale='log') +plt.title('new') + +#%% +# Compute the sensitivity matrix for a given model +J = tdp.sensitivity(mod) +plt.figure() +_ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + +#%% +# Attaching statistical descriptors to the skytem datapoint +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +# Set values of relative and additive error for both systems. +tdp.relative_error = np.r_[0.05, 0.05] +tdp.additive_error = np.r_[1e-14, 1e-13] +# Define a multivariate log normal distribution as the prior on the predicted data. +tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng) + +#%% +# This allows us to evaluate the likelihood of the predicted data +print(tdp.likelihood(log=True)) +# Or the misfit +print(tdp.data_misfit()) + +#%% +# Plot the misfits for a range of half space conductivities +plt.figure() +_ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200) +plt.title("Halfspace responses") + +#%% +# We can perform a quick search for the best fitting half space +halfspace = tdp.find_best_halfspace() + +print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) +plt.figure() +_ = tdp.plot() +_ = tdp.plot_predicted() + +#%% +# Compute the misfit between observed and predicted data +print(tdp.data_misfit()) + +#%% +# We can attach priors to the height of the datapoint, +# the relative error multiplier, and the additive error noise floor + +# Define the distributions used as priors. +z_prior = Distribution('Uniform', min=np.float64(tdp.z) - 2.0, max=np.float64(tdp.z) + 2.0, prng=prng) +relativePrior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng) +additivePrior = Distribution('Uniform', min=np.r_[1e-16, 1e-16], max=np.r_[1e-10, 1e-10], log=True, prng=prng) +tdp.set_priors(relative_error_prior=relativePrior, additive_error_prior=additivePrior, z_prior=z_prior, prng=prng) + +#%% +# In order to perturb our solvable parameters, we need to attach proposal distributions +z_proposal = Distribution('Normal', mean=tdp.z, variance = 0.01, prng=prng) +relativeProposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-7, prng=prng) +additiveProposal = Distribution('MvLogNormal', mean=tdp.additive_error, variance=2.5e-3, linearSpace=True, prng=prng) +tdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal, prng=prng) + +#%% +# With priorss set we can auto generate the posteriors +tdp.set_posteriors() + +#%% +# Perturb the datapoint and record the perturbations +# Note we are not using the priors to accept or reject perturbations. +for i in range(10): + tdp.perturb() + tdp.update_posteriors() + + +#%% +# Plot the posterior distributions +tdp.plot_posteriors(overlay=tdp) + +plt.show() + +#%% +# File Format for a time domain datapoint +# +++++++++++++++++++++++++++++++++++++++ +# Here we describe the file format for a time domain datapoint. +# +# For individual datapoints we are using the AarhusInv data format. +# +# Here we take the description for the AarhusInv TEM data file, modified to reflect what we can +# currently handle in GeoBIPy. +# +# Line 1 :: string +# User-defined label describing the TEM datapoint. +# This line must contain the following, separated by semicolons. +# XUTM= +# YUTM= +# Elevation= +# StationNumber= +# LineNumber= +# Current= +# +# Line 2 :: first integer, sourceType +# 7 = Rectangular loop source parallel to the x - y plane +# Line 2 :: second integer, polarization +# 3 = Vertical magnetic field +# +# Line 3 :: 6 floats, transmitter and receiver offsets relative to X/Y UTM location. +# If sourceType = 7, Position of the center loop sounding. +# +# Line 4 :: Transmitter loop dimensions +# If sourceType = 7, 2 floats. Loop side length in the x and y directions +# +# Line 5 :: Fixed +# 3 3 3 +# +# Line 6 :: first integer, transmitter waveform type. Fixed +# 3 = User defined waveform. +# +# Line 6 :: second integer, number of transmitter waveforms. Fixed +# 1 +# +# Line 7 :: transmitter waveform definition +# A user-defined waveform with piecewise linear segments. +# A full transmitter waveform definition consists of a number of linear segments +# This line contains an integer as the first entry, which specifies the number of +# segments, followed by each segment with 4 floats each. The 4 floats per segment +# are the start and end times, and start and end amplitudes of the waveform. e.g. +# 3 -8.333e-03 -8.033e-03 0.0 1.0 -8.033e-03 0.0 1.0 1.0 0.0 5.4e-06 1.0 0.0 +# +# Line 8 :: On time information. Not used but needs specifying. +# 1 1 1 +# +# Line 9 :: On time low-pass filters. Not used but need specifying. +# 0 +# +# Line 10 :: On time high-pass filters. Not used but need specifying. +# 0 +# +# Line 11 :: Front-gate time. Not used but need specifying. +# 0.0 +# +# Line 12 :: first integer, Number of off time filters +# Number of filters +# +# Line 12 :: second integer, Order of the butterworth filter +# 1 or 2 +# +# Line 12 :: cutoff frequencies Hz, one per the number of filters +# e.g. 4.5e5 +# +# Line 13 :: Off time high pass filters. +# See Line 12 +# +# Lines after 13 contain 3 columns that pertain to +# Measurement Time, Data Value, Estimated Standard Deviation +# +# Example data files are contained in +# `the supplementary folder`_ in this repository +# +# .. _the supplementary folder: https://github.com/usgs/geobipy/tree/master/documentation_source/source/examples/supplementary/Data \ No newline at end of file diff --git a/docs/_downloads/36c869e825ae3b16a184379512e44203/plot_model_2d.ipynb b/docs/_downloads/36c869e825ae3b16a184379512e44203/plot_model_2d.ipynb new file mode 100644 index 00000000..be0c8c91 --- /dev/null +++ b/docs/_downloads/36c869e825ae3b16a184379512e44203/plot_model_2d.ipynb @@ -0,0 +1,72 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 2D Rectilinear Model\nThis 2D rectilinear model defines a grid with straight cell boundaries.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import StatArray\nfrom geobipy import RectilinearMesh2D\nfrom geobipy import Model\nimport h5py\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Specify some cell centres in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(11.0), 'Easting', 'm')\ny = StatArray(np.arange(11.0), 'Northing', 'm')\nmesh = RectilinearMesh2D(x_edges=x, y_edges=y)\n\nxx, yy = np.meshgrid(mesh.x.centres, mesh.y.centres)\nvalues = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"Values\")\n\nmod = Model(mesh=mesh, values = values)\n\nplt.figure()\nmod.pcolor()\n\nmod2 = mod.resample(0.5, 0.5)\nmod3 = mod.resample(1.5, 1.5)\nplt.figure()\nplt.subplot(121)\nmod2.pcolor()\nplt.axis('equal')\nplt.subplot(122)\nmod3.pcolor()\nplt.axis('equal')\n\n\n# #%%\n# # We can plot the mesh in 3D!\n# pv = rm.pyvista_plotter()\n# pv.show()\n\n# rm.to_vtk('Model3D.vtk')\n\nwith h5py.File('Model2D.h5', 'w') as f:\n mod.toHdf(f, 'model')\n\nwith h5py.File('Model2D.h5', 'r') as f:\n mod2 = Model.fromHdf(f['model'])\n\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/36d592b131669bd825431209f21f3531/plot_histogram_2d.ipynb b/docs/_downloads/36d592b131669bd825431209f21f3531/plot_histogram_2d.ipynb new file mode 100644 index 00000000..35b892bd --- /dev/null +++ b/docs/_downloads/36d592b131669bd825431209f21f3531/plot_histogram_2d.ipynb @@ -0,0 +1,458 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Histogram 2D\n\nThis 2D histogram class allows efficient updating of histograms, plotting and\nsaving as HDF5.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import h5py\nimport geobipy\nfrom geobipy import StatArray\nfrom geobipy import Histogram\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom geobipy import RectilinearMesh2D\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create some histogram bins in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.linspace(-4.0, 4.0, 100), 'Variable 1')\ny = StatArray(np.linspace(-4.0, 4.0, 105), 'Variable 2')\n\nmesh = RectilinearMesh2D(x_edges=x, y_edges=y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate some random numbers\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = np.random.randn(1000000)\nb = np.random.randn(1000000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Update the histogram counts\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(a, b)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(131)\nplt.title(\"2D Histogram\")\n_ = H.plot(cmap='gray_r')\nplt.subplot(132)\nH.pdf.plot(cmap='gray_r')\nplt.subplot(133)\nH.pmf.plot(cmap='gray_r')\n\n\nplt.figure()\nplt.subplot(131)\nH.cdf(axis=0).plot()\nplt.subplot(132)\nH.cdf(axis=1).plot()\nplt.subplot(133)\nH.cdf().plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can overlay the histogram with its credible intervals\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.title(\"90% credible intervals overlain\")\nH.pcolor(cmap='gray_r')\nH.plotCredibleIntervals(axis=0, percent=95.0)\n_ = H.plotCredibleIntervals(axis=1, percent=95.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate marginal histograms along an axis\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "h1 = H.marginalize(axis=0)\nh2 = H.marginalize(axis=1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the names of the variables are automatically displayed\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Marginals along each axis\")\nplt.subplot(121)\nh1.plot()\nplt.subplot(122)\n_ = h2.plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create a combination plot with marginal histograms.\nsphinx_gallery_thumbnail_number = 3\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\ngs = gridspec.GridSpec(5, 5)\ngs.update(wspace=0.3, hspace=0.3)\nax = [plt.subplot(gs[1:, :4])]\nH.pcolor(colorbar = False)\n\nax.append(plt.subplot(gs[:1, :4]))\nh = H.marginalize(axis=0).plot()\nplt.xlabel(''); plt.ylabel('')\nplt.xticks([]); plt.yticks([])\nax[-1].spines[\"left\"].set_visible(False)\n\nax.append(plt.subplot(gs[1:, 4:]))\nh = H.marginalize(axis=1).plot(transpose=True)\nplt.ylabel(''); plt.xlabel('')\nplt.yticks([]); plt.xticks([])\nax[-1].spines[\"bottom\"].set_visible(False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the mean or median estimates from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mean = H.mean()\nmedian = H.median()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(9.5, 5))\nplt.suptitle(\"Mean, median, and credible interval overlain\")\nax = plt.subplot(121)\nH.pcolor(cmap='gray_r', colorbar=False)\nH.plotCredibleIntervals(axis=0)\nH.plotMedian(axis=0, color='g')\nH.plotMean(axis=0, color='y')\nplt.legend()\n\nplt.subplot(122, sharex=ax, sharey=ax)\nH.pcolor(cmap='gray_r', colorbar=False)\nH.plotCredibleIntervals(axis=1)\nH.plotMedian(axis=1, color='g')\nH.plotMean(axis=1, color='y')\nplt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Get the range between credible intervals\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.credible_range(percent=95.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can map the credible range to an opacity or transparency\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.opacity()\nH.transparency()\n\n# H.animate(0, 'test.mp4')\n\nimport h5py\nwith h5py.File('h2d.h5', 'w') as f:\n H.toHdf(f, 'h2d')\n\nwith h5py.File('h2d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h2d'])\n\nplt.close('all')\n\nx = StatArray(5.0 + np.linspace(-4.0, 4.0, 100), 'Variable 1')\ny = StatArray(10.0 + np.linspace(-4.0, 4.0, 105), 'Variable 2')\n\nmesh = RectilinearMesh2D(x_edges=x, x_relative_to=5.0, y_edges=y, y_relative_to=10.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate some random numbers\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = np.random.randn(1000000) + 5.0\nb = np.random.randn(1000000) + 10.0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Update the histogram counts\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(a, b)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(131)\nplt.title(\"2D Histogram\")\n_ = H.plot(cmap='gray_r')\nplt.subplot(132)\nH.pdf.plot(cmap='gray_r')\nplt.subplot(133)\nH.pmf.plot(cmap='gray_r')\n\nplt.figure()\nplt.subplot(131)\nH.cdf(axis=0).plot()\nplt.subplot(132)\nH.cdf(axis=1).plot()\nplt.subplot(133)\nH.cdf().plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can overlay the histogram with its credible intervals\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.title(\"90% credible intervals overlain\")\nH.pcolor(cmap='gray_r')\nH.plotCredibleIntervals(axis=0, percent=95.0)\n_ = H.plotCredibleIntervals(axis=1, percent=95.0)\n\n# Generate marginal histograms along an axis\nh1 = H.marginalize(axis=0)\nh2 = H.marginalize(axis=1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the names of the variables are automatically displayed\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Marginals along each axis\")\nplt.subplot(121)\nh1.plot()\nplt.subplot(122)\n_ = h2.plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create a combination plot with marginal histograms.\nsphinx_gallery_thumbnail_number = 3\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\ngs = gridspec.GridSpec(5, 5)\ngs.update(wspace=0.3, hspace=0.3)\nax = [plt.subplot(gs[1:, :4])]\nH.pcolor(colorbar = False)\n\nax.append(plt.subplot(gs[:1, :4]))\nh = H.marginalize(axis=0).plot()\nplt.xlabel(''); plt.ylabel('')\nplt.xticks([]); plt.yticks([])\nax[-1].spines[\"left\"].set_visible(False)\n\nax.append(plt.subplot(gs[1:, 4:]))\nh = H.marginalize(axis=1).plot(transpose=True)\nplt.ylabel(''); plt.xlabel('')\nplt.yticks([]); plt.xticks([])\nax[-1].spines[\"bottom\"].set_visible(False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the mean or median estimates from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mean = H.mean()\nmedian = H.median()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure(figsize=(9.5, 5))\nplt.suptitle(\"Mean, median, and credible interval overlain\")\nax = plt.subplot(121)\nH.pcolor(cmap='gray_r', colorbar=False)\nH.plotCredibleIntervals(axis=0)\nH.plotMedian(axis=0, color='g')\nH.plotMean(axis=0, color='y')\nplt.legend()\n\nplt.subplot(122, sharex=ax, sharey=ax)\nH.pcolor(cmap='gray_r', colorbar=False)\nH.plotCredibleIntervals(axis=1)\nH.plotMedian(axis=1, color='g')\nH.plotMean(axis=1, color='y')\nplt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Get the range between credible intervals\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.credible_range(percent=95.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can map the credible range to an opacity or transparency\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.opacity()\nH.transparency()\n\n# # H.animate(0, 'test.mp4')\n\nwith h5py.File('h2d.h5', 'w') as f:\n H.toHdf(f, 'h2d')\n\nwith h5py.File('h2d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h2d'])\n\nplt.figure(figsize=(9.5, 5))\nplt.suptitle(\"Mean, median, and credible interval overlain\")\nax = plt.subplot(121)\nH1.pcolor(cmap='gray_r', colorbar=False)\nH1.plotCredibleIntervals(axis=0)\nH1.plotMedian(axis=0, color='g')\nH1.plotMean(axis=0, color='y')\nplt.legend()\n\nplt.subplot(122, sharex=ax, sharey=ax)\nH1.pcolor(cmap='gray_r', colorbar=False)\nH1.plotCredibleIntervals(axis=1)\nH1.plotMedian(axis=1, color='g')\nH1.plotMean(axis=1, color='y')\nplt.legend()\n\nwith h5py.File('h2d.h5', 'w') as f:\n H.createHdf(f, 'h2d', add_axis=StatArray(np.arange(3.0), name='Easting', units=\"m\"))\n for i in range(3):\n H.writeHdf(f, 'h2d', index=i)\n\nwith h5py.File('h2d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h2d'], index=0)\n\nplt.figure(figsize=(9.5, 5))\nplt.suptitle(\"Mean, median, and credible interval overlain\")\nax = plt.subplot(121)\nH1.pcolor(cmap='gray_r', colorbar=False)\nH1.plotCredibleIntervals(axis=0)\nH1.plotMedian(axis=0, color='g')\nH1.plotMean(axis=0, color='y')\nplt.legend()\n\nplt.subplot(122, sharex=ax, sharey=ax)\nH1.pcolor(cmap='gray_r', colorbar=False)\nH1.plotCredibleIntervals(axis=1)\nH1.plotMedian(axis=1, color='g')\nH1.plotMean(axis=1, color='y')\nplt.legend()\n\nwith h5py.File('h2d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h2d'])\n\nH1.pyvista_mesh().save('h3d_read.vtk')\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/3bf606a1e1bcade69bb1094393e978cd/plot_histogram_3d.py b/docs/_downloads/3bf606a1e1bcade69bb1094393e978cd/plot_histogram_3d.py new file mode 100644 index 00000000..027a16e4 --- /dev/null +++ b/docs/_downloads/3bf606a1e1bcade69bb1094393e978cd/plot_histogram_3d.py @@ -0,0 +1,157 @@ +""" +Histogram 3D +------------ + +This 3D histogram class allows efficient updating of histograms, plotting and +saving as HDF5. + +""" + +#%% +import geobipy +from geobipy import StatArray +from geobipy import Histogram +import matplotlib.pyplot as plt +from geobipy import RectilinearMesh3D +import numpy as np + + +#%% +# Create some histogram bins in x and y +x = StatArray(np.linspace(-4.0, 4.0, 11), 'Variable 1') +y = StatArray(np.linspace(-4.0, 4.0, 21), 'Variable 2') +z = StatArray(np.linspace(-4.0, 4.0, 31), 'Variable 3') + +mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + +#%% +# Instantiate +H = Histogram(mesh=mesh) + +#%% +# Generate some random numbers +a = np.random.randn(100000) +b = np.random.randn(100000) +c = np.random.randn(100000) +# x = np.asarray([a, b, c]) + + +#%% +# Update the histogram counts +H.update(a, b, c) + +#%% +plt.figure() +plt.suptitle("Slice half way along each dimension") +for axis in range(3): + plt.subplot(1, 3, axis+1) + s = [5 if i == axis else np.s_[:] for i in range(3)] + _ = H[tuple(s)].pcolor(cmap='gray_r') + +#%% +# Generate marginal histograms along an axis +plt.figure() +plt.suptitle("Marginals along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.marginalize(axis=axis).plot() + + +#%% +# Take the mean estimate from the histogram +plt.figure() +plt.suptitle("Mean along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.mean(axis=axis).pcolor() + +#%% +# Take the median estimate from the histogram +plt.figure() +plt.suptitle("Median along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.median(axis=axis).pcolor() + +# #%% +# # We can map the credible range to an opacity or transparency +# H.opacity() +# H.transparency() + +H.animate(0, 'test.mp4') + +H.to_vtk('h3d.vtk') + + + + +# Create some histogram bins in x and y +xx, yy = np.meshgrid(mesh.z.centres, mesh.y.centres) +x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re") + +xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres) +y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + +xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) +z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + +mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) + +#%% +# Instantiate +H = Histogram(mesh=mesh) + +#%% +# Generate some random numbers +a = np.random.randn(100000) +b = np.random.randn(100000) +c = np.random.randn(100000) +# x = np.asarray([a, b, c]) + +#%% +# Update the histogram counts +H.update(a, b, c) + +#%% +plt.figure() +plt.suptitle("Slice half way along each dimension") +for axis in range(3): + plt.subplot(1, 3, axis+1) + s = [5 if i == axis else np.s_[:] for i in range(3)] + _ = H[tuple(s)].pcolor(cmap='gray_r') + +#%% +# Generate marginal histograms along an axis +plt.figure() +plt.suptitle("Marginals along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.marginalize(axis=axis).plot() + + +#%% +# Take the mean estimate from the histogram +plt.figure() +plt.suptitle("Mean along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.mean(axis=axis).pcolor() + +#%% +# Take the median estimate from the histogram +plt.figure() +plt.suptitle("Median along each axis") +for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.median(axis=axis).pcolor() + +# #%% +# # We can map the credible range to an opacity or transparency +# H.opacity() +# H.transparency() + +H.animate(0, 'test.mp4') + +plt.show() + +H.to_vtk('h3d.vtk') diff --git a/docs/_downloads/439c06574d36795305525eb492c7861b/plot_tempest_datapoint.py b/docs/_downloads/439c06574d36795305525eb492c7861b/plot_tempest_datapoint.py new file mode 100644 index 00000000..023d7ac5 --- /dev/null +++ b/docs/_downloads/439c06574d36795305525eb492c7861b/plot_tempest_datapoint.py @@ -0,0 +1,184 @@ +""" +Tempest Datapoint Class +----------------------- +""" + +#%% +# Credits: +# We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +# https://github.com/GeoscienceAustralia/ga-aem +# +# For ground-based time domain data, we are using Dieter Werthmuller's python package Empymod +# https://empymod.github.io/ +# +# Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy + +#%% +from os.path import join +import numpy as np +import h5py +import matplotlib.pyplot as plt +from geobipy import TempestData +# from geobipy import TemDataPoint +from geobipy import RectilinearMesh1D +from geobipy import Model +from geobipy import StatArray +from geobipy import Distribution +from geobipy import get_prng + +dataFolder = "..//..//supplementary//data//" +# dataFolder = "source//examples//supplementary//Data" + +# Obtaining a tempest datapoint from a dataset +# ++++++++++++++++++++++++++++++++++++++++++++ +# More often than not, our observed data is stored in a file on disk. +# We can read in a dataset and pull datapoints from it. +# +# For more information about the time domain data set, see :ref:`Time domain dataset` + +# The data file name +dataFile = dataFolder + 'tempest_saline_clay.csv' +# The EM system file name +systemFile = dataFolder + 'Tempest.stm' + +# Prepare the dataset so that we can read a point at a time. +Dataset = TempestData._initialize_sequential_reading(dataFile, systemFile) +# Get a datapoint from the file. +tdp = Dataset._read_record(0) + +plt.figure() +tdp.plot() + +prng = get_prng(seed=146100583096709124601953385843316024947) + +#%% +# Using a tempest domain datapoint +# ++++++++++++++++++++++++++++++++ + +#%% +# We can define a 1D layered earth model, and use it to predict some data +par = StatArray(np.r_[0.01, 0.1, 1.], "Conductivity", "$\frac{S}{m}$") +mod = Model(mesh=RectilinearMesh1D(edges=np.r_[0.0, 50.0, 75.0, np.inf]), values=par) + +par = StatArray(np.logspace(-3, 3, 30), "Conductivity", "$\frac{S}{m}$") +e = np.linspace(0, 350, 31); e[-1] = np.inf +mod = Model(mesh=RectilinearMesh1D(edges=e), values=par) + +#%% +# Forward model the data +tdp.forward(mod) + +print('primary', tdp.primary_field) +print('sx', tdp.secondary_field[:15]) +print('sz', tdp.secondary_field[15:]) + +# #%% +# plt.figure() +# plt.subplot(121) +# _ = mod.pcolor(transpose=True) +# plt.subplot(122) +# _ = tdp.plot() +# _ = tdp.plot_predicted() +# plt.tight_layout() +# plt.suptitle('Model and response') + +# #%% +# # plt.figure() +# # tdp.plotDataResidual(xscale='log') +# # plt.title('data residual') + +# #%% +# # Compute the sensitivity matrix for a given model +J = tdp.sensitivity(mod) +# plt.figure() +# _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + +print('J', J) +# print('J shape', J.shape) +# print('sx 0', J[:16, 0]) + +tdp.fm_dlogc(mod) + +print('new primary', tdp.primary_field) +print('sx', tdp.secondary_field[:15]) +print('sz', tdp.secondary_field[15:]) + +print('new J', tdp.sensitivity_matrix) + +#%% +# Attaching statistical descriptors to the tempest datapoint +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +# Set relative errors for the primary fields, and secondary fields. +tdp.relative_error = np.r_[0.001, 0.001] + +# Set the additive errors for +tdp.additive_error = np.hstack([[0.011474, 0.012810, 0.008507, 0.005154, 0.004742, 0.004477, 0.004168, 0.003539, 0.003352, 0.003213, 0.003161, 0.003122, 0.002587, 0.002038, 0.002201], + [0.007383, 0.005693, 0.005178, 0.003659, 0.003426, 0.003046, 0.003095, 0.003247, 0.002775, 0.002627, 0.002460, 0.002178, 0.001754, 0.001405, 0.001283]]) +# Define a multivariate log normal distribution as the prior on the predicted data. +tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng) + +#%% +# This allows us to evaluate the likelihood of the predicted data +print(tdp.likelihood(log=True)) +# Or the misfit +print(tdp.data_misfit()) + +#%% +# Plot the misfits for a range of half space conductivities +plt.figure() +plt.subplot(1, 2, 1) +_ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200) +plt.title("Halfspace responses") + +#%% +# We can perform a quick search for the best fitting half space +halfspace = tdp.find_best_halfspace() +print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) +plt.subplot(1, 2, 2) +_ = tdp.plot() +_ = tdp.plot_predicted() + +plt.figure() +tdp.plot_secondary_field() +tdp.plot_predicted_secondary_field() + +# #%% +# # We can attach priors to the height of the datapoint, +# # the relative error multiplier, and the additive error noise floor + +# Define the distributions used as priors. +relative_prior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng) +receiver_x_prior = Distribution('Uniform', min=np.float64(tdp.receiver.x) - 1.0, max=np.float64(tdp.receiver.x) + 1.0, prng=prng) +receiver_z_prior = Distribution('Uniform', min=np.float64(tdp.receiver.z) - 1.0, max=np.float64(tdp.receiver.z) + 1.0, prng=prng) +receiver_pitch_prior = Distribution('Uniform', min=tdp.receiver.pitch - 5.0, max=tdp.receiver.pitch + 5.0, prng=prng) +tdp.set_priors(relative_error_prior=relative_prior, receiver_x_prior=receiver_x_prior, receiver_z_prior=receiver_z_prior, receiver_pitch_prior=receiver_pitch_prior, prng=prng) + +#%% +# In order to perturb our solvable parameters, we need to attach proposal distributions +relative_proposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-4, prng=prng) +receiver_x_proposal = Distribution('Normal', mean=tdp.receiver.x, variance = 0.01, prng=prng) +receiver_z_proposal = Distribution('Normal', mean=tdp.receiver.z, variance = 0.01, prng=prng) +receiver_pitch_proposal = Distribution('Normal', mean=tdp.receiver.pitch, variance = 0.01, prng=prng) +tdp.set_proposals(relative_error_proposal=relative_proposal, + receiver_x_proposal=receiver_x_proposal, + receiver_z_proposal=receiver_z_proposal, + receiver_pitch_proposal=receiver_pitch_proposal, + solve_additive_error=True, additive_error_proposal_variance=1e-4, prng=prng) + +#%% +# With priors set we can auto generate the posteriors +tdp.set_posteriors() + +#%% +# Perturb the datapoint and record the perturbations +# Note we are not using the priors to accept or reject perturbations. +for i in range(10): + tdp.perturb() + tdp.update_posteriors() + +plt.show() \ No newline at end of file diff --git a/docs/_downloads/464247fcfe95c715a98148433d5ae85a/inference_2d_plotting.py b/docs/_downloads/464247fcfe95c715a98148433d5ae85a/inference_2d_plotting.py new file mode 100644 index 00000000..c1ec5b74 --- /dev/null +++ b/docs/_downloads/464247fcfe95c715a98148433d5ae85a/inference_2d_plotting.py @@ -0,0 +1,154 @@ +""" +2D Posterior analysis of the Bayesian inference +----------------------------------------------- + +All plotting in GeoBIPy can be carried out using the 3D inference class + +""" +import argparse +import matplotlib.pyplot as plt +import numpy as np +from geobipy import Inference2D +from create_model import create_model + +#%% +def create_plots(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 4)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(3, 4) + ax1 = fig.add_subplot(gs0[0, 0]) + true_model = create_model(model_type) + + if data_type == 'resolve': + true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1 + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + true_model.pcolor(**kwargs) + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + if data_type == 'resolve': + plt.ylim([-240, 60]) + else: + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[1, 0]) + results_2d.plot_mean_model(**kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[2, 0]) + results_2d.plot_mode_model(use_variance=False, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # # We can also choose to keep parameters above the DOI opaque. + # results_2d.compute_doi() + # plt.subplot(313) + # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # results_2d.plot_data_elevation(linewidth=0.3); + # results_2d.plot_elevation(linewidth=0.3); + + #%% + # We can plot the parameter values that produced the highest posterior + ax = fig.add_subplot(gs0[0, 1]) + results_2d.plot_k_layers() + + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax) + results_2d.plot_best_model(**kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[0, 2]) + plt.title('5%') + results_2d.plot_percentile(percent=0.05, **kwargs) + ax1 = fig.add_subplot(gs0[1, 2]) + plt.title('50%') + results_2d.plot_percentile(percent=0.5, **kwargs) + ax1 = fig.add_subplot(gs0[2, 2]) + plt.title('95%') + results_2d.plot_percentile(percent=0.95, **kwargs) + + + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[0, 3]) + results_2d.plot_confidence(); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[1, 3]) + plt.title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 3]) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # plt.show(block=True) + plt.savefig('{}_{}_{}.png'.format(folder, data_type, model_type), dpi=300) + + +if __name__ == '__main__': + + Parser = argparse.ArgumentParser(description="Plotting 2D inferences", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--data_type', dest='data_type', default=None, help='Skip the creation of the HDF5 files. Only do this if you know they have been created.') + Parser.add_argument('--model_type', dest='model_type', default=None, help='Specify a numpy seed file to fix the random number generator. Only used in serial mode.') + + args = Parser.parse_args() + + data_types = ['skytem_512', 'resolve', 'tempest'] if args.data_type is None else args.data_type + model_types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] if args.model_type is None else args.model_type + + if not isinstance(data_types, list): data_types = [data_types] + if not isinstance(model_types, list): model_types = [model_types] + + for data in data_types: + print(data) + for model in model_types: + print(' ',model) + create_plots("no_reverse_jump", data, model) diff --git a/docs/_downloads/48c7722b252e7ddf33d95322115dcaf5/plot_rectilinear_mesh_2d.py b/docs/_downloads/48c7722b252e7ddf33d95322115dcaf5/plot_rectilinear_mesh_2d.py new file mode 100644 index 00000000..6f5e9304 --- /dev/null +++ b/docs/_downloads/48c7722b252e7ddf33d95322115dcaf5/plot_rectilinear_mesh_2d.py @@ -0,0 +1,219 @@ +""" +2D Rectilinear Mesh +------------------- +This 2D rectilinear mesh defines a grid with straight cell boundaries. + +It can be instantiated in two ways. + +The first is by providing the cell centres or +cell edges in two dimensions. + +The second embeds the 2D mesh in 3D by providing the cell centres or edges in three dimensions. +The first two dimensions specify the mesh coordinates in the horiztontal cartesian plane +while the third discretizes in depth. This allows us to characterize a mesh whose horizontal coordinates +do not follow a line that is parallel to either the "x" or "y" axis. + +""" + +#%% +import h5py +from geobipy import StatArray +from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh3D +import matplotlib.pyplot as plt +import numpy as np + + +#%% +# Specify some cell centres in x and y +x = StatArray(np.arange(10.0), 'Easting', 'm') +y = StatArray(np.arange(20.0), 'Depth', 'm') +rm = RectilinearMesh2D(x_centres=x, y_centres=y) + +#%% +# We can plot the grid lines of the mesh. +p=0; +plt.figure(p) +_ = rm.plotGrid(flipY=True, linewidth=0.5) + +# Intersecting multisegment lines with a mesh +arr = np.zeros(rm.shape) +i = rm.line_indices([0.0, 3.0, 6.0, 9], [2.0, 6.0, 0.0, 10]) +arr[i[:, 0], i[:, 1]] = 1 +p += 1; plt.figure(p) +rm.pcolor(values = arr) + +#%% +# We can pcolor the mesh by providing cell values. +xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) +arr = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values") + +p += 1; plt.figure(p) +_ = rm.pcolor(arr, grid=True, flipY=True, linewidth=0.5) + +# xG = rm.xGradientMatrix() +# zG = rm.yGradientMatrix() + +# dax = StatArray((xG * arr.flatten()).reshape((arr.shape[0], arr.shape[1]-1))) +# rm2 = rm[:, :9] + +# plt.figure() +# rm2.pcolor(dax, xAxis='r', grid=True, flipY=True, linewidth=0.5) + +# dax = StatArray((zG * arr.flatten()).reshape((arr.shape[0]-1, arr.shape[1]))) + +# plt.figure() +# dax.pcolor(grid=True, flipY=True, linewidth=0.5) + +#%% +# Mask the x axis cells by a distance +rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, values=arr) +p += 1; plt.figure(p) +_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + +#%% +# Mask the z axis cells by a distance +rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(y_distance=0.2, values=arr) +p += 1; plt.figure(p) +_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + +#%% +# Mask axes by a distance +rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, y_distance=0.2, values=arr) +p += 1; plt.figure(p) +_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + +x = StatArray(np.arange(10.0), 'Easting', 'm') +y = StatArray(np.cumsum(np.arange(15.0)), 'Depth', 'm') +rm = RectilinearMesh2D(x_centres=x, y_centres=y) + +#%% +# We can perform some interval statistics on the cell values of the mesh +# Generate some values +a = np.repeat(np.arange(1.0, np.float64(rm.x.nCells+1))[:, np.newaxis], rm.y.nCells, 1) + +#%% +# Compute the mean over an interval for the mesh. +rm.intervalStatistic(a, intervals=[6.8, 12.4], axis=0, statistic='mean') + +#%% +# Compute the mean over multiple intervals for the mesh. +rm.intervalStatistic(a, intervals=[6.8, 12.4, 20.0, 40.0], axis=0, statistic='mean') + +#%% +# We can specify either axis +rm.intervalStatistic(a, intervals=[2.8, 4.2], axis=1, statistic='mean') + +#%% +rm.intervalStatistic(a, intervals=[2.8, 4.2, 5.1, 8.4], axis=1, statistic='mean') + +#%% +# Slice the 2D mesh to retrieve either a 2D mesh or 1D mesh +rm2 = rm[:5, :5] +rm3 = rm[:5, 5] +rm4 = rm[5, :5] + +p += 1; plt.figure(p) +plt.subplot(131) +rm2.plotGrid() +plt.subplot(132) +rm3.plotGrid() +plt.subplot(133) +rm4.plotGrid(transpose=True) + +#%% +# Resample a grid +values = StatArray(np.random.randn(*rm.shape)) +rm2, values2 = rm.resample(0.5, 0.5, values) + +p += 1; plt.figure(p) +plt.subplot(121) +rm.pcolor(values) +plt.subplot(122) +rm2.pcolor(values2) + +#%% +# Axes in log space +# +++++++++++++++++ +x = StatArray(np.logspace(-1, 4, 10), 'x') +y = StatArray(np.logspace(0, 3, 10), 'y') +rm = RectilinearMesh2D(x_edges=x, x_log=10, y_edges=y, y_log=10) + +# We can plot the grid lines of the mesh. +p += 1; plt.figure(p) +_ = rm.plotGrid(linewidth=0.5) + +#%% +with h5py.File('rm2d.h5', 'w') as f: + rm.toHdf(f, 'test') + +with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test']) + +arr = np.random.randn(*rm.shape) +p += 1; plt.figure(p) +plt.subplot(211) +rm.pcolor(arr) +plt.subplot(212) +rm2.pcolor(arr) + +#%% +# RelativeTo +# ++++++++++ +x = StatArray(np.arange(10.0), 'Northing', 'm') +y = StatArray(np.arange(20.0), 'Depth', 'm') + +rm = RectilinearMesh2D(x_centres=x, y_centres=y) + +p += 1; plt.figure(p) +plt.subplot(121) +_ = rm.plotGrid(linewidth=0.5, flipY=True) +rm = RectilinearMesh2D(x_centres=x, x_relative_to=0.2*np.random.randn(y.size), y_centres=y, y_relative_to=0.2*np.random.randn(x.size)) +plt.subplot(122) +_ = rm.plotGrid(linewidth=0.5, flipY=True) + +# RelativeTo single +with h5py.File('rm2d.h5', 'w') as f: + rm.toHdf(f, 'test') + +with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test']) + +arr = np.random.randn(*rm.shape) +p += 1; plt.figure(p) +plt.subplot(211) +rm.pcolor(arr, flipY=True) +plt.subplot(212) +rm2.pcolor(arr, flipY=True) + +# RelativeTo expanded +with h5py.File('rm2d.h5', 'w') as f: + rm.createHdf(f, 'test', add_axis=RectilinearMesh1D(centres=StatArray(np.arange(3.0), name='Easting', units="m"), relativeTo = 0.2*np.random.randn(x.size, y.size))) + for i in range(3): + rm.x.relativeTo += 0.5 + rm.y.relativeTo += 0.5 + rm.writeHdf(f, 'test', index=i) + +with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test'], index=0) + +with h5py.File('rm2d.h5', 'r') as f: + rm3 = RectilinearMesh3D.fromHdf(f['test']) + +p += 1; plt.figure(p) +plt.subplot(311) +rm.pcolor(arr, flipY=True) +plt.subplot(312) +rm2.pcolor(arr, flipY=True) + +p += 1; plt.figure(p) +arr = np.random.randn(*rm3.shape) +plt.subplot(311) +mesh = rm3[0, :, :] +mesh.pcolor(arr[0, :, :], flipY=True) +plt.subplot(312) +mesh = rm3[:, 0, :] +mesh.pcolor(arr[:, 0, :], flipY=True) +plt.subplot(313) +rm3[:, :, 0].pcolor(arr[:, :, 0]) + +plt.show() diff --git a/docs/_downloads/48f0be9987c0cd931b23ce187c305d56/plot_inference_2d_resolve.py b/docs/_downloads/48f0be9987c0cd931b23ce187c305d56/plot_inference_2d_resolve.py new file mode 100644 index 00000000..75ade54d --- /dev/null +++ b/docs/_downloads/48f0be9987c0cd931b23ce187c305d56/plot_inference_2d_resolve.py @@ -0,0 +1,150 @@ +""" +2D Posterior analysis of Resolve inference +------------------------------------------ + +All plotting in GeoBIPy can be carried out using the 3D inference class + +""" + +import matplotlib.pyplot as plt +import numpy as np +from geobipy import Model +from geobipy import Inference2D + +def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1 + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-160, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + +if __name__ == '__main__': + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + for model in models: + try: + plot_2d_summary("../../../Parallel_Inference/", "resolve", model) + except Exception as e: + print(model) + print(e) + pass diff --git a/docs/_downloads/525bc65bfe238dea5610d6856bece19c/plot_model_3d.ipynb b/docs/_downloads/525bc65bfe238dea5610d6856bece19c/plot_model_3d.ipynb new file mode 100644 index 00000000..0202d8e3 --- /dev/null +++ b/docs/_downloads/525bc65bfe238dea5610d6856bece19c/plot_model_3d.ipynb @@ -0,0 +1,213 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 3D Rectilinear Model\nThis 3D rectilinear model defines a grid with straight cell boundaries.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import StatArray\nfrom geobipy import RectilinearMesh3D\nfrom geobipy import Model\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport h5py\n\n\n\"\"\"\n3D Rectilinear Mesh\n-------------------\nThis 3D rectilinear mesh defines a grid with straight cell boundaries.\n\n\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import StatArray\nfrom geobipy import RectilinearMesh3D\nfrom geobipy import Model\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport h5py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Specify some cell centres in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(10.0), 'Easting', 'm')\ny = StatArray(np.arange(15.0), 'Northing', 'm')\nz = StatArray(np.arange(20.0), 'Depth', 'm')\n\nmesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)\n\nxx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)\nvalues = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"Height\")\nvalues = np.repeat(values[:, :, None], mesh.z.nCells, 2)\n\nmodel = Model(mesh=mesh, values=values)\n\nmodel1 = model[:5, :5, :5]\nmodel2 = model[:, :, 5]\nmodel3 = model[:, 5, :]\nmodel4 = model[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nmodel2.pcolor()\nplt.subplot(232)\nmodel3.pcolor()\nplt.subplot(233)\nmodel4.pcolor()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "model2 = model[:, 5, 5]\nmodel3 = model[5, :, 5]\nmodel4 = model[5, 5, :]\n\nplt.subplot(234)\nmodel2.pcolor()\nplt.subplot(235)\nmodel3.pcolor()\nplt.subplot(236)\nmodel4.pcolor()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with h5py.File('model3d.h5', 'w') as f:\n model.createHdf(f, 'test')\n model.writeHdf(f, 'test')\n\nwith h5py.File('model3d.h5', 'r') as f:\n model2 = Model.fromHdf(f['test'])\n\nmodel.pyvista_mesh().save('model3d.vtk')\n\n\nxx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)\nz_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"z_re\")\nmesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re)\nmodel = Model(mesh=mesh, values=values)\n\nmodel1 = model[:5, :5, :5]\nmodel2 = model[:, :, 5]\nmodel3 = model[:, 5, :]\nmodel4 = model[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nmodel2.pcolor()\nplt.subplot(232)\nmodel3.pcolor()\nplt.subplot(233)\nmodel4.pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = model.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "model.pyvista_mesh().save('model3d_re1.vtk')\n\n\nx_re = StatArray(np.sin(np.repeat(mesh.y.centres[:, None], mesh.z.nCells, 1)), \"x_re\")\nmesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re)\nmodel = Model(mesh=mesh, values=values)\n\nmodel1 = model[:5, :5, :5]\nmodel2 = model[:, :, 5]\nmodel3 = model[:, 5, :]\nmodel4 = model[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nmodel2.pcolor()\nplt.subplot(232)\nmodel3.pcolor()\nplt.subplot(233)\nmodel4.pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = model.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "model.pyvista_mesh().save('model3d_re2.vtk')\n\n\nxx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres)\ny_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"y_re\")\n\nmesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)\nmodel = Model(mesh=mesh, values=values)\n\nmodel1 = model[:5, :5, :5]\nmodel2 = model[:, :, 5]\nmodel3 = model[:, 5, :]\nmodel4 = model[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nmodel2.pcolor()\nplt.subplot(232)\nmodel3.pcolor()\nplt.subplot(233)\nmodel4.pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = model.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "model.pyvista_mesh().save('model3d_re3.vtk')\n\n# with h5py.File('mesh3d.h5', 'w') as f:\n# mesh.toHdf(f, 'test')\n\n# with h5py.File('mesh3d.h5', 'r') as f:\n# mesh2 = RectilinearMesh3D.fromHdf(f['test'])\n\n# mesh2.pyvista_mesh().save('mesh3d_read.vtk')\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/53dc65a717762d4693b891c0caabbde0/plot_StatArray.py b/docs/_downloads/53dc65a717762d4693b891c0caabbde0/plot_StatArray.py new file mode 100644 index 00000000..4d240e29 --- /dev/null +++ b/docs/_downloads/53dc65a717762d4693b891c0caabbde0/plot_StatArray.py @@ -0,0 +1,617 @@ +""" +StatArray Class +---------------- + +Extends the numpy ndarray class to add extra attributes such as names, and +units, and allows us to attach statistical descriptors of the array. +The direct extension to numpy maintains speed and functionality of numpy arrays. + +""" +#%% +from geobipy import StatArray +from geobipy import Histogram +from geobipy import Distribution +from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D +import numpy as np +import matplotlib.pyplot as plt +import h5py + +# plt.style.use('seaborn-pastel') + +#%% +# Instantiating a new StatArray class +# +++++++++++++++++++++++++++++++++++ +# + +# Integer +test = StatArray(1, name='1') +print(test.summary) +test = StatArray(10, name='10') +print(test.summary) +# tuple/Shape +test = StatArray((2, 10), name='(2, 10)') +print(test.summary) + +# float +test = StatArray(45.454, name='45.454') +print(test.summary) +test = StatArray(np.float64(45.454), name='45.454') +print(test.summary) + +# complex +# test = StatArray(np.complex(0.0, 1.0), name='complex(0, 1)') + +# array +Density = StatArray(np.random.randn(1), name="Density", units="$\frac{g}{cc}$") +print(Density.summary) + +# The StatArray can take any numpy function that returns an array as an input. +# The name and units of the variable can be assigned to the StatArray. + +#%% +# Attaching Prior and Proposal Distributions to a StatArray +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# The StatArray class has been built so that we may easily +# attach not only names and units, but statistical distributions too. +# We won't go into too much detail about the different distribution +# classes here so check out the :ref:`Distribution Class` for a better description. +# +# Two types of distributions can be attached to the StatArray. +# +# * Prior Distribution +# The prior represents how the user believes the variable should +# behave from a statistical standpoint. +# The values of the variable can be evaluated against the attached prior, +# to determine how likely they are to have occured https://en.wikipedia.org/wiki/Prior_probability +# +# * Proposal Distribution +# The proposal describes a probability distribution from which to +# sample when we wish to perturb the variable +# https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm + +# Obtain an instantiation of a random number generator. +# This is optional, but is an important consideration for parallel programming. +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +Density.prior = Distribution('Uniform', -2.0, 2.0, prng=prng) + +#%% +# We can also attach a proposal distribution +Density.proposal = Distribution('Normal', 0.0, 1.0, prng=prng) +print(Density.summary) +print("Class type of the prior: ",type(Density.prior)) +print("Class type of the proposal: ",type(Density.proposal)) + + +#%% +# The values in the variable can be evaluated against the prior. +# In this case, we have 3 elements in the variable, and a univariate Normal for the prior. +# Therefore each element is evaluated to get 3 probabilities, one for each element. +print(Density.probability(log=False)) + +#%% +# The univariate proposal distribution can generate random samples from itself. +print(Density.propose()) + +#%% +# From a sampling stand point we can either sample using only the proposal +# Or we can only generate samples that simultaneously satisfy the prior. +print(Density.propose(relative=True)) + +#%% +# We can perturb the variable by drawing from the attached proposal distribution. + +Density.perturb() +print(Density.summary) + +#%% +# Attaching a Histogram to capture the posterior distribution +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# The StatArray can perturb itself, evaluate its current probability given its priors +# and a histogram can be attached to capture its posterior distribution. +# As an example, lets create a Histogram class with bins generated from the prior. +bins = Density.prior.bins() +#%% +# Attach the histogram +Density.posterior = Histogram(mesh = RectilinearMesh1D(edges=bins)) + +#%% +# In an iterative sense, we can propose and evaluate new values, and update the posterior +for i in range(1000): + Density.perturb() + p = Density.probability(log=False) + + if p > 0.0: # This is a simple example! + Density.update_posterior() + +#%% +plt.figure() +Density.summaryPlot() + +#%% +# Attach a multivariate normal distribution as the prior and proposal +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# Attach the multivariate prior + +mean = np.random.randn(Density.size) +variance = np.ones(Density.size) +Density.prior = Distribution('MvNormal', mean, variance, prng=prng) + + +#%% +# Since the prior is multivariate, the appropriate equations are used to +# evaluate the probability for all elements in the StatArray. +# This produces a single probability. + +print(Density.probability(log=False)) + +#%% +# Attach the multivariate proposal + +mean = np.random.randn(Density.size) +variance = np.ones(Density.size) +Density.proposal = Distribution('MvNormal', mean, variance, prng=prng) + + +#%% +# Perturb the variables using the multivariate proposal. + +Density.perturb() +Density.summary + +with h5py.File('statarray.h5', 'w') as f: + Density.createHdf(f, 'statarray', withPosterior=True, add_axis=3) + Density.writeHdf(f, 'statarray', withPosterior=True, index=0) + +with h5py.File('statarray.h5', 'r') as f: + tmp = StatArray.fromHdf(f, 'statarray', index=0, skip_posterior=False) + +with h5py.File('statarray.h5', 'r') as f: + tmp = StatArray.fromHdf(f, 'statarray', skip_posterior=False) + + +#%% +# Basic manipulation +# ++++++++++++++++++ +# +# The StatArray contains other functions to perform basic array manipulations +# +# These routines essentially wrap around numpy functions, +# but the result will have the same name and units, +# and if any prior or proposal are set, those will be carried through too. +# +# 1D example +# __________ + +x = StatArray(-np.cumsum(np.arange(10.0))) +print(x) + +#%% + + +print(x.insert(i=[0, 9], values=[999.0, 999.0])) + + +#%% + + +print(x.prepend(999.0)) + + +#%% + + +print(x.prepend([998.0, 999.0])) + + +#%% + + +print(x.append([998.0, 999.0])) + + +#%% + + +print(x.resize(14)) + + +#%% + + +print(x.delete([5,8])) + + +#%% + + +print(x.edges()) + + +#%% + + +print(x.internalEdges()) + + +#%% + + +print(x.firstNonZero()) + + +#%% + + +print(x.lastNonZero()) + + +#%% + + +print(x.abs()) + + +#%% +# 2D example +# __________ + +x = StatArray(np.asarray([[0, -2, 3],[3, 0, -1],[1, 2, 0]])) +print(x) + + +#%% + + +print(x.insert(i=0, values=4)) + + +#%% + + +print(x.insert(i=[2, 3], values=5, axis=1)) + + +#%% + + +print(x.insert(i=2, values=[10, 11, 12], axis=1)) + + +#%% + + +print(x.prepend(999)) + + +#%% + + +print(x.prepend([999, 998, 997], axis=1)) + + +#%% + + +print(x.append([[999, 998, 997]])) + + +#%% + + +print(x.resize([5,5])) + + +#%% + + +print(x.delete(5)) + + +#%% + + +print(x.delete(2, axis=0)) + + +#%% + + +print(x.firstNonZero(axis=0)) + + +#%% + + +print(x.lastNonZero(axis=0)) + + +#%% + + +print(x.firstNonZero(axis=1)) + + +#%% + + +print(x.lastNonZero(axis=1)) + + +#%% + + +print(x.abs()) + + +#%% +# Plotting +# ++++++++ +# +# We can easily plot the StatArray with its built in plotting functions. +# All plotting functions can take matplotlib keywords + +# The simplest is to just plot the array + +Density = StatArray(np.random.randn(100),name="Density",units="$\frac{g}{cc}$") +Time = StatArray(np.linspace(0, 100, Density.size), name='Time', units='s') +Depth = StatArray(np.random.exponential(size=Density.size), name='Depth', units='m') + + +#%% + + +plt.figure() +_ = Density.plot(linewidth=0.5, marker='x', markersize=1.0) + +#%% +# We can quickly plot a bar graph. + +plt.figure() +_ = Density.bar() + + +#%% +# We can scatter the contents of the StatArray if it is 1D + +plt.figure() +_ = Density.scatter(alpha=0.7) + + +#%% +# Histogram Equalization +# ______________________ +# +# A neat trick with colourmaps is histogram equalization. +# This approach forces all colours in the images to have an equal weight. +# This distorts the colour bar, but can really highlight the lower and higher +# ends of whatever you are plotting. Just add the equalize keyword! + +plt.figure() +_ = Density.scatter(alpha=0.7, equalize=True) + + +#%% +# Take the log base(x) of the data +# +# We can also take the data to a log, log10, log2, or a custom number! + +plt.figure() +_ = Density.scatter(alpha=0.7,edgecolor='k',log='e') # could also use log='e', log=2, log=x) where x is the base you require + +#%% +# X and Y axes +# +# We can specify the x axis of the scatter plot. + + +plt.figure() +_ = Density.scatter(x=Time, alpha=0.7, edgecolor='k') + + +#%% +# Notice that I never specified the y axis, so the y axis defaulted to the values in the StatArray. +# In this case, any operations applied to the colours, are also applied to the y axis, e.g. log=10. +# When I take the values of Density to log base 10, because I do not specify the y plotting locations, those locations are similarly affected. +# +# I can however force the y co-ordinates by specifying it as input. +# In the second subplot I explicitly plot distance on the y axis. +# In the first subplot, the y axis is the same as the colourbar. + + +plt.figure() +ax1 = plt.subplot(211) +Density.scatter(x=Time, alpha=0.7, edgecolor='k', log=10) +plt.subplot(212, sharex=ax1) +_ = Density.scatter(x=Time, y=Depth, alpha=0.7, edgecolor='k', log=10) + + +#%% +# Point sizes +# +# Since the plotting functions take matplotlib keywords, I can also specify the size of each points. + +#%% + + +s = np.ceil(100*(np.abs(np.random.randn(Density.size)))) +plt.figure() +plt.tight_layout() +ax1 = plt.subplot(211) +Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=2) +plt.subplot(212, sharex=ax1) +#Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', sizeLegend=[1.0, 100, 200, 300]) +v = np.abs(Density)+1.0 +_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=[1.0, 100, 200, 300], log=10) + + + + +#%% +# Of course we can still take the log, or equalize the colour histogram + +plt.figure() +_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k',equalize=True,log=10) + + +#%% +# Typically pcolor only works with 2D arrays. The StatArray has a pcolor method that will pcolor a 1D array + +plt.figure() +plt.subplot(221) +Density.pcolor() +plt.subplot(222) +Density.pcolor(y=Time) +plt.subplot(223) +Density.pcolor(y=Time, flip=True) +plt.subplot(224) +_ = Density.pcolor(y=Time, log=10, equalize=True) + + +#%% +# We can add grid lines, and add opacity to each element in the pcolor image +# +# This is useful if the colour values need to be scaled by another variable e.g. variance. + + +plt.figure() +plt.subplot(121) +Density.pcolor(grid=True, cmap='jet') +plt.subplot(122) +a = np.linspace(1.0, 0.0, Density.size) +_ = Density.pcolor(grid=True, alpha=a, cmap='jet') + + +#%% +# We can plot a histogram of the StatArray + +plt.figure() +_ = Density.hist(100) + + +#%% +# We can write the StatArray to a HDF5 file. HDF5 files are binary files that can include compression. They allow quick and easy access to parts of the file, and can also be written to and read from in parallel! + +with h5py.File('1Dtest.h5','w') as f: + Density.toHdf(f,'test') + + +#%% +# We can then read the StatArray from the file +# Here x is a new variable, that is read in from the hdf5 file we just wrote. + +x = StatArray.fromHdf('1Dtest.h5', 'test') +print('x has the same values as Density? ',np.all(x == Density)) +x[2] = 5.0 # Change one of the values in x +print('x has its own memory allocated (not a reference/pointer)? ', id(x) != id(Density)) + + +#%% +# We can also define a 2D array + +Density = StatArray(np.random.randn(50,100),"Density","$\frac{g}{cc}$") +Density.summary + + +#%% +# The StatArray Class's functions work whether it is 1D or 2D +# +# We can still do a histogram + +plt.figure() +_ = Density.hist() + + +#%% +# And we can use pcolor to plot the 2D array + +plt.figure() +_ = Density.pcolor() + + +#%% +# The StatArray comes with extra plotting options +# +# Here we specify the x and y axes for the 2D array using two other 1D StatArrays + +plt.figure() +x = StatArray(np.arange(101),name='x Axis',units = 'mm') +y = StatArray(np.arange(51),name='y Axis',units = 'elephants') +_ = Density.pcolor(x=x, y=y) + + +#%% +# We can plot using a log10 scale, in this case, we have values that are less +# than or equal to 0.0. Plotting with the log option will by default mask any +# of those values, and will let you know that it has done so! + +plt.figure() +_ = Density.pcolor(x=x,y=y,log=2) + + +#%% +# A neat trick with colourmaps is histogram equalization. +# This approach forces all colours in the image to have an equal amount. +# This distorts the colours, but can really highlight the lower and higher +# ends of whatever you are plotting + +plt.figure() +_ = Density.pcolor(x=x, y=y, equalize=True) + + +#%% +# We can equalize the log10 plot too :) + +plt.figure() +_ = Density.pcolor(x=x,y=y,equalize=True, log=10) + + +#%% +# We can add opacity to each pixel in the image + +a = StatArray(np.random.random(Density.shape), 'Opacity from 0.0 to 1.0') + + +#%% + + +plt.figure() +ax1 = plt.subplot(131) +ax = Density.pcolor(x=x, y=y, flipY=True, linewidth=0.1, colorbar=False) +plt.subplot(132, sharex=ax1, sharey=ax1) +ax = Density.pcolor(x=x, y=y, alpha=a, flipY=True, linewidth=0.1, colorbar=False) +plt.subplot(133, sharex=ax1, sharey=ax1) +_ = a.pcolor(x=x, y=y, flipY=True) + + +#%% +# If the array potentially has a lot of white space around the edges, we can trim the image + +Density[:10, :] = 0.0 +Density[-10:, :] = 0.0 +Density[:, :10] = 0.0 +Density[:, -10:] = 0.0 +plt.figure() +plt.subplot(121) +Density.pcolor() +plt.subplot(122) +_ = Density.pcolor(trim=0.0) + + +#%% +# Create a stacked area plot of a 2D StatArray + +A = StatArray(np.abs(np.random.randn(13,100)), name='Variable', units="units") +x = StatArray(np.arange(100),name='x Axis',units = 'mm') +plt.figure() +ax1 = plt.subplot(211) +A.stackedAreaPlot(x=x, axis=1) +plt.subplot(212, sharex=ax1) +_ = A.stackedAreaPlot(x=x, i=np.s_[[1,3,4],:], axis=1, labels=['a','b','c']) + +plt.show() diff --git a/docs/_downloads/54ce350904e65ae0e6717397118ed43f/plot_inference_2d_tempest.py b/docs/_downloads/54ce350904e65ae0e6717397118ed43f/plot_inference_2d_tempest.py new file mode 100644 index 00000000..4ec04262 --- /dev/null +++ b/docs/_downloads/54ce350904e65ae0e6717397118ed43f/plot_inference_2d_tempest.py @@ -0,0 +1,152 @@ +""" +2D Posterior analysis of Tempest inference +------------------------------------------ + +All plotting in GeoBIPy can be carried out using the 3D inference class + +""" + +import argparse +import matplotlib.pyplot as plt +import numpy as np +from geobipy import Model +from geobipy import Inference2D + +def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + + +if __name__ == '__main__': + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + # import warnings + # warnings.filterwarnings('error') + for model in models: + try: + plot_2d_summary('../../../Parallel_Inference/', "tempest", model) + except Exception as e: + print(model) + print(e) + pass diff --git a/docs/_downloads/553c44c8f0a927032d89154ad011db0e/plot_rectilinear_mesh_1d.py b/docs/_downloads/553c44c8f0a927032d89154ad011db0e/plot_rectilinear_mesh_1d.py new file mode 100644 index 00000000..a5094ae1 --- /dev/null +++ b/docs/_downloads/553c44c8f0a927032d89154ad011db0e/plot_rectilinear_mesh_1d.py @@ -0,0 +1,286 @@ +""" +1D Rectilinear Mesh +------------------- +""" +#%% +from copy import deepcopy +from geobipy import StatArray +from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh2D_stitched +import matplotlib.gridspec as gridspec +import matplotlib.pyplot as plt +import numpy as np +import h5py + +#%% +# The basics +# ++++++++++ +# Instantiate a new 1D rectilinear mesh by specifying cell centres, edges, or widths. +x = StatArray(np.cumsum(np.arange(0.0, 10.0)), 'Depth', 'm') + +#%% +# Cell edges +rm = RectilinearMesh1D(edges=x, centres=None, widths=None) + +#%% +# We can plot the grid of the mesh +# Or Pcolor the mesh showing. An array of cell values is used as the colour. +arr = StatArray(np.random.randn(*rm.shape), "Name", "Units") +p=0; plt.figure(p) +plt.subplot(121) +_ = rm.plotGrid(transpose=True, flip=True) +plt.subplot(122) +_ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + +# Mask the mesh cells by a distance +rm_masked, indices, arr2 = rm.mask_cells(2.0, values=arr) +p+=1; plt.figure(p) +_ = rm_masked.pcolor(StatArray(arr2), grid=True, transpose=True, flip=True) + +# Writing and reading to/from HDF5 +# ++++++++++++++++++++++++++++++++ +with h5py.File('rm1d.h5', 'w') as f: + rm.toHdf(f, 'rm1d') + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(122) +_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + +with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=10) + for i in range(10): + rm.writeHdf(f, 'rm1d', index=i) + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) +with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(131) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(132) +_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) +plt.subplot(133) +_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True) + + +#%% +# Log-space rectilinear mesh +# ++++++++++++++++++++++++++ +# Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +# Here we use edges +x = StatArray(np.logspace(-3, 3, 10), 'Depth', 'm') + +#%% +rm = RectilinearMesh1D(edges=x, log=10) + +# We can plot the grid of the mesh +# Or Pcolor the mesh showing. An array of cell values is used as the colour. +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.plotGrid(transpose=True, flip=True) +plt.subplot(122) +arr = StatArray(np.random.randn(rm.nCells), "Name", "Units") +_ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + +# Writing and reading to/from HDF5 +# ++++++++++++++++++++++++++++++++ +with h5py.File('rm1d.h5', 'w') as f: + rm.toHdf(f, 'rm1d') + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(122) +_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + +with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=10) + for i in range(10): + rm.writeHdf(f, 'rm1d', index=i) + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) +with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(131) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(132) +_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) +plt.subplot(133) +_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True) + +#%% +# RelativeTo +# ++++++++++ +# Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +# Here we use edges +x = StatArray(np.arange(11.0), 'Deviation', 'm') + +#%% +rm = RectilinearMesh1D(edges=x, relativeTo=5.0) + +#%% +# We can plot the grid of the mesh +# Or Pcolor the mesh showing. An array of cell values is used as the colour. +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.plotGrid(transpose=True, flip=True) +plt.subplot(122) +arr = StatArray(np.random.randn(rm.nCells), "Name", "Units") +_ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + +# Writing and reading to/from HDF5 +# ++++++++++++++++++++++++++++++++ +with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d') + rm.writeHdf(f, 'rm1d') + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(122) +_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + +with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=3) + for i in range(3): + rm.relativeTo += 0.5 + rm.writeHdf(f, 'rm1d', index=i) + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) +with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(131) +_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) +plt.subplot(132) +_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) +plt.subplot(133) +_ = rm2.pcolor(np.repeat(arr[None, :], 3, 0), grid=True, flipY=True) + + +# Making a mesh perturbable +# +++++++++++++++++++++++++ +n_cells = 2 +widths = StatArray(np.full(n_cells, fill_value=10.0), 'test') +rm = RectilinearMesh1D(widths=widths, relativeTo=0.0) + +#%% +# Randomness and Model Perturbations +# ++++++++++++++++++++++++++++++++++ +# We can set the priors on the 1D model by assigning minimum and maximum layer +# depths and a maximum number of layers. These are used to create priors on +# the number of cells in the model, a new depth interface, new parameter values +# and the vertical gradient of those parameters. +# The halfSpaceValue is used as a reference value for the parameter prior. +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +# Set the priors +rm.set_priors(min_edge = 1.0, + max_edge = 150.0, + max_cells = 30, + prng = prng) + +#%% +# We can evaluate the prior of the model using depths only +print('Log probability of the Mesh given its priors: ', rm.probability) + +#%% +# To propose new meshes, we specify the probabilities of creating, removing, perturbing, and not changing +# an edge interface +# Here we force the creation of a layer. +rm.set_proposals(probabilities = [0.25, 0.25, 0.25, 0.25], prng=prng) +rm.set_posteriors() + +rm0 = deepcopy(rm) + +#%% +# We can then perturb the layers of the model +for i in range(1000): + rm = rm.perturb() + rm.update_posteriors() + +#%% +p+=1; fig = plt.figure(p) +ax = rm._init_posterior_plots(fig) + +rm.plot_posteriors(axes=ax) + +with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', withPosterior = True) + rm.writeHdf(f, 'rm1d', withPosterior = True) + +with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(121) +_ = rm.pcolor(StatArray(rm.shape), grid=True, transpose=True, flip=True) +plt.subplot(122) +_ = rm1.pcolor(StatArray(rm1.shape), grid=True, transpose=True, flip=True) + +p+=1; fig = plt.figure(p) +ax = rm1._init_posterior_plots(fig) +rm1.plot_posteriors(axes=ax) + +#%% +# Expanded +with h5py.File('rm1d.h5', 'w') as f: + tmp = rm.pad(rm.max_cells) + tmp.createHdf(f, 'rm1d', withPosterior=True, add_axis=StatArray(np.arange(3.0), name='Easting', units="m")) + + rm.relativeTo = 5.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=0) + + rm = deepcopy(rm0) + for i in range(1000): + rm = rm.perturb(); rm.update_posteriors() + rm.relativeTo = 10.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=1) + + rm = deepcopy(rm0) + for i in range(1000): + rm = rm.perturb(); rm.update_posteriors() + rm.relativeTo = 25.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=2) + +with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + +p+=1; plt.figure(p) +plt.subplot(121) +arr = np.random.randn(3, rm.max_cells) * 10 +_ = rm0.pcolor(arr[0, :rm0.nCells.item()], grid=True, transpose=True, flip=True) +plt.subplot(122) +_ = rm2.pcolor(arr, grid=True, flipY=True, equalize=True) + +from geobipy import RectilinearMesh2D +with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d'], index=0) + +plt.figure() +plt.subplot(121) +rm2.plotGrid(transpose=True, flip=True) +plt.subplot(122) +rm2.edges.posterior.pcolor(transpose=True, flip=True) + +plt.show() \ No newline at end of file diff --git a/docs/_downloads/5fec87f3cbcb4a4b1c15391a27334984/plot_inference_1d_tempest.py b/docs/_downloads/5fec87f3cbcb4a4b1c15391a27334984/plot_inference_1d_tempest.py new file mode 100644 index 00000000..404a62d6 --- /dev/null +++ b/docs/_downloads/5fec87f3cbcb4a4b1c15391a27334984/plot_inference_1d_tempest.py @@ -0,0 +1,87 @@ +""" +Running GeoBIPy to invert Tempest data +-------------------------------------- +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + +data_type = "Tempest" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +parameter_file = "../../supplementary/options_files/{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=2, **kwargs) diff --git a/docs/_downloads/6651de36bdd3440bb761887dd2b00831/plot_histogram_1d.ipynb b/docs/_downloads/6651de36bdd3440bb761887dd2b00831/plot_histogram_1d.ipynb new file mode 100644 index 00000000..a949e1c7 --- /dev/null +++ b/docs/_downloads/6651de36bdd3440bb761887dd2b00831/plot_histogram_1d.ipynb @@ -0,0 +1,328 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Histogram 1D\n\nThis histogram class allows efficient updating of histograms, plotting and\nsaving as HDF5\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D\nimport h5py\nfrom geobipy import StatArray\nfrom geobipy import Histogram\nimport numpy as np\nimport matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Histogram with regular bins\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Create regularly spaced bins\nmesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Set the histogram using the bins, and update\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh=mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can update the histogram with some new values\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(np.random.randn(1000), trim=True)\n\n# Plot the histogram\nplt.figure()\nplt.subplot(221)\n_ = H.plot()\nplt.subplot(222)\n_ = H.pdf.bar()\nplt.subplot(223)\nH.pmf.bar()\nplt.subplot(224)\nH.cdf().bar()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Get the median, and 95% confidence values\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(H.credible_intervals(percent=95.0))\n\nplt.figure()\nH.plot()\nH.plotCredibleIntervals()\nH.plotMean()\nH.plotMedian()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Histogram with irregular bins\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Create irregularly spaced bins\nx = np.cumsum(np.arange(10, dtype=np.float64))\nirregularBins = np.hstack([-x[::-1], x[1:]])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create a named StatArray\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "edges = StatArray(irregularBins, 'irregular bins')\nmesh = RectilinearMesh1D(edges = edges)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate the histogram with bin edges\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh=mesh)\n\n# Update the histogram\nH.update((np.random.randn(10000)*20.0) - 10.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Plot the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(211)\n_ = H.plot()\nplt.subplot(212)\n_ = H.plot(normalize=True)\n\nplt.figure()\nH.plot()\nH.plotCredibleIntervals()\nH.plotMean()\nH.plotMedian()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the histogram as a pcolor plot\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = H.pcolor(grid=True, transpose=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Histogram with linear space entries that are logged internally\nCreate some bins spaced logarithmically\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mesh = RectilinearMesh1D(edges = StatArray(np.logspace(-5, 3), 'positive bins'), log=10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate the Histogram with log=10\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The update takes in the numbers in linear space and takes their log=10\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(10.0**(np.random.randn(1000)*2.0), trim=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(211)\n_ = H.plot()\n\nimport h5py\nwith h5py.File('h1d.h5', 'w') as f:\n H.toHdf(f, 'h1d')\n\nwith h5py.File('h1d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h1d'])\n\nplt.subplot(212)\n_ = H1.plot()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Set the histogram using the bins, and update\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh=mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can update the histogram with some new values\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(np.random.randn(1000), trim=True)\n\nimport h5py\nwith h5py.File('h1d.h5', 'w') as f:\n H.createHdf(f, 'h1d', add_axis=StatArray(np.arange(3.0), \"Name\", \"Units\"))\n H.writeHdf(f, 'h1d', index=0)\n H.update(np.random.randn(1000), trim=True)\n H.writeHdf(f, 'h1d', index=1)\n H.update(np.random.randn(1000), trim=True)\n H.writeHdf(f, 'h1d', index=2)\n\nwith h5py.File('h1d.h5', 'r') as f:\n H1 = Histogram.fromHdf(f['h1d'])\n H2 = Histogram.fromHdf(f['h1d'], index=0)\n H3 = Histogram.fromHdf(f['h1d'], index=1)\n H4 = Histogram.fromHdf(f['h1d'], index=2)\n\n\nprint(H4.summary)\n\n# plt.figure()\n# plt.subplot(211)\n# _ = H1.plot()\n# plt.subplot(212)\n# _ = H4.plot()\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/6dec5e41149e94d435270c1dffe803e1/plot_rectilinear_mesh_2d.ipynb b/docs/_downloads/6dec5e41149e94d435270c1dffe803e1/plot_rectilinear_mesh_2d.ipynb new file mode 100644 index 00000000..3c27469b --- /dev/null +++ b/docs/_downloads/6dec5e41149e94d435270c1dffe803e1/plot_rectilinear_mesh_2d.ipynb @@ -0,0 +1,328 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 2D Rectilinear Mesh\nThis 2D rectilinear mesh defines a grid with straight cell boundaries.\n\nIt can be instantiated in two ways.\n\nThe first is by providing the cell centres or\ncell edges in two dimensions.\n\nThe second embeds the 2D mesh in 3D by providing the cell centres or edges in three dimensions.\nThe first two dimensions specify the mesh coordinates in the horiztontal cartesian plane\nwhile the third discretizes in depth. This allows us to characterize a mesh whose horizontal coordinates\ndo not follow a line that is parallel to either the \"x\" or \"y\" axis.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import h5py\nfrom geobipy import StatArray\nfrom geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh3D\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Specify some cell centres in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(10.0), 'Easting', 'm')\ny = StatArray(np.arange(20.0), 'Depth', 'm')\nrm = RectilinearMesh2D(x_centres=x, y_centres=y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the grid lines of the mesh.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "p=0;\nplt.figure(p)\n_ = rm.plotGrid(flipY=True, linewidth=0.5)\n\n# Intersecting multisegment lines with a mesh\narr = np.zeros(rm.shape)\ni = rm.line_indices([0.0, 3.0, 6.0, 9], [2.0, 6.0, 0.0, 10])\narr[i[:, 0], i[:, 1]] = 1\np += 1; plt.figure(p)\nrm.pcolor(values = arr)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can pcolor the mesh by providing cell values.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xx, yy = np.meshgrid(rm.y.centres, rm.x.centres)\narr = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"Values\")\n\np += 1; plt.figure(p)\n_ = rm.pcolor(arr, grid=True, flipY=True, linewidth=0.5)\n\n# xG = rm.xGradientMatrix()\n# zG = rm.yGradientMatrix()\n\n# dax = StatArray((xG * arr.flatten()).reshape((arr.shape[0], arr.shape[1]-1)))\n# rm2 = rm[:, :9]\n\n# plt.figure()\n# rm2.pcolor(dax, xAxis='r', grid=True, flipY=True, linewidth=0.5)\n\n# dax = StatArray((zG * arr.flatten()).reshape((arr.shape[0]-1, arr.shape[1])))\n\n# plt.figure()\n# dax.pcolor(grid=True, flipY=True, linewidth=0.5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Mask the x axis cells by a distance\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, values=arr)\np += 1; plt.figure(p)\n_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Mask the z axis cells by a distance\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(y_distance=0.2, values=arr)\np += 1; plt.figure(p)\n_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Mask axes by a distance\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, y_distance=0.2, values=arr)\np += 1; plt.figure(p)\n_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)\n\nx = StatArray(np.arange(10.0), 'Easting', 'm')\ny = StatArray(np.cumsum(np.arange(15.0)), 'Depth', 'm')\nrm = RectilinearMesh2D(x_centres=x, y_centres=y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can perform some interval statistics on the cell values of the mesh\nGenerate some values\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = np.repeat(np.arange(1.0, np.float64(rm.x.nCells+1))[:, np.newaxis], rm.y.nCells, 1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Compute the mean over an interval for the mesh.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm.intervalStatistic(a, intervals=[6.8, 12.4], axis=0, statistic='mean')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Compute the mean over multiple intervals for the mesh.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm.intervalStatistic(a, intervals=[6.8, 12.4, 20.0, 40.0], axis=0, statistic='mean')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can specify either axis\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm.intervalStatistic(a, intervals=[2.8, 4.2], axis=1, statistic='mean')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm.intervalStatistic(a, intervals=[2.8, 4.2, 5.1, 8.4], axis=1, statistic='mean')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Slice the 2D mesh to retrieve either a 2D mesh or 1D mesh\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm2 = rm[:5, :5]\nrm3 = rm[:5, 5]\nrm4 = rm[5, :5]\n\np += 1; plt.figure(p)\nplt.subplot(131)\nrm2.plotGrid()\nplt.subplot(132)\nrm3.plotGrid()\nplt.subplot(133)\nrm4.plotGrid(transpose=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Resample a grid\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "values = StatArray(np.random.randn(*rm.shape))\nrm2, values2 = rm.resample(0.5, 0.5, values)\n\np += 1; plt.figure(p)\nplt.subplot(121)\nrm.pcolor(values)\nplt.subplot(122)\nrm2.pcolor(values2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Axes in log space\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.logspace(-1, 4, 10), 'x')\ny = StatArray(np.logspace(0, 3, 10), 'y')\nrm = RectilinearMesh2D(x_edges=x, x_log=10, y_edges=y, y_log=10)\n\n# We can plot the grid lines of the mesh.\np += 1; plt.figure(p)\n_ = rm.plotGrid(linewidth=0.5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with h5py.File('rm2d.h5', 'w') as f:\n rm.toHdf(f, 'test')\n\nwith h5py.File('rm2d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['test'])\n\narr = np.random.randn(*rm.shape)\np += 1; plt.figure(p)\nplt.subplot(211)\nrm.pcolor(arr)\nplt.subplot(212)\nrm2.pcolor(arr)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## RelativeTo\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(10.0), 'Northing', 'm')\ny = StatArray(np.arange(20.0), 'Depth', 'm')\n\nrm = RectilinearMesh2D(x_centres=x, y_centres=y)\n\np += 1; plt.figure(p)\nplt.subplot(121)\n_ = rm.plotGrid(linewidth=0.5, flipY=True)\nrm = RectilinearMesh2D(x_centres=x, x_relative_to=0.2*np.random.randn(y.size), y_centres=y, y_relative_to=0.2*np.random.randn(x.size))\nplt.subplot(122)\n_ = rm.plotGrid(linewidth=0.5, flipY=True)\n\n# RelativeTo single\nwith h5py.File('rm2d.h5', 'w') as f:\n rm.toHdf(f, 'test')\n\nwith h5py.File('rm2d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['test'])\n\narr = np.random.randn(*rm.shape)\np += 1; plt.figure(p)\nplt.subplot(211)\nrm.pcolor(arr, flipY=True)\nplt.subplot(212)\nrm2.pcolor(arr, flipY=True)\n\n# RelativeTo expanded\nwith h5py.File('rm2d.h5', 'w') as f:\n rm.createHdf(f, 'test', add_axis=RectilinearMesh1D(centres=StatArray(np.arange(3.0), name='Easting', units=\"m\"), relativeTo = 0.2*np.random.randn(x.size, y.size)))\n for i in range(3):\n rm.x.relativeTo += 0.5\n rm.y.relativeTo += 0.5\n rm.writeHdf(f, 'test', index=i)\n\nwith h5py.File('rm2d.h5', 'r') as f:\n rm2 = RectilinearMesh2D.fromHdf(f['test'], index=0)\n\nwith h5py.File('rm2d.h5', 'r') as f:\n rm3 = RectilinearMesh3D.fromHdf(f['test'])\n\np += 1; plt.figure(p)\nplt.subplot(311)\nrm.pcolor(arr, flipY=True)\nplt.subplot(312)\nrm2.pcolor(arr, flipY=True)\n\np += 1; plt.figure(p)\narr = np.random.randn(*rm3.shape)\nplt.subplot(311)\nmesh = rm3[0, :, :]\nmesh.pcolor(arr[0, :, :], flipY=True)\nplt.subplot(312)\nmesh = rm3[:, 0, :]\nmesh.pcolor(arr[:, 0, :], flipY=True)\nplt.subplot(313)\nrm3[:, :, 0].pcolor(arr[:, :, 0])\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/76ee0e4ad4daaf5556108538842b1772/hdf5.py b/docs/_downloads/76ee0e4ad4daaf5556108538842b1772/hdf5.py new file mode 100644 index 00000000..df6a170a --- /dev/null +++ b/docs/_downloads/76ee0e4ad4daaf5556108538842b1772/hdf5.py @@ -0,0 +1,100 @@ +""" +Using HDF5 within GeoBIPy +------------------------- + +Inference for large scale datasets in GeoBIPy is handled using MPI and distributed memory systems. +A common bottleneck with large parallel algorithms is the input output of information to disk. +We use HDF5 to read and write data in order to leverage the parallel capabililties of the HDF5 API. + +Each object within GeoBIPy has a create_hdf, write_hdf, and read_hdf routine. + +""" +import numpy as np +import h5py +from geobipy import StatArray + +#%% +# StatArray + +# Instantiate a StatArray +x = StatArray(np.arange(10.0), name = 'an Array', units = 'some units') + +# Write the StatArray to a HDF file. +with h5py.File("x.h5", 'w') as f: + x.toHdf(f, "x") + +# Read the StatArray back in. +with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x') + +print('x', x) +print('y', y) + +#%% +# There are actually steps within the "toHdf" function. +# First, space is created within the HDF file and second, the data is written to that space +# These functions are split because during the execution of a parallel enabled program, +# all the space within the HDF file needs to be allocated before we can write to the file +# using multiple cores. + +# Write the StatArray to a HDF file. +with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x") + x.writeHdf(f, "x") + +# Read the StatArray back in. +with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x') + +print('x', x) +print('y', y) + +#%% +# The create and write HDF methods also allow extra space to be allocated so that +# the extra memory can be written later, perhaps by multiple cores. +# Here we specify space for 2 arrays, the memory is stored contiguously as a numpy array. +# We then write to only the first index. + +# Write the StatArray to a HDF file. +with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=2) + x.writeHdf(f, "x", index=0) + +# Read the StatArray back in. +with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=0) + +print('x', x) +print('y', y) + + +#%% +# The duplication can also be a shape. + +# Write the StatArray to a HDF file. +with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=(2, 2)) + x.writeHdf(f, "x", index=(0, 0)) + +# Read the StatArray back in. +with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=(0, 0)) + +print('x', x) +print('y', y) + +#%% +# Similarly, we can duplicate a 2D array with an extra 2D duplication + +x = StatArray(np.random.randn(2, 2), name = 'an Array', units = 'some units') +# Write the StatArray to a HDF file. +with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=(2, 2)) + x.writeHdf(f, "x", index=(0, 0)) + +# Read the StatArray back in. +with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=(0, 0)) + +print('x', x) +print('y', y) \ No newline at end of file diff --git a/docs/_downloads/7d8af6f7b40a771fd3b189fc4fd80360/plot_model_1d.ipynb b/docs/_downloads/7d8af6f7b40a771fd3b189fc4fd80360/plot_model_1d.ipynb new file mode 100644 index 00000000..79e5edb4 --- /dev/null +++ b/docs/_downloads/7d8af6f7b40a771fd3b189fc4fd80360/plot_model_1d.ipynb @@ -0,0 +1,227 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 1D Model with an infinite halfspace\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from copy import deepcopy\nfrom geobipy import StatArray\nfrom geobipy import RectilinearMesh1D\nfrom geobipy import Model\nfrom geobipy import Distribution\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Instantiate the 1D Model with a Half Space\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Make a test model with 10 layers, and increasing parameter values\nnLayers = 2\npar = StatArray(np.linspace(0.001, 0.02, nLayers), \"Conductivity\", \"$\\\\frac{S}{m}$\")\nthk = StatArray(np.full(nLayers, fill_value=10.0))\nthk[-1] = np.inf\nmesh = RectilinearMesh1D(widths = thk)\n\nmod = Model(mesh = mesh, values=par)\n# mod = Model1D(parameters=par, widths=thk)\n\nplt.figure()\nmod.plotGrid(transpose=True, flip=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Randomness and Model Perturbations\nWe can set the priors on the 1D model by assigning minimum and maximum layer\ndepths and a maximum number of layers. These are used to create priors on\nthe number of cells in the model, a new depth interface, new parameter values\nand the vertical gradient of those parameters.\nThe halfSpaceValue is used as a reference value for the parameter prior.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from numpy.random import Generator\nfrom numpy.random import PCG64DXSM\ngenerator = PCG64DXSM(seed=0)\nprng = Generator(generator)\n\n# Set the priors\nmod.set_priors(value_mean=0.01,\n min_edge=1.0,\n max_edge=150.0,\n max_cells=30,\n solve_value=True,\n solve_gradient=True,\n prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can evaluate the prior of the model using depths only\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print('Log probability of the Model given its priors: ', mod.probability(False, False))\n# Or with priors on its parameters, and parameter gradient with depth.\nprint('Log probability of the Model given its priors: ', mod.probability(True, True))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To propose new models, we specify the probabilities of creating, removing, perturbing, and not changing\na layer interface\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pProposal = Distribution('LogNormal', 0.01, np.log(2.0)**2.0, linearSpace=True, prng=prng)\nmod.set_proposals(probabilities=[0.25, 0.25, 0.5, 0.25], proposal=pProposal, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then perturb the layers of the model\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "remapped, perturbed = mod.perturb()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(8, 6))\nax = plt.subplot(121)\nmod.pcolor(transpose=True, flip=True, log=10) # , grid=True)\nax = plt.subplot(122)\nperturbed.pcolor(transpose=True, flip=True, log=10) # , grid=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can evaluate the prior of the model using depths only\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print('Log probability of the Model given its priors: ',perturbed.probability(False, False))\n# Or with priors on its parameters, and parameter gradient with depth.\nprint('Log probability of the Model given its priors: ',perturbed.probability(True, True))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Perturbing a model multiple times\nIn the stochasitic inference process, we perturb the model structure,\nand parameter values, multiple times.\nEach time the model is perturbed, we can record its state\nin a posterior distribution.\n\nFor a 1D model, the parameter posterior is a 2D hitmap with depth in one dimension\nand the parameter value in the other.\nWe also attach a 1D histogram for the number of layers,\nand a 1D histogram for the locations of interfaces.\n\nSince we have already set the priors on the Model, we can set the posteriors\nbased on bins from from the priors.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mod.set_posteriors()\n\nmod0 = deepcopy(mod)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we randomly perturb the model, and update its posteriors.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mod.update_posteriors()\nfor i in range(1001):\n remapped, perturbed = mod.perturb()\n\n # And update the model posteriors\n perturbed.update_posteriors()\n\n mod = perturbed" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can now plot the posteriors of the model.\n\nRemember in this case, we are simply perturbing the model structure and parameter values\nThe proposal for the parameter values is fixed and centred around a single value.\nfig = plt.figure(figsize=(8, 6))\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# plt.subplot(131)\n# mod.nCells.posterior.plot()\n# ax = plt.subplot(132)\n# mod.values.posterior.pcolor(cmap='gray_r', colorbar=False, flipY=True, logX=10)\n# plt.subplot(133, sharey=ax)\n# mod.mesh.edges.posterior.plot(transpose=True, flipY=True)\n\n# plt.figure()\n# mod.plot_posteriors(**{\"cmap\": 'gray_r',\n# \"xscale\": 'log',\n# \"noColorbar\": True,\n# \"flipY\": True,\n# 'credible_interval_kwargs':{'axis': 1,\n# 'reciprocate': True,\n# 'xscale': 'log'}})\n# mod.par.posterior.plotCredibleIntervals(xscale='log', axis=1)\n\n\nfig = plt.figure(figsize=(8, 6))\n# gs = fig.add_gridspec(nrows=1, ncols=1)\nmod.plot_posteriors(axes=fig,\n edges_kwargs = {\n \"transpose\":True,\n \"flipY\":True\n },\n parameter_kwargs = {\n \"cmap\": 'gray_r',\n \"xscale\": 'log',\n \"colorbar\": False,\n \"flipY\": True,\n 'credible_interval_kwargs':{\n 'reciprocate':True,\n # 'axis': 1,\n 'xscale': 'log'\n }\n },\n best = mod)\n\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/7f3bb43ebb9eba21697953fbfc04f6d2/plot_rectilinear_mesh_3d.py b/docs/_downloads/7f3bb43ebb9eba21697953fbfc04f6d2/plot_rectilinear_mesh_3d.py new file mode 100644 index 00000000..be5e12d1 --- /dev/null +++ b/docs/_downloads/7f3bb43ebb9eba21697953fbfc04f6d2/plot_rectilinear_mesh_3d.py @@ -0,0 +1,153 @@ +""" +3D Rectilinear Mesh +------------------- +This 3D rectilinear mesh defines a grid with straight cell boundaries. + +""" + +#%% +from geobipy import StatArray +from geobipy import RectilinearMesh3D +import matplotlib.pyplot as plt +import numpy as np +import h5py + + +#%% +# Specify some cell centres in x and y +x = StatArray(np.arange(10.0), 'Easting', 'm') +y = StatArray(np.arange(15.0), 'Northing', 'm') +z = StatArray(np.arange(20.0), 'Depth', 'm') + +rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + +rm1 = rm[:5, :5, :5] +rm2 = rm[:, :, 5] +rm3 = rm[:, 5, :] +rm4 = rm[5, :, :] + +plt.figure() +plt.subplot(231) +rm2.plotGrid() +plt.subplot(232) +rm3.plotGrid() +plt.subplot(233) +rm4.plotGrid() + +#%% +rm2 = rm[:, 5, 5] +rm3 = rm[5, :, 5] +rm4 = rm[5, 5, :] + +plt.subplot(234) +rm2.plotGrid() +plt.subplot(235) +rm3.plotGrid() +plt.subplot(236) +rm4.plotGrid() + +#%% +with h5py.File('rm3d.h5', 'w') as f: + rm.createHdf(f, 'test') + rm.writeHdf(f, 'test') + +with h5py.File('rm3d.h5', 'r') as f: + rm2 = RectilinearMesh3D.fromHdf(f['test']) + +rm.pyvista_mesh().save('rm3d.vtk') + + +xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) +z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") +rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re) + +rm1 = rm[:5, :5, :5] +rm2 = rm[:, :, 5] +rm3 = rm[:, 5, :] +rm4 = rm[5, :, :] + +plt.figure() +plt.subplot(231) +rm2.plotGrid() +plt.subplot(232) +rm3.plotGrid() +plt.subplot(233) +rm4.plotGrid() + +#%% +# We can plot the mesh in 3D! +pv = rm.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +mesh = rm.pyvista_mesh().save('rm3d_re1.vtk') + + +x_re = StatArray(np.sin(np.repeat(rm.y.centres[:, None], rm.z.nCells, 1)), "x_re") + +xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) +z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") +rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re) + +rm1 = rm[:5, :5, :5] +rm2 = rm[:, :, 5] +rm3 = rm[:, 5, :] +rm4 = rm[5, :, :] + +plt.figure() +plt.subplot(231) +rm2.plotGrid() +plt.subplot(232) +rm3.plotGrid() +plt.subplot(233) +rm4.plotGrid() + +#%% +# We can plot the mesh in 3D! +pv = rm.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +mesh = rm.pyvista_mesh().save('rm3d_re2.vtk') + + +xx, yy = np.meshgrid(rm.z.centres, rm.y.centres) +x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re") + +xx, yy = np.meshgrid(rm.z.centres, rm.x.centres) +y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + +xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) +z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") +rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) + +rm1 = rm[:5, :5, :5] +rm2 = rm[:, :, 5] +rm3 = rm[:, 5, :] +rm4 = rm[5, :, :] + +plt.figure() +plt.subplot(231) +rm2.plotGrid() +plt.subplot(232) +rm3.plotGrid() +plt.subplot(233) +rm4.plotGrid() + +#%% +# We can plot the mesh in 3D! +pv = rm.pyvista_plotter() + +#%% +# We can plot the mesh in 3D! +mesh = rm.pyvista_mesh().save('rm3d_re3.vtk') + +with h5py.File('rm3d.h5', 'w') as f: + rm.toHdf(f, 'test') + +with h5py.File('rm3d.h5', 'r') as f: + rm2 = RectilinearMesh3D.fromHdf(f['test']) + +rm2.pyvista_mesh().save('rm3d_read.vtk') + +plt.show() diff --git a/docs/_downloads/93b8636d5d11f2858e28438141a2ee46/plot_tempest_datapoint.ipynb b/docs/_downloads/93b8636d5d11f2858e28438141a2ee46/plot_tempest_datapoint.ipynb new file mode 100644 index 00000000..13661db0 --- /dev/null +++ b/docs/_downloads/93b8636d5d11f2858e28438141a2ee46/plot_tempest_datapoint.ipynb @@ -0,0 +1,230 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Tempest Datapoint Class\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Credits:\nWe would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller\nhttps://github.com/GeoscienceAustralia/ga-aem\n\nFor ground-based time domain data, we are using Dieter Werthmuller's python package Empymod\nhttps://empymod.github.io/\n\nThanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from os.path import join\nimport numpy as np\nimport h5py\nimport matplotlib.pyplot as plt\nfrom geobipy import TempestData\n# from geobipy import TemDataPoint\nfrom geobipy import RectilinearMesh1D\nfrom geobipy import Model\nfrom geobipy import StatArray\nfrom geobipy import Distribution\nfrom geobipy import get_prng\n\ndataFolder = \"..//..//supplementary//data//\"\n# dataFolder = \"source//examples//supplementary//Data\"\n\n# Obtaining a tempest datapoint from a dataset\n# ++++++++++++++++++++++++++++++++++++++++++++\n# More often than not, our observed data is stored in a file on disk.\n# We can read in a dataset and pull datapoints from it.\n#\n# For more information about the time domain data set, see :ref:`Time domain dataset`\n\n# The data file name\ndataFile = dataFolder + 'tempest_saline_clay.csv'\n# The EM system file name\nsystemFile = dataFolder + 'Tempest.stm'\n\n# Prepare the dataset so that we can read a point at a time.\nDataset = TempestData._initialize_sequential_reading(dataFile, systemFile)\n# Get a datapoint from the file.\ntdp = Dataset._read_record(0)\n\nplt.figure()\ntdp.plot()\n\nprng = get_prng(seed=146100583096709124601953385843316024947)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using a tempest domain datapoint\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can define a 1D layered earth model, and use it to predict some data\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "par = StatArray(np.r_[0.01, 0.1, 1.], \"Conductivity\", \"$\\frac{S}{m}$\")\nmod = Model(mesh=RectilinearMesh1D(edges=np.r_[0.0, 50.0, 75.0, np.inf]), values=par)\n\npar = StatArray(np.logspace(-3, 3, 30), \"Conductivity\", \"$\\frac{S}{m}$\")\ne = np.linspace(0, 350, 31); e[-1] = np.inf\nmod = Model(mesh=RectilinearMesh1D(edges=e), values=par)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Forward model the data\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "tdp.forward(mod)\n\nprint('primary', tdp.primary_field)\nprint('sx', tdp.secondary_field[:15])\nprint('sz', tdp.secondary_field[15:])\n\n# #%%\n# plt.figure()\n# plt.subplot(121)\n# _ = mod.pcolor(transpose=True)\n# plt.subplot(122)\n# _ = tdp.plot()\n# _ = tdp.plot_predicted()\n# plt.tight_layout()\n# plt.suptitle('Model and response')\n\n# #%%\n# # plt.figure()\n# # tdp.plotDataResidual(xscale='log')\n# # plt.title('data residual')\n\n# #%%\n# # Compute the sensitivity matrix for a given model\nJ = tdp.sensitivity(mod)\n# plt.figure()\n# _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True)\n\nprint('J', J)\n# print('J shape', J.shape)\n# print('sx 0', J[:16, 0])\n\ntdp.fm_dlogc(mod)\n\nprint('new primary', tdp.primary_field)\nprint('sx', tdp.secondary_field[:15])\nprint('sz', tdp.secondary_field[15:])\n\nprint('new J', tdp.sensitivity_matrix)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Attaching statistical descriptors to the tempest datapoint\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from numpy.random import Generator\nfrom numpy.random import PCG64DXSM\ngenerator = PCG64DXSM(seed=0)\nprng = Generator(generator)\n\n# Set relative errors for the primary fields, and secondary fields.\ntdp.relative_error = np.r_[0.001, 0.001]\n\n# Set the additive errors for\ntdp.additive_error = np.hstack([[0.011474, 0.012810, 0.008507, 0.005154, 0.004742, 0.004477, 0.004168, 0.003539, 0.003352, 0.003213, 0.003161, 0.003122, 0.002587, 0.002038, 0.002201],\n [0.007383, 0.005693, 0.005178, 0.003659, 0.003426, 0.003046, 0.003095, 0.003247, 0.002775, 0.002627, 0.002460, 0.002178, 0.001754, 0.001405, 0.001283]])\n# Define a multivariate log normal distribution as the prior on the predicted data.\ntdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This allows us to evaluate the likelihood of the predicted data\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(tdp.likelihood(log=True))\n# Or the misfit\nprint(tdp.data_misfit())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Plot the misfits for a range of half space conductivities\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(1, 2, 1)\n_ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200)\nplt.title(\"Halfspace responses\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can perform a quick search for the best fitting half space\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "halfspace = tdp.find_best_halfspace()\nprint('Best half space conductivity is {} $S/m$'.format(halfspace.values))\nplt.subplot(1, 2, 2)\n_ = tdp.plot()\n_ = tdp.plot_predicted()\n\nplt.figure()\ntdp.plot_secondary_field()\ntdp.plot_predicted_secondary_field()\n\n# #%%\n# # We can attach priors to the height of the datapoint,\n# # the relative error multiplier, and the additive error noise floor\n\n# Define the distributions used as priors.\nrelative_prior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng)\nreceiver_x_prior = Distribution('Uniform', min=np.float64(tdp.receiver.x) - 1.0, max=np.float64(tdp.receiver.x) + 1.0, prng=prng)\nreceiver_z_prior = Distribution('Uniform', min=np.float64(tdp.receiver.z) - 1.0, max=np.float64(tdp.receiver.z) + 1.0, prng=prng)\nreceiver_pitch_prior = Distribution('Uniform', min=tdp.receiver.pitch - 5.0, max=tdp.receiver.pitch + 5.0, prng=prng)\ntdp.set_priors(relative_error_prior=relative_prior, receiver_x_prior=receiver_x_prior, receiver_z_prior=receiver_z_prior, receiver_pitch_prior=receiver_pitch_prior, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to perturb our solvable parameters, we need to attach proposal distributions\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "relative_proposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-4, prng=prng)\nreceiver_x_proposal = Distribution('Normal', mean=tdp.receiver.x, variance = 0.01, prng=prng)\nreceiver_z_proposal = Distribution('Normal', mean=tdp.receiver.z, variance = 0.01, prng=prng)\nreceiver_pitch_proposal = Distribution('Normal', mean=tdp.receiver.pitch, variance = 0.01, prng=prng)\ntdp.set_proposals(relative_error_proposal=relative_proposal,\n receiver_x_proposal=receiver_x_proposal,\n receiver_z_proposal=receiver_z_proposal,\n receiver_pitch_proposal=receiver_pitch_proposal,\n solve_additive_error=True, additive_error_proposal_variance=1e-4, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With priors set we can auto generate the posteriors\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "tdp.set_posteriors()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Perturb the datapoint and record the perturbations\nNote we are not using the priors to accept or reject perturbations.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i in range(10):\n tdp.perturb()\n tdp.update_posteriors()\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/93e086b68a2d08aac2f637ab24f17e8a/plot_histogram_3d.ipynb b/docs/_downloads/93e086b68a2d08aac2f637ab24f17e8a/plot_histogram_3d.ipynb new file mode 100644 index 00000000..ac06c586 --- /dev/null +++ b/docs/_downloads/93e086b68a2d08aac2f637ab24f17e8a/plot_histogram_3d.ipynb @@ -0,0 +1,310 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Histogram 3D\n\nThis 3D histogram class allows efficient updating of histograms, plotting and\nsaving as HDF5.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import geobipy\nfrom geobipy import StatArray\nfrom geobipy import Histogram\nimport matplotlib.pyplot as plt\nfrom geobipy import RectilinearMesh3D\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create some histogram bins in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.linspace(-4.0, 4.0, 11), 'Variable 1')\ny = StatArray(np.linspace(-4.0, 4.0, 21), 'Variable 2')\nz = StatArray(np.linspace(-4.0, 4.0, 31), 'Variable 3')\n\nmesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh=mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate some random numbers\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = np.random.randn(100000)\nb = np.random.randn(100000)\nc = np.random.randn(100000)\n# x = np.asarray([a, b, c])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Update the histogram counts\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(a, b, c)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Slice half way along each dimension\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n s = [5 if i == axis else np.s_[:] for i in range(3)]\n _ = H[tuple(s)].pcolor(cmap='gray_r')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate marginal histograms along an axis\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Marginals along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.marginalize(axis=axis).plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the mean estimate from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Mean along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.mean(axis=axis).pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the median estimate from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Median along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.median(axis=axis).pcolor()\n\n# #%%\n# # We can map the credible range to an opacity or transparency\n# H.opacity()\n# H.transparency()\n\nH.animate(0, 'test.mp4')\n\nH.to_vtk('h3d.vtk')\n\n\n\n\n# Create some histogram bins in x and y\nxx, yy = np.meshgrid(mesh.z.centres, mesh.y.centres)\nx_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"x_re\")\n\nxx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres)\ny_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"y_re\")\n\nxx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)\nz_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"z_re\")\n\nmesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Instantiate\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H = Histogram(mesh=mesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate some random numbers\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = np.random.randn(100000)\nb = np.random.randn(100000)\nc = np.random.randn(100000)\n# x = np.asarray([a, b, c])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Update the histogram counts\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H.update(a, b, c)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Slice half way along each dimension\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n s = [5 if i == axis else np.s_[:] for i in range(3)]\n _ = H[tuple(s)].pcolor(cmap='gray_r')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generate marginal histograms along an axis\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Marginals along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.marginalize(axis=axis).plot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the mean estimate from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Mean along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.mean(axis=axis).pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the median estimate from the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.suptitle(\"Median along each axis\")\nfor axis in range(3):\n plt.subplot(1, 3, axis+1)\n _ = H.median(axis=axis).pcolor()\n\n# #%%\n# # We can map the credible range to an opacity or transparency\n# H.opacity()\n# H.transparency()\n\nH.animate(0, 'test.mp4')\n\nplt.show()\n\nH.to_vtk('h3d.vtk')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/950360871c2acdf8ad1b1627e54009da/plot_resolve_datapoint.py b/docs/_downloads/950360871c2acdf8ad1b1627e54009da/plot_resolve_datapoint.py new file mode 100644 index 00000000..43036ab4 --- /dev/null +++ b/docs/_downloads/950360871c2acdf8ad1b1627e54009da/plot_resolve_datapoint.py @@ -0,0 +1,227 @@ +""" +Frequency domain datapoint +-------------------------- +""" +#%% +from os.path import join +import numpy as np +import h5py +import matplotlib.pyplot as plt +from geobipy import CircularLoops +from geobipy import FdemSystem +from geobipy import FdemData +from geobipy import FdemDataPoint +from geobipy import RectilinearMesh1D +from geobipy import Model +from geobipy import StatArray +from geobipy import Distribution + +# Instantiating a frequency domain data point +# +++++++++++++++++++++++++++++++++++++++++++ +# +# To instantiate a frequency domain datapoint we need to define some +# characteristics of the acquisition system. +# +# We need to define the frequencies in Hz of the transmitter, +# and the geometery of the loops used for each frequency. + +frequencies = np.asarray([380.0, 1776.0, 3345.0, 8171.0, 41020.0, 129550.0]) + +# Transmitter positions are defined relative to the observation locations in the data +# This is usually a constant offset for all data points. +transmitters = CircularLoops(orientation=['z','z','x','z','z','z'], + moment=np.r_[1, 1, -1, 1, 1, 1], + x = np.r_[0,0,0,0,0,0], + y = np.r_[0,0,0,0,0,0], + z = np.r_[0,0,0,0,0,0], + pitch = np.r_[0,0,0,0,0,0], + roll = np.r_[0,0,0,0,0,0], + yaw = np.r_[0,0,0,0,0,0], + radius = np.r_[1,1,1,1,1,1]) + +# Receiver positions are defined relative to the transmitter +receivers = CircularLoops(orientation=['z','z','x','z','z','z'], + moment=np.r_[1, 1, -1, 1, 1, 1], + x = np.r_[7.91, 7.91, 9.03, 7.91, 7.91, 7.89], + y = np.r_[0,0,0,0,0,0], + z = np.r_[0,0,0,0,0,0], + pitch = np.r_[0,0,0,0,0,0], + roll = np.r_[0,0,0,0,0,0], + yaw = np.r_[0,0,0,0,0,0], + radius = np.r_[1,1,1,1,1,1]) + +# Now we can instantiate the system. +fds = FdemSystem(frequencies, transmitters, receivers) + +# And use the system to instantiate a datapoint +# +# Note the extra arguments that can be used to create the data point. +# data is for any observed data one might have, while std are the estimated standard +# deviations of those observed data. +# +# Define some in-phase then quadrature data for each frequency. +data = np.r_[145.3, 435.8, 260.6, 875.1, 1502.7, 1516.9, + 217.9, 412.5, 178.7, 516.5, 405.7, 255.7] + +fdp = FdemDataPoint(x=0.0, y=0.0, z=30.0, elevation=0.0, + data=data, std=None, predictedData=None, + system=fds, lineNumber=0.0, fiducial=0.0) + +# plt.figure() +# _ = fdp.plot() + +# Obtaining a datapoint from a dataset +# ++++++++++++++++++++++++++++++++++++ +# +# More often than not, our observed data is stored in a file on disk. +# We can read in a dataset and pull datapoints from it. +# +# For more information about the frequency domain data set see :ref:`Frequency domain dataset` + +# Set some paths and file names +dataFolder = "..//..//supplementary//Data//" +# The data file name +dataFile = dataFolder + 'Resolve2.txt' +# The EM system file name +systemFile = dataFolder + 'FdemSystem2.stm' + +#%% +# Initialize and read an EM data set +# Prepare the dataset so that we can read a point at a time. +Dataset = FdemData._initialize_sequential_reading(dataFile, systemFile) +# Get a datapoint from the file. +fdp = Dataset._read_record() +#%% + +# # Initialize and read an EM data set +# D = FdemData.read_csv(dataFile,systemFile) + +# # Get a data point from the dataset +# fdp = D.datapoint(0) +# plt.figure() +# _ = fdp.plot() + +# Using a resolve datapoint +# +++++++++++++++++++++++++ + +# We can define a 1D layered earth model, and use it to predict some data +nCells = 19 +par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$") +depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm') +depth[-1] = np.inf +mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par) + +# Forward model the data +fdp.forward(mod) + +plt.figure() +plt.subplot(121) +_ = mod.pcolor(transpose=True) +plt.subplot(122) +_ = fdp.plot_predicted() +plt.tight_layout() + +# Compute the sensitivity matrix for a given model +J = fdp.sensitivity(mod) + +plt.figure() +_ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + +# Attaching statistical descriptors to the resolve datapoint +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +# Set values of relative and additive error for both systems. +fdp.relative_error = 0.05 +fdp.additive_error = 10.0 +# Define a multivariate log normal distribution as the prior on the predicted data. +fdp.predictedData.prior = Distribution('MvLogNormal', fdp.data[fdp.active], fdp.std[fdp.active]**2.0, prng=prng) + +# This allows us to evaluate the likelihood of the predicted data +print(fdp.likelihood(log=True)) +# Or the misfit +print(fdp.data_misfit()) + +# Plot the misfits for a range of half space conductivities +plt.figure() +_ = fdp.plotHalfSpaceResponses(-6.0, 4.0, 200) + +plt.title("Halfspace responses"); + +# We can perform a quick search for the best fitting half space +halfspace = fdp.find_best_halfspace() +print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) +plt.figure() +_ = fdp.plot() +_ = fdp.plot_predicted() + +# Compute the misfit between observed and predicted data +print(fdp.data_misfit()) + +# We can attach priors to the height of the datapoint, +# the relative error multiplier, and the additive error noise floor + + +# Define the distributions used as priors. +zPrior = Distribution('Uniform', min=np.float64(fdp.z) - 2.0, max=np.float64(fdp.z) + 2.0, prng=prng) +relativePrior = Distribution('Uniform', min=0.01, max=0.5, prng=prng) +additivePrior = Distribution('Uniform', min=5, max=15, prng=prng) +fdp.set_priors(z_prior=zPrior, relative_error_prior=relativePrior, additive_error_prior=additivePrior, prng=prng) + + +# In order to perturb our solvable parameters, we need to attach proposal distributions +z_proposal = Distribution('Normal', mean=fdp.z, variance = 0.01, prng=prng) +relativeProposal = Distribution('MvNormal', mean=fdp.relative_error, variance=2.5e-7, prng=prng) +additiveProposal = Distribution('MvLogNormal', mean=fdp.additive_error, variance=1e-4, prng=prng) +fdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal) + +# With priors set we can auto generate the posteriors +fdp.set_posteriors() + + +nCells = 19 +par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$") +depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm') +depth[-1] = np.inf +mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par) +fdp.forward(mod) + +# Perturb the datapoint and record the perturbations +for i in range(10): + fdp.perturb() + fdp.update_posteriors() + + +# Plot the posterior distributions +# fig = plt.figure() +fdp.plot_posteriors(overlay=fdp) + +import h5py +with h5py.File('fdp.h5', 'w') as f: + fdp.createHdf(f, 'fdp', withPosterior=True) + fdp.writeHdf(f, 'fdp', withPosterior=True) + +with h5py.File('fdp.h5', 'r') as f: + fdp1 = FdemDataPoint.fromHdf(f['fdp']) + +fdp1.plot_posteriors(overlay=fdp1) + +import h5py +with h5py.File('fdp.h5', 'w') as f: + fdp.createHdf(f, 'fdp', withPosterior=True, add_axis=np.arange(10.0)) + + for i in range(10): + fdp.writeHdf(f, 'fdp', withPosterior=True, index=i) + +from geobipy import FdemData +with h5py.File('fdp.h5', 'r') as f: + fdp1 = FdemDataPoint.fromHdf(f['fdp'], index=0) + fdp2 = FdemData.fromHdf(f['fdp']) + +fdp1.plot_posteriors(overlay=fdp1) + +plt.show() +# %% \ No newline at end of file diff --git a/docs/_downloads/9570534d71f4f6a00b8f20360000c3ff/plot_histogram_1d.py b/docs/_downloads/9570534d71f4f6a00b8f20360000c3ff/plot_histogram_1d.py new file mode 100644 index 00000000..10a7fc18 --- /dev/null +++ b/docs/_downloads/9570534d71f4f6a00b8f20360000c3ff/plot_histogram_1d.py @@ -0,0 +1,156 @@ +""" +Histogram 1D +------------ + +This histogram class allows efficient updating of histograms, plotting and +saving as HDF5 +""" + +#%% +from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D +import h5py +from geobipy import StatArray +from geobipy import Histogram +import numpy as np +import matplotlib.pyplot as plt + +#%% +# Histogram with regular bins +# +++++++++++++++++++++++++++ + +# Create regularly spaced bins +mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm')) + +#%% +# Set the histogram using the bins, and update +H = Histogram(mesh=mesh) + +#%% +# We can update the histogram with some new values +H.update(np.random.randn(1000), trim=True) + +# Plot the histogram +plt.figure() +plt.subplot(221) +_ = H.plot() +plt.subplot(222) +_ = H.pdf.bar() +plt.subplot(223) +H.pmf.bar() +plt.subplot(224) +H.cdf().bar() + +#%% +# Get the median, and 95% confidence values +print(H.credible_intervals(percent=95.0)) + +plt.figure() +H.plot() +H.plotCredibleIntervals() +H.plotMean() +H.plotMedian() + +#%% +# Histogram with irregular bins +# +++++++++++++++++++++++++++++ + +# Create irregularly spaced bins +x = np.cumsum(np.arange(10, dtype=np.float64)) +irregularBins = np.hstack([-x[::-1], x[1:]]) + +#%% +# Create a named StatArray +edges = StatArray(irregularBins, 'irregular bins') +mesh = RectilinearMesh1D(edges = edges) + +#%% +# Instantiate the histogram with bin edges +H = Histogram(mesh=mesh) + +# Update the histogram +H.update((np.random.randn(10000)*20.0) - 10.0) + +#%% +# Plot the histogram +plt.figure() +plt.subplot(211) +_ = H.plot() +plt.subplot(212) +_ = H.plot(normalize=True) + +plt.figure() +H.plot() +H.plotCredibleIntervals() +H.plotMean() +H.plotMedian() + +#%% +# We can plot the histogram as a pcolor plot +plt.figure() +_ = H.pcolor(grid=True, transpose=True) + +#%% +# Histogram with linear space entries that are logged internally +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# Create some bins spaced logarithmically +mesh = RectilinearMesh1D(edges = StatArray(np.logspace(-5, 3), 'positive bins'), log=10) + +#%% +# Instantiate the Histogram with log=10 +H = Histogram(mesh) + +#%% +# The update takes in the numbers in linear space and takes their log=10 +H.update(10.0**(np.random.randn(1000)*2.0), trim=True) + +#%% +plt.figure() +plt.subplot(211) +_ = H.plot() + +import h5py +with h5py.File('h1d.h5', 'w') as f: + H.toHdf(f, 'h1d') + +with h5py.File('h1d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h1d']) + +plt.subplot(212) +_ = H1.plot() + + +#%% +mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm')) +#%% +# Set the histogram using the bins, and update +H = Histogram(mesh=mesh) + +#%% +# We can update the histogram with some new values +H.update(np.random.randn(1000), trim=True) + +import h5py +with h5py.File('h1d.h5', 'w') as f: + H.createHdf(f, 'h1d', add_axis=StatArray(np.arange(3.0), "Name", "Units")) + H.writeHdf(f, 'h1d', index=0) + H.update(np.random.randn(1000), trim=True) + H.writeHdf(f, 'h1d', index=1) + H.update(np.random.randn(1000), trim=True) + H.writeHdf(f, 'h1d', index=2) + +with h5py.File('h1d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h1d']) + H2 = Histogram.fromHdf(f['h1d'], index=0) + H3 = Histogram.fromHdf(f['h1d'], index=1) + H4 = Histogram.fromHdf(f['h1d'], index=2) + + +print(H4.summary) + +# plt.figure() +# plt.subplot(211) +# _ = H1.plot() +# plt.subplot(212) +# _ = H4.plot() + +plt.show() \ No newline at end of file diff --git a/docs/_downloads/a209de4dae1a6f3f3daeab70fe6f557a/plot_inference_1d_skytem.py b/docs/_downloads/a209de4dae1a6f3f3daeab70fe6f557a/plot_inference_1d_skytem.py new file mode 100644 index 00000000..6de56cec --- /dev/null +++ b/docs/_downloads/a209de4dae1a6f3f3daeab70fe6f557a/plot_inference_1d_skytem.py @@ -0,0 +1,89 @@ +""" +Running GeoBIPy to invert Skytem data +++++++++++++++++++++++++++++++++++++++ +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + +data_type = "Skytem_512" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +supplementary = "..//..//supplementary//" +parameter_file = supplementary + "//options_files//{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' +kwargs['system_filename'] = [supplementary + "//data//" + x for x in kwargs['system_filename']] + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=2, **kwargs) \ No newline at end of file diff --git a/docs/_downloads/b65392b576618a906ad35b58f026489b/plot_model_2d.py b/docs/_downloads/b65392b576618a906ad35b58f026489b/plot_model_2d.py new file mode 100644 index 00000000..bf428207 --- /dev/null +++ b/docs/_downloads/b65392b576618a906ad35b58f026489b/plot_model_2d.py @@ -0,0 +1,56 @@ +""" +2D Rectilinear Model +-------------------- +This 2D rectilinear model defines a grid with straight cell boundaries. + +""" + +#%% +from geobipy import StatArray +from geobipy import RectilinearMesh2D +from geobipy import Model +import h5py +import matplotlib.pyplot as plt +import numpy as np + + +#%% +# Specify some cell centres in x and y +x = StatArray(np.arange(11.0), 'Easting', 'm') +y = StatArray(np.arange(11.0), 'Northing', 'm') +mesh = RectilinearMesh2D(x_edges=x, y_edges=y) + +xx, yy = np.meshgrid(mesh.x.centres, mesh.y.centres) +values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values") + +mod = Model(mesh=mesh, values = values) + +plt.figure() +mod.pcolor() + +mod2 = mod.resample(0.5, 0.5) +mod3 = mod.resample(1.5, 1.5) +plt.figure() +plt.subplot(121) +mod2.pcolor() +plt.axis('equal') +plt.subplot(122) +mod3.pcolor() +plt.axis('equal') + + +# #%% +# # We can plot the mesh in 3D! +# pv = rm.pyvista_plotter() +# pv.show() + +# rm.to_vtk('Model3D.vtk') + +with h5py.File('Model2D.h5', 'w') as f: + mod.toHdf(f, 'model') + +with h5py.File('Model2D.h5', 'r') as f: + mod2 = Model.fromHdf(f['model']) + + +plt.show() \ No newline at end of file diff --git a/docs/_downloads/b7483b08f4f927c644b97f4bf2cf523c/plot_rectilinear_mesh_3d.ipynb b/docs/_downloads/b7483b08f4f927c644b97f4bf2cf523c/plot_rectilinear_mesh_3d.ipynb new file mode 100644 index 00000000..ee483f70 --- /dev/null +++ b/docs/_downloads/b7483b08f4f927c644b97f4bf2cf523c/plot_rectilinear_mesh_3d.ipynb @@ -0,0 +1,202 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# 3D Rectilinear Mesh\nThis 3D rectilinear mesh defines a grid with straight cell boundaries.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import StatArray\nfrom geobipy import RectilinearMesh3D\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport h5py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Specify some cell centres in x and y\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.arange(10.0), 'Easting', 'm')\ny = StatArray(np.arange(15.0), 'Northing', 'm')\nz = StatArray(np.arange(20.0), 'Depth', 'm')\n\nrm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)\n\nrm1 = rm[:5, :5, :5]\nrm2 = rm[:, :, 5]\nrm3 = rm[:, 5, :]\nrm4 = rm[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nrm2.plotGrid()\nplt.subplot(232)\nrm3.plotGrid()\nplt.subplot(233)\nrm4.plotGrid()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "rm2 = rm[:, 5, 5]\nrm3 = rm[5, :, 5]\nrm4 = rm[5, 5, :]\n\nplt.subplot(234)\nrm2.plotGrid()\nplt.subplot(235)\nrm3.plotGrid()\nplt.subplot(236)\nrm4.plotGrid()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with h5py.File('rm3d.h5', 'w') as f:\n rm.createHdf(f, 'test')\n rm.writeHdf(f, 'test')\n\nwith h5py.File('rm3d.h5', 'r') as f:\n rm2 = RectilinearMesh3D.fromHdf(f['test'])\n\nrm.pyvista_mesh().save('rm3d.vtk')\n\n\nxx, yy = np.meshgrid(rm.y.centres, rm.x.centres)\nz_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"z_re\")\nrm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re)\n\nrm1 = rm[:5, :5, :5]\nrm2 = rm[:, :, 5]\nrm3 = rm[:, 5, :]\nrm4 = rm[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nrm2.plotGrid()\nplt.subplot(232)\nrm3.plotGrid()\nplt.subplot(233)\nrm4.plotGrid()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = rm.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mesh = rm.pyvista_mesh().save('rm3d_re1.vtk')\n\n\nx_re = StatArray(np.sin(np.repeat(rm.y.centres[:, None], rm.z.nCells, 1)), \"x_re\")\n\nxx, yy = np.meshgrid(rm.y.centres, rm.x.centres)\nz_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"z_re\")\nrm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re)\n\nrm1 = rm[:5, :5, :5]\nrm2 = rm[:, :, 5]\nrm3 = rm[:, 5, :]\nrm4 = rm[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nrm2.plotGrid()\nplt.subplot(232)\nrm3.plotGrid()\nplt.subplot(233)\nrm4.plotGrid()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = rm.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mesh = rm.pyvista_mesh().save('rm3d_re2.vtk')\n\n\nxx, yy = np.meshgrid(rm.z.centres, rm.y.centres)\nx_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"x_re\")\n\nxx, yy = np.meshgrid(rm.z.centres, rm.x.centres)\ny_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"y_re\")\n\nxx, yy = np.meshgrid(rm.y.centres, rm.x.centres)\nz_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), \"z_re\")\nrm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)\n\nrm1 = rm[:5, :5, :5]\nrm2 = rm[:, :, 5]\nrm3 = rm[:, 5, :]\nrm4 = rm[5, :, :]\n\nplt.figure()\nplt.subplot(231)\nrm2.plotGrid()\nplt.subplot(232)\nrm3.plotGrid()\nplt.subplot(233)\nrm4.plotGrid()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pv = rm.pyvista_plotter()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot the mesh in 3D!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mesh = rm.pyvista_mesh().save('rm3d_re3.vtk')\n\nwith h5py.File('rm3d.h5', 'w') as f:\n rm.toHdf(f, 'test')\n\nwith h5py.File('rm3d.h5', 'r') as f:\n rm2 = RectilinearMesh3D.fromHdf(f['test'])\n\nrm2.pyvista_mesh().save('rm3d_read.vtk')\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip b/docs/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip new file mode 100644 index 00000000..dbbef119 Binary files /dev/null and b/docs/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip differ diff --git a/docs/_downloads/c50f5c5fdb1ab3a85236c34d440144a2/plot_inference_1d_resolve.py b/docs/_downloads/c50f5c5fdb1ab3a85236c34d440144a2/plot_inference_1d_resolve.py new file mode 100644 index 00000000..d8904ecb --- /dev/null +++ b/docs/_downloads/c50f5c5fdb1ab3a85236c34d440144a2/plot_inference_1d_resolve.py @@ -0,0 +1,87 @@ +""" +Running GeoBIPy to invert Resolve data +-------------------------------------- +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + +data_type = "Resolve" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +parameter_file = "../../supplementary/options_files/{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=2, **kwargs) \ No newline at end of file diff --git a/docs/_downloads/e43324a965564fecaa251424c676fc0e/plot_StatArray.ipynb b/docs/_downloads/e43324a965564fecaa251424c676fc0e/plot_StatArray.ipynb new file mode 100644 index 00000000..dbc32f10 --- /dev/null +++ b/docs/_downloads/e43324a965564fecaa251424c676fc0e/plot_StatArray.ipynb @@ -0,0 +1,1082 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# StatArray Class\n\nExtends the numpy ndarray class to add extra attributes such as names, and\nunits, and allows us to attach statistical descriptors of the array.\nThe direct extension to numpy maintains speed and functionality of numpy arrays.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import StatArray\nfrom geobipy import Histogram\nfrom geobipy import Distribution\nfrom geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\n\n# plt.style.use('seaborn-pastel')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Instantiating a new StatArray class\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Integer\ntest = StatArray(1, name='1')\nprint(test.summary)\ntest = StatArray(10, name='10')\nprint(test.summary)\n# tuple/Shape\ntest = StatArray((2, 10), name='(2, 10)')\nprint(test.summary)\n\n# float\ntest = StatArray(45.454, name='45.454')\nprint(test.summary)\ntest = StatArray(np.float64(45.454), name='45.454')\nprint(test.summary)\n\n# complex\n# test = StatArray(np.complex(0.0, 1.0), name='complex(0, 1)')\n\n# array\nDensity = StatArray(np.random.randn(1), name=\"Density\", units=\"$\\frac{g}{cc}$\")\nprint(Density.summary)\n\n# The StatArray can take any numpy function that returns an array as an input.\n# The name and units of the variable can be assigned to the StatArray." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Attaching Prior and Proposal Distributions to a StatArray\n\nThe StatArray class has been built so that we may easily\nattach not only names and units, but statistical distributions too.\nWe won't go into too much detail about the different distribution\nclasses here so check out the `Distribution Class` for a better description.\n\nTwo types of distributions can be attached to the StatArray.\n\n* Prior Distribution\n The prior represents how the user believes the variable should\n behave from a statistical standpoint.\n The values of the variable can be evaluated against the attached prior,\n to determine how likely they are to have occured https://en.wikipedia.org/wiki/Prior_probability\n\n* Proposal Distribution\n The proposal describes a probability distribution from which to\n sample when we wish to perturb the variable\n https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Obtain an instantiation of a random number generator.\n# This is optional, but is an important consideration for parallel programming.\nfrom numpy.random import Generator\nfrom numpy.random import PCG64DXSM\ngenerator = PCG64DXSM(seed=0)\nprng = Generator(generator)\n\nDensity.prior = Distribution('Uniform', -2.0, 2.0, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also attach a proposal distribution\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density.proposal = Distribution('Normal', 0.0, 1.0, prng=prng)\nprint(Density.summary)\nprint(\"Class type of the prior: \",type(Density.prior))\nprint(\"Class type of the proposal: \",type(Density.proposal))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The values in the variable can be evaluated against the prior.\nIn this case, we have 3 elements in the variable, and a univariate Normal for the prior.\nTherefore each element is evaluated to get 3 probabilities, one for each element.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(Density.probability(log=False))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The univariate proposal distribution can generate random samples from itself.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(Density.propose())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From a sampling stand point we can either sample using only the proposal\nOr we can only generate samples that simultaneously satisfy the prior.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(Density.propose(relative=True))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can perturb the variable by drawing from the attached proposal distribution.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density.perturb()\nprint(Density.summary)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Attaching a Histogram to capture the posterior distribution\nThe StatArray can perturb itself, evaluate its current probability given its priors\nand a histogram can be attached to capture its posterior distribution.\nAs an example, lets create a Histogram class with bins generated from the prior.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "bins = Density.prior.bins()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Attach the histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density.posterior = Histogram(mesh = RectilinearMesh1D(edges=bins))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In an iterative sense, we can propose and evaluate new values, and update the posterior\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i in range(1000):\n Density.perturb()\n p = Density.probability(log=False)\n\n if p > 0.0: # This is a simple example!\n Density.update_posterior()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nDensity.summaryPlot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Attach a multivariate normal distribution as the prior and proposal\n\nAttach the multivariate prior\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mean = np.random.randn(Density.size)\nvariance = np.ones(Density.size)\nDensity.prior = Distribution('MvNormal', mean, variance, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Since the prior is multivariate, the appropriate equations are used to\nevaluate the probability for all elements in the StatArray.\nThis produces a single probability.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(Density.probability(log=False))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Attach the multivariate proposal\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mean = np.random.randn(Density.size)\nvariance = np.ones(Density.size)\nDensity.proposal = Distribution('MvNormal', mean, variance, prng=prng)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Perturb the variables using the multivariate proposal.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density.perturb()\nDensity.summary\n\nwith h5py.File('statarray.h5', 'w') as f:\n Density.createHdf(f, 'statarray', withPosterior=True, add_axis=3)\n Density.writeHdf(f, 'statarray', withPosterior=True, index=0)\n\nwith h5py.File('statarray.h5', 'r') as f:\n tmp = StatArray.fromHdf(f, 'statarray', index=0, skip_posterior=False)\n\nwith h5py.File('statarray.h5', 'r') as f:\n tmp = StatArray.fromHdf(f, 'statarray', skip_posterior=False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Basic manipulation\n\nThe StatArray contains other functions to perform basic array manipulations\n\nThese routines essentially wrap around numpy functions,\nbut the result will have the same name and units,\nand if any prior or proposal are set, those will be carried through too.\n\n### 1D example\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(-np.cumsum(np.arange(10.0)))\nprint(x)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.insert(i=[0, 9], values=[999.0, 999.0]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.prepend(999.0))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.prepend([998.0, 999.0]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.append([998.0, 999.0]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.resize(14))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.delete([5,8]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.edges())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.internalEdges())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.firstNonZero())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.lastNonZero())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.abs())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2D example\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray(np.asarray([[0, -2, 3],[3, 0, -1],[1, 2, 0]]))\nprint(x)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.insert(i=0, values=4))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.insert(i=[2, 3], values=5, axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.insert(i=2, values=[10, 11, 12], axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.prepend(999))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.prepend([999, 998, 997], axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.append([[999, 998, 997]]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.resize([5,5]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.delete(5))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.delete(2, axis=0))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.firstNonZero(axis=0))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.lastNonZero(axis=0))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.firstNonZero(axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.lastNonZero(axis=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(x.abs())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting\n\nWe can easily plot the StatArray with its built in plotting functions.\nAll plotting functions can take matplotlib keywords\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# The simplest is to just plot the array\n\nDensity = StatArray(np.random.randn(100),name=\"Density\",units=\"$\\frac{g}{cc}$\")\nTime = StatArray(np.linspace(0, 100, Density.size), name='Time', units='s')\nDepth = StatArray(np.random.exponential(size=Density.size), name='Depth', units='m')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.plot(linewidth=0.5, marker='x', markersize=1.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can quickly plot a bar graph.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.bar()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can scatter the contents of the StatArray if it is 1D\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.scatter(alpha=0.7)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Histogram Equalization\n\nA neat trick with colourmaps is histogram equalization.\nThis approach forces all colours in the images to have an equal weight.\nThis distorts the colour bar, but can really highlight the lower and higher\nends of whatever you are plotting. Just add the equalize keyword!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.scatter(alpha=0.7, equalize=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Take the log base(x) of the data\n\nWe can also take the data to a log, log10, log2, or a custom number!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.scatter(alpha=0.7,edgecolor='k',log='e') # could also use log='e', log=2, log=x) where x is the base you require" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "X and Y axes\n\nWe can specify the x axis of the scatter plot.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.scatter(x=Time, alpha=0.7, edgecolor='k')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Notice that I never specified the y axis, so the y axis defaulted to the values in the StatArray.\nIn this case, any operations applied to the colours, are also applied to the y axis, e.g. log=10.\nWhen I take the values of Density to log base 10, because I do not specify the y plotting locations, those locations are similarly affected.\n\nI can however force the y co-ordinates by specifying it as input.\nIn the second subplot I explicitly plot distance on the y axis.\nIn the first subplot, the y axis is the same as the colourbar.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nax1 = plt.subplot(211)\nDensity.scatter(x=Time, alpha=0.7, edgecolor='k', log=10)\nplt.subplot(212, sharex=ax1)\n_ = Density.scatter(x=Time, y=Depth, alpha=0.7, edgecolor='k', log=10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Point sizes\n\nSince the plotting functions take matplotlib keywords, I can also specify the size of each points.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "s = np.ceil(100*(np.abs(np.random.randn(Density.size))))\nplt.figure()\nplt.tight_layout()\nax1 = plt.subplot(211)\nDensity.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=2)\nplt.subplot(212, sharex=ax1)\n#Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', sizeLegend=[1.0, 100, 200, 300])\nv = np.abs(Density)+1.0\n_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=[1.0, 100, 200, 300], log=10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Of course we can still take the log, or equalize the colour histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k',equalize=True,log=10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Typically pcolor only works with 2D arrays. The StatArray has a pcolor method that will pcolor a 1D array\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(221)\nDensity.pcolor()\nplt.subplot(222)\nDensity.pcolor(y=Time)\nplt.subplot(223)\nDensity.pcolor(y=Time, flip=True)\nplt.subplot(224)\n_ = Density.pcolor(y=Time, log=10, equalize=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can add grid lines, and add opacity to each element in the pcolor image\n\nThis is useful if the colour values need to be scaled by another variable e.g. variance.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nplt.subplot(121)\nDensity.pcolor(grid=True, cmap='jet')\nplt.subplot(122)\na = np.linspace(1.0, 0.0, Density.size)\n_ = Density.pcolor(grid=True, alpha=a, cmap='jet')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot a histogram of the StatArray\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.hist(100)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can write the StatArray to a HDF5 file. HDF5 files are binary files that can include compression. They allow quick and easy access to parts of the file, and can also be written to and read from in parallel!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with h5py.File('1Dtest.h5','w') as f:\n Density.toHdf(f,'test')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then read the StatArray from the file\nHere x is a new variable, that is read in from the hdf5 file we just wrote.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "x = StatArray.fromHdf('1Dtest.h5', 'test')\nprint('x has the same values as Density? ',np.all(x == Density))\nx[2] = 5.0 # Change one of the values in x\nprint('x has its own memory allocated (not a reference/pointer)? ', id(x) != id(Density))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also define a 2D array\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density = StatArray(np.random.randn(50,100),\"Density\",\"$\\frac{g}{cc}$\")\nDensity.summary" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The StatArray Class's functions work whether it is 1D or 2D\n\nWe can still do a histogram\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.hist()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And we can use pcolor to plot the 2D array\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.pcolor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The StatArray comes with extra plotting options\n\nHere we specify the x and y axes for the 2D array using two other 1D StatArrays\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nx = StatArray(np.arange(101),name='x Axis',units = 'mm')\ny = StatArray(np.arange(51),name='y Axis',units = 'elephants')\n_ = Density.pcolor(x=x, y=y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can plot using a log10 scale, in this case, we have values that are less\nthan or equal to 0.0. Plotting with the log option will by default mask any\nof those values, and will let you know that it has done so!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.pcolor(x=x,y=y,log=2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A neat trick with colourmaps is histogram equalization.\nThis approach forces all colours in the image to have an equal amount.\nThis distorts the colours, but can really highlight the lower and higher\nends of whatever you are plotting\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.pcolor(x=x, y=y, equalize=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can equalize the log10 plot too :)\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\n_ = Density.pcolor(x=x,y=y,equalize=True, log=10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can add opacity to each pixel in the image\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "a = StatArray(np.random.random(Density.shape), 'Opacity from 0.0 to 1.0')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.figure()\nax1 = plt.subplot(131)\nax = Density.pcolor(x=x, y=y, flipY=True, linewidth=0.1, colorbar=False)\nplt.subplot(132, sharex=ax1, sharey=ax1)\nax = Density.pcolor(x=x, y=y, alpha=a, flipY=True, linewidth=0.1, colorbar=False)\nplt.subplot(133, sharex=ax1, sharey=ax1)\n_ = a.pcolor(x=x, y=y, flipY=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If the array potentially has a lot of white space around the edges, we can trim the image\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "Density[:10, :] = 0.0\nDensity[-10:, :] = 0.0\nDensity[:, :10] = 0.0\nDensity[:, -10:] = 0.0\nplt.figure()\nplt.subplot(121)\nDensity.pcolor()\nplt.subplot(122)\n_ = Density.pcolor(trim=0.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create a stacked area plot of a 2D StatArray\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "A = StatArray(np.abs(np.random.randn(13,100)), name='Variable', units=\"units\")\nx = StatArray(np.arange(100),name='x Axis',units = 'mm')\nplt.figure()\nax1 = plt.subplot(211)\nA.stackedAreaPlot(x=x, axis=1)\nplt.subplot(212, sharex=ax1)\n_ = A.stackedAreaPlot(x=x, i=np.s_[[1,3,4],:], axis=1, labels=['a','b','c'])\n\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/e7cc18385c0a8722277c7651cb3e9fdb/plot_inference_1d_tempest.py b/docs/_downloads/e7cc18385c0a8722277c7651cb3e9fdb/plot_inference_1d_tempest.py new file mode 100644 index 00000000..87823af0 --- /dev/null +++ b/docs/_downloads/e7cc18385c0a8722277c7651cb3e9fdb/plot_inference_1d_tempest.py @@ -0,0 +1,90 @@ +""" +Running GeoBIPy to invert Tempest data +++++++++++++++++++++++++++++++++++++++ +""" + +import os +import sys +import pathlib +from datetime import timedelta +import time +import numpy as np +from geobipy import Inference3D +from geobipy import user_parameters +from geobipy import get_prng + +def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + +#%% +np.random.seed(0) + +args = checkCommandArguments() +sys.path.append(os.getcwd()) + +models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + +data_type = "Tempest" +model_type = models[args.index] + +#%% +# The directory where HDF files will be stored +#%% +file_path = os.path.join(data_type, model_type) +pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + +for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + +output_directory = file_path + +data_filename = data_type + '_' + model_type + +supplementary = "..//..//supplementary//" + +parameter_file = supplementary + "//options_files//{}_options".format(data_type) +inputFile = pathlib.Path(parameter_file) +assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + +output_directory = pathlib.Path(output_directory) +assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + +print('Using user input file {}'.format(parameter_file)) +print('Output files will be produced at {}'.format(output_directory)) + +kwargs = user_parameters.read(inputFile) + +kwargs['n_markov_chains'] = 5000 + +kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' +kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename'] + +# Everyone needs the system classes read in early. +data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + +# Start keeping track of time. +t0 = time.time() + +seed = 146100583096709124601953385843316024947 +prng = get_prng(seed=seed) + +inference3d = Inference3D(data, prng=prng) +inference3d.create_hdf5(directory=output_directory, **kwargs) + +print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + +inference3d.infer(index=2, **kwargs) diff --git a/docs/_downloads/ec453d00c4b1863c6db7fb665ba67ecb/plot_distributions.py b/docs/_downloads/ec453d00c4b1863c6db7fb665ba67ecb/plot_distributions.py new file mode 100644 index 00000000..9fc321db --- /dev/null +++ b/docs/_downloads/ec453d00c4b1863c6db7fb665ba67ecb/plot_distributions.py @@ -0,0 +1,48 @@ +""" +Distribution Class +++++++++++++++++++ + +Handles the initialization of different statistical distribution +""" + +#%% +from geobipy import Distribution +from geobipy import plotting as cP +import matplotlib.pyplot as plt +import numpy as np + +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +#%% +# Univariate Normal Distribution +# ++++++++++++++++++++++++++++++ +D = Distribution('Normal', 0.0, 1.0, prng=prng) + +# Get the bins of the Distribution from +- 4 standard deviations of the mean +bins = D.bins() + +# Grab random samples from the distribution +D.rng(10) + +# We can then get the Probability Density Function for those bins +pdf = D.probability(bins, log=False) + +# And we can plot that PDF +# sphinx_gallery_thumbnail_number = 1 +plt.figure() +plt.plot(bins, pdf) + +#%% +# Multivariate Normal Distribution +# ++++++++++++++++++++++++++++++++ +D = Distribution('MvNormal',[0.0,1.0,2.0],[1.0,1.0,1.0], prng=prng) +D.rng() + + +#%% +# Uniform Distribution +D = Distribution('Uniform', 0.0, 1.0, prng=prng) +D.bins() diff --git a/docs/_downloads/f48e5c05cfcaf1411cc06bb7a0ed1eb0/plot_model_1d.py b/docs/_downloads/f48e5c05cfcaf1411cc06bb7a0ed1eb0/plot_model_1d.py new file mode 100644 index 00000000..ddbeec3f --- /dev/null +++ b/docs/_downloads/f48e5c05cfcaf1411cc06bb7a0ed1eb0/plot_model_1d.py @@ -0,0 +1,161 @@ +""" +1D Model with an infinite halfspace +----------------------------------- +""" + +# %% +from copy import deepcopy +from geobipy import StatArray +from geobipy import RectilinearMesh1D +from geobipy import Model +from geobipy import Distribution +import matplotlib.pyplot as plt +import numpy as np + +# %% +# Instantiate the 1D Model with a Half Space +# ++++++++++++++++++++++++++++++++++++++++++ + +# Make a test model with 10 layers, and increasing parameter values +nLayers = 2 +par = StatArray(np.linspace(0.001, 0.02, nLayers), "Conductivity", "$\\frac{S}{m}$") +thk = StatArray(np.full(nLayers, fill_value=10.0)) +thk[-1] = np.inf +mesh = RectilinearMesh1D(widths = thk) + +mod = Model(mesh = mesh, values=par) +# mod = Model1D(parameters=par, widths=thk) + +plt.figure() +mod.plotGrid(transpose=True, flip=True) + +#%% +# Randomness and Model Perturbations +# ++++++++++++++++++++++++++++++++++ +# We can set the priors on the 1D model by assigning minimum and maximum layer +# depths and a maximum number of layers. These are used to create priors on +# the number of cells in the model, a new depth interface, new parameter values +# and the vertical gradient of those parameters. +# The halfSpaceValue is used as a reference value for the parameter prior. +from numpy.random import Generator +from numpy.random import PCG64DXSM +generator = PCG64DXSM(seed=0) +prng = Generator(generator) + +# Set the priors +mod.set_priors(value_mean=0.01, + min_edge=1.0, + max_edge=150.0, + max_cells=30, + solve_value=True, + solve_gradient=True, + prng=prng) + +#%% +# We can evaluate the prior of the model using depths only +print('Log probability of the Model given its priors: ', mod.probability(False, False)) +# Or with priors on its parameters, and parameter gradient with depth. +print('Log probability of the Model given its priors: ', mod.probability(True, True)) + +#%% +# To propose new models, we specify the probabilities of creating, removing, perturbing, and not changing +# a layer interface +pProposal = Distribution('LogNormal', 0.01, np.log(2.0)**2.0, linearSpace=True, prng=prng) +mod.set_proposals(probabilities=[0.25, 0.25, 0.5, 0.25], proposal=pProposal, prng=prng) + +#%% +# We can then perturb the layers of the model +remapped, perturbed = mod.perturb() + +#%% +fig = plt.figure(figsize=(8, 6)) +ax = plt.subplot(121) +mod.pcolor(transpose=True, flip=True, log=10) # , grid=True) +ax = plt.subplot(122) +perturbed.pcolor(transpose=True, flip=True, log=10) # , grid=True) + +#%% +# We can evaluate the prior of the model using depths only +print('Log probability of the Model given its priors: ',perturbed.probability(False, False)) +# Or with priors on its parameters, and parameter gradient with depth. +print('Log probability of the Model given its priors: ',perturbed.probability(True, True)) + + +# %% +# Perturbing a model multiple times +# +++++++++++++++++++++++++++++++++ +# In the stochasitic inference process, we perturb the model structure, +# and parameter values, multiple times. +# Each time the model is perturbed, we can record its state +# in a posterior distribution. +# +# For a 1D model, the parameter posterior is a 2D hitmap with depth in one dimension +# and the parameter value in the other. +# We also attach a 1D histogram for the number of layers, +# and a 1D histogram for the locations of interfaces. +# +# Since we have already set the priors on the Model, we can set the posteriors +# based on bins from from the priors. + +mod.set_posteriors() + +mod0 = deepcopy(mod) + +#%% +# Now we randomly perturb the model, and update its posteriors. +mod.update_posteriors() +for i in range(1001): + remapped, perturbed = mod.perturb() + + # And update the model posteriors + perturbed.update_posteriors() + + mod = perturbed + +#%% +# We can now plot the posteriors of the model. +# +# Remember in this case, we are simply perturbing the model structure and parameter values +# The proposal for the parameter values is fixed and centred around a single value. +# fig = plt.figure(figsize=(8, 6)) + +# plt.subplot(131) +# mod.nCells.posterior.plot() +# ax = plt.subplot(132) +# mod.values.posterior.pcolor(cmap='gray_r', colorbar=False, flipY=True, logX=10) +# plt.subplot(133, sharey=ax) +# mod.mesh.edges.posterior.plot(transpose=True, flipY=True) + +# plt.figure() +# mod.plot_posteriors(**{"cmap": 'gray_r', +# "xscale": 'log', +# "noColorbar": True, +# "flipY": True, +# 'credible_interval_kwargs':{'axis': 1, +# 'reciprocate': True, +# 'xscale': 'log'}}) +# mod.par.posterior.plotCredibleIntervals(xscale='log', axis=1) + + +fig = plt.figure(figsize=(8, 6)) +# gs = fig.add_gridspec(nrows=1, ncols=1) +mod.plot_posteriors(axes=fig, + edges_kwargs = { + "transpose":True, + "flipY":True + }, + parameter_kwargs = { + "cmap": 'gray_r', + "xscale": 'log', + "colorbar": False, + "flipY": True, + 'credible_interval_kwargs':{ + 'reciprocate':True, + # 'axis': 1, + 'xscale': 'log' + } + }, + best = mod) + + +plt.show() diff --git a/docs/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip b/docs/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip new file mode 100644 index 00000000..53f206b5 Binary files /dev/null and b/docs/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip differ diff --git a/docs/_downloads/fbbc3367a4d5c657e951c760d8b85bb4/plot_distributions.ipynb b/docs/_downloads/fbbc3367a4d5c657e951c760d8b85bb4/plot_distributions.ipynb new file mode 100644 index 00000000..60db50f7 --- /dev/null +++ b/docs/_downloads/fbbc3367a4d5c657e951c760d8b85bb4/plot_distributions.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Distribution Class\n\nHandles the initialization of different statistical distribution\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from geobipy import Distribution\nfrom geobipy import plotting as cP\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom numpy.random import Generator\nfrom numpy.random import PCG64DXSM\ngenerator = PCG64DXSM(seed=0)\nprng = Generator(generator)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Univariate Normal Distribution\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "D = Distribution('Normal', 0.0, 1.0, prng=prng)\n\n# Get the bins of the Distribution from +- 4 standard deviations of the mean\nbins = D.bins()\n\n# Grab random samples from the distribution\nD.rng(10)\n\n# We can then get the Probability Density Function for those bins\npdf = D.probability(bins, log=False)\n\n# And we can plot that PDF\nplt.figure()\nplt.plot(bins, pdf)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Multivariate Normal Distribution\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "D = Distribution('MvNormal',[0.0,1.0,2.0],[1.0,1.0,1.0], prng=prng)\nD.rng()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Uniform Distribution\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "D = Distribution('Uniform', 0.0, 1.0, prng=prng)\nD.bins()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/docs/_downloads/fd0d450029ed4426f6b6d51ec196e9de/plot_inference_2d_skytem.py b/docs/_downloads/fd0d450029ed4426f6b6d51ec196e9de/plot_inference_2d_skytem.py new file mode 100644 index 00000000..d6a024d8 --- /dev/null +++ b/docs/_downloads/fd0d450029ed4426f6b6d51ec196e9de/plot_inference_2d_skytem.py @@ -0,0 +1,150 @@ +""" +2D Posterior analysis of Skytem inference +----------------------------------------- + +All plotting in GeoBIPy can be carried out using the 3D inference class + +""" + +import argparse +import matplotlib.pyplot as plt +import numpy as np +from geobipy import Model +from geobipy import Inference2D + +def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + + +if __name__ == '__main__': + types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + for model in types: + try: + plot_2d_summary('../../../Parallel_Inference/', "skytem_512", model) + except Exception as e: + print(model) + print(e) + pass \ No newline at end of file diff --git a/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png b/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png new file mode 100644 index 00000000..7bde712a Binary files /dev/null and b/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png differ diff --git a/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png.map b/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png.map new file mode 100644 index 00000000..d110aa65 --- /dev/null +++ b/docs/_images/inheritance-0006f8cd8e6977b5993ac681077797d927440bb6.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png b/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png new file mode 100644 index 00000000..df5d7244 Binary files /dev/null and b/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png differ diff --git a/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png.map b/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png.map new file mode 100644 index 00000000..ccaf0c23 --- /dev/null +++ b/docs/_images/inheritance-127b72798772cb1dec2c959bd6311b0535af3640.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png b/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png new file mode 100644 index 00000000..a82718c6 Binary files /dev/null and b/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png differ diff --git a/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png.map b/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png.map new file mode 100644 index 00000000..05438c86 --- /dev/null +++ b/docs/_images/inheritance-1f2a0ee0cfea9220aafc9b440b629744eb8db61a.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png b/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png new file mode 100644 index 00000000..a391f3c8 Binary files /dev/null and b/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png differ diff --git a/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png.map b/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png.map new file mode 100644 index 00000000..3a9a5795 --- /dev/null +++ b/docs/_images/inheritance-212ab34c1ca808ea0141bbdeb47aea7eef800b80.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png b/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png new file mode 100644 index 00000000..284afa55 Binary files /dev/null and b/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png differ diff --git a/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png.map b/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png.map new file mode 100644 index 00000000..bb94241c --- /dev/null +++ b/docs/_images/inheritance-263b416849e790dabd2079db760b8bfddf39061a.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png b/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png new file mode 100644 index 00000000..53f88a22 Binary files /dev/null and b/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png differ diff --git a/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png.map b/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png.map new file mode 100644 index 00000000..440b94a8 --- /dev/null +++ b/docs/_images/inheritance-286563f696f03256a99b8a899d9f39d17a4154ed.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png b/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png new file mode 100644 index 00000000..0d27d0ae Binary files /dev/null and b/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png differ diff --git a/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png.map b/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png.map new file mode 100644 index 00000000..e8d4279a --- /dev/null +++ b/docs/_images/inheritance-2e29a2b899d1e81cfc32152a7858d6655452dccf.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png b/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png new file mode 100644 index 00000000..456515cb Binary files /dev/null and b/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png differ diff --git a/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png.map b/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png.map new file mode 100644 index 00000000..e47303f9 --- /dev/null +++ b/docs/_images/inheritance-33c2a2e49fce3ac2e8b62a92c877fcb5cf826862.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png b/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png new file mode 100644 index 00000000..3755017e Binary files /dev/null and b/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png differ diff --git a/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png.map b/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png.map new file mode 100644 index 00000000..cd9ae288 --- /dev/null +++ b/docs/_images/inheritance-36417a1378681729aafa9fa19b748216cdb420fa.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png b/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png new file mode 100644 index 00000000..ee649795 Binary files /dev/null and b/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png differ diff --git a/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png.map b/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png.map new file mode 100644 index 00000000..468f07be --- /dev/null +++ b/docs/_images/inheritance-3e9478f8927ba986649827fbd77c64cd37ebd734.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png b/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png new file mode 100644 index 00000000..3c56dd45 Binary files /dev/null and b/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png differ diff --git a/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png.map b/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png.map new file mode 100644 index 00000000..1f8e6415 --- /dev/null +++ b/docs/_images/inheritance-44c11d2bf5c3a029b973cd3c6c261dd6a59757d5.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png b/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png new file mode 100644 index 00000000..b47519a2 Binary files /dev/null and b/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png differ diff --git a/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png.map b/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png.map new file mode 100644 index 00000000..1252ba51 --- /dev/null +++ b/docs/_images/inheritance-5af40ba389a59cbb40e4b8635224cd781f1330cd.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png b/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png new file mode 100644 index 00000000..3c1657e8 Binary files /dev/null and b/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png differ diff --git a/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png.map b/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png.map new file mode 100644 index 00000000..e9233715 --- /dev/null +++ b/docs/_images/inheritance-61e60ca04841fce9e0ed8eb7204459c525e8cd6b.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png b/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png new file mode 100644 index 00000000..e00ff290 Binary files /dev/null and b/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png differ diff --git a/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png.map b/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png.map new file mode 100644 index 00000000..7cdf6c2b --- /dev/null +++ b/docs/_images/inheritance-742646a7ad16739680219d0c00ff350fd1dd4bda.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png b/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png new file mode 100644 index 00000000..986af94c Binary files /dev/null and b/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png differ diff --git a/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png.map b/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png.map new file mode 100644 index 00000000..6b4d8c3b --- /dev/null +++ b/docs/_images/inheritance-77642122fb9a6744fee98ccb5a98d741fabc75a3.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png b/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png new file mode 100644 index 00000000..051a130a Binary files /dev/null and b/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png differ diff --git a/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png.map b/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png.map new file mode 100644 index 00000000..e35c6bbd --- /dev/null +++ b/docs/_images/inheritance-7f29f47de57de67011b245111d6a59f7827ea779.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png b/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png new file mode 100644 index 00000000..88f71ddc Binary files /dev/null and b/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png differ diff --git a/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png.map b/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png.map new file mode 100644 index 00000000..fec2af96 --- /dev/null +++ b/docs/_images/inheritance-88bea17a2f677cb53d42a6b2170aee3d986ab114.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png b/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png new file mode 100644 index 00000000..a55e08ff Binary files /dev/null and b/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png differ diff --git a/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png.map b/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png.map new file mode 100644 index 00000000..5ea4e997 --- /dev/null +++ b/docs/_images/inheritance-9377f4f566c8e8671b4494a8f0c965de58d1c4cb.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png b/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png new file mode 100644 index 00000000..659d60a2 Binary files /dev/null and b/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png differ diff --git a/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png.map b/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png.map new file mode 100644 index 00000000..4b106b2f --- /dev/null +++ b/docs/_images/inheritance-9c864059254fcc1e3b441445a469437ee047386d.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png b/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png new file mode 100644 index 00000000..4c6d8b1a Binary files /dev/null and b/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png differ diff --git a/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png.map b/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png.map new file mode 100644 index 00000000..7f372644 --- /dev/null +++ b/docs/_images/inheritance-a00fe3c8ecdaf2828c8f1f13d9c145ec86bf0fc3.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png b/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png new file mode 100644 index 00000000..7bccba89 Binary files /dev/null and b/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png differ diff --git a/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png.map b/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png.map new file mode 100644 index 00000000..81342f14 --- /dev/null +++ b/docs/_images/inheritance-a3360dbc8f36ec3130bd69cde6da93940ba9c9f8.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png b/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png new file mode 100644 index 00000000..bb7de9a1 Binary files /dev/null and b/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png differ diff --git a/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png.map b/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png.map new file mode 100644 index 00000000..30d9b4df --- /dev/null +++ b/docs/_images/inheritance-a6367c56667395c54c10aa1c5186149952d16259.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png b/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png new file mode 100644 index 00000000..32999b68 Binary files /dev/null and b/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png differ diff --git a/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png.map b/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png.map new file mode 100644 index 00000000..b0309a03 --- /dev/null +++ b/docs/_images/inheritance-c77cd9f51ba65d0a9e02d2bc33026e581a12b4db.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png b/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png new file mode 100644 index 00000000..a779b73a Binary files /dev/null and b/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png differ diff --git a/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png.map b/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png.map new file mode 100644 index 00000000..2579cbb4 --- /dev/null +++ b/docs/_images/inheritance-d077d98ae9ddbc374c6cdc7937c33df3b6dbc59d.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png b/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png new file mode 100644 index 00000000..70b3336f Binary files /dev/null and b/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png differ diff --git a/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png.map b/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png.map new file mode 100644 index 00000000..f5ab59fb --- /dev/null +++ b/docs/_images/inheritance-f26d987d584e616b7213ad8b61d43f0d547e7caf.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png b/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png new file mode 100644 index 00000000..fc76de32 Binary files /dev/null and b/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png differ diff --git a/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png.map b/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png.map new file mode 100644 index 00000000..6b6021a3 --- /dev/null +++ b/docs/_images/inheritance-f7959ba3636044f80359915c453545a4eeae9acf.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png b/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png new file mode 100644 index 00000000..d6216357 Binary files /dev/null and b/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png differ diff --git a/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png.map b/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png.map new file mode 100644 index 00000000..69e6c481 --- /dev/null +++ b/docs/_images/inheritance-f9448937ed9a96face0367342a9b1f1e00d1742c.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png b/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png new file mode 100644 index 00000000..f5f23cb5 Binary files /dev/null and b/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png differ diff --git a/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png.map b/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png.map new file mode 100644 index 00000000..766dc88b --- /dev/null +++ b/docs/_images/inheritance-fbcbab5f4f1af2527248286e74b8ace6d4173b15.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png b/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png new file mode 100644 index 00000000..558097a3 Binary files /dev/null and b/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png differ diff --git a/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png.map b/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png.map new file mode 100644 index 00000000..7bc8c33a --- /dev/null +++ b/docs/_images/inheritance-fe59419c3a910765649ae0f0a56e6601418c4cde.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/sphx_glr_hdf5_thumb.png b/docs/_images/sphx_glr_hdf5_thumb.png new file mode 100644 index 00000000..19cbde5a Binary files /dev/null and b/docs/_images/sphx_glr_hdf5_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_001.png b/docs/_images/sphx_glr_plot_StatArray_001.png new file mode 100644 index 00000000..bb81faac Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_001.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_002.png b/docs/_images/sphx_glr_plot_StatArray_002.png new file mode 100644 index 00000000..b5191cc5 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_002.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_003.png b/docs/_images/sphx_glr_plot_StatArray_003.png new file mode 100644 index 00000000..929a7b74 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_003.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_004.png b/docs/_images/sphx_glr_plot_StatArray_004.png new file mode 100644 index 00000000..79cbfe62 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_004.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_005.png b/docs/_images/sphx_glr_plot_StatArray_005.png new file mode 100644 index 00000000..bad112e7 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_005.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_006.png b/docs/_images/sphx_glr_plot_StatArray_006.png new file mode 100644 index 00000000..43e13607 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_006.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_007.png b/docs/_images/sphx_glr_plot_StatArray_007.png new file mode 100644 index 00000000..6602d29a Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_007.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_008.png b/docs/_images/sphx_glr_plot_StatArray_008.png new file mode 100644 index 00000000..b1a20d30 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_008.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_009.png b/docs/_images/sphx_glr_plot_StatArray_009.png new file mode 100644 index 00000000..7af77769 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_009.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_010.png b/docs/_images/sphx_glr_plot_StatArray_010.png new file mode 100644 index 00000000..634a1514 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_010.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_011.png b/docs/_images/sphx_glr_plot_StatArray_011.png new file mode 100644 index 00000000..94a41282 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_011.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_012.png b/docs/_images/sphx_glr_plot_StatArray_012.png new file mode 100644 index 00000000..ff1cb995 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_012.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_013.png b/docs/_images/sphx_glr_plot_StatArray_013.png new file mode 100644 index 00000000..24f1b8c0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_013.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_014.png b/docs/_images/sphx_glr_plot_StatArray_014.png new file mode 100644 index 00000000..cc351dab Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_014.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_015.png b/docs/_images/sphx_glr_plot_StatArray_015.png new file mode 100644 index 00000000..df0805d7 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_015.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_016.png b/docs/_images/sphx_glr_plot_StatArray_016.png new file mode 100644 index 00000000..6fde3141 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_016.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_017.png b/docs/_images/sphx_glr_plot_StatArray_017.png new file mode 100644 index 00000000..7f463465 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_017.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_018.png b/docs/_images/sphx_glr_plot_StatArray_018.png new file mode 100644 index 00000000..6d2a4215 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_018.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_019.png b/docs/_images/sphx_glr_plot_StatArray_019.png new file mode 100644 index 00000000..7b385410 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_019.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_020.png b/docs/_images/sphx_glr_plot_StatArray_020.png new file mode 100644 index 00000000..5b8a9cb4 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_020.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_021.png b/docs/_images/sphx_glr_plot_StatArray_021.png new file mode 100644 index 00000000..5cc99b6a Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_021.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_022.png b/docs/_images/sphx_glr_plot_StatArray_022.png new file mode 100644 index 00000000..5dae4224 Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_022.png differ diff --git a/docs/_images/sphx_glr_plot_StatArray_thumb.png b/docs/_images/sphx_glr_plot_StatArray_thumb.png new file mode 100644 index 00000000..46a43ced Binary files /dev/null and b/docs/_images/sphx_glr_plot_StatArray_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_distributions_001.png b/docs/_images/sphx_glr_plot_distributions_001.png new file mode 100644 index 00000000..0570d6e8 Binary files /dev/null and b/docs/_images/sphx_glr_plot_distributions_001.png differ diff --git a/docs/_images/sphx_glr_plot_distributions_thumb.png b/docs/_images/sphx_glr_plot_distributions_thumb.png new file mode 100644 index 00000000..bb112203 Binary files /dev/null and b/docs/_images/sphx_glr_plot_distributions_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_001.png b/docs/_images/sphx_glr_plot_histogram_1d_001.png new file mode 100644 index 00000000..88a9dd70 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_001.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_002.png b/docs/_images/sphx_glr_plot_histogram_1d_002.png new file mode 100644 index 00000000..0076739f Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_002.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_003.png b/docs/_images/sphx_glr_plot_histogram_1d_003.png new file mode 100644 index 00000000..c3d83f4e Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_003.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_004.png b/docs/_images/sphx_glr_plot_histogram_1d_004.png new file mode 100644 index 00000000..c48d21da Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_004.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_005.png b/docs/_images/sphx_glr_plot_histogram_1d_005.png new file mode 100644 index 00000000..2ffbb67f Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_005.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_006.png b/docs/_images/sphx_glr_plot_histogram_1d_006.png new file mode 100644 index 00000000..002caf10 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_006.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_1d_thumb.png b/docs/_images/sphx_glr_plot_histogram_1d_thumb.png new file mode 100644 index 00000000..6c9b74da Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_1d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_001.png b/docs/_images/sphx_glr_plot_histogram_2d_001.png new file mode 100644 index 00000000..51764098 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_001.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_002.png b/docs/_images/sphx_glr_plot_histogram_2d_002.png new file mode 100644 index 00000000..3bf4b767 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_002.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_003.png b/docs/_images/sphx_glr_plot_histogram_2d_003.png new file mode 100644 index 00000000..5328cc8c Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_003.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_004.png b/docs/_images/sphx_glr_plot_histogram_2d_004.png new file mode 100644 index 00000000..7ac106a1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_004.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_005.png b/docs/_images/sphx_glr_plot_histogram_2d_005.png new file mode 100644 index 00000000..ddbcfd3f Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_005.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_006.png b/docs/_images/sphx_glr_plot_histogram_2d_006.png new file mode 100644 index 00000000..df927c02 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_006.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_007.png b/docs/_images/sphx_glr_plot_histogram_2d_007.png new file mode 100644 index 00000000..b969657d Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_007.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_008.png b/docs/_images/sphx_glr_plot_histogram_2d_008.png new file mode 100644 index 00000000..5ff912ef Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_008.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_009.png b/docs/_images/sphx_glr_plot_histogram_2d_009.png new file mode 100644 index 00000000..ee48b907 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_009.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_010.png b/docs/_images/sphx_glr_plot_histogram_2d_010.png new file mode 100644 index 00000000..157f1963 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_010.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_011.png b/docs/_images/sphx_glr_plot_histogram_2d_011.png new file mode 100644 index 00000000..dbb2b1a0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_011.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_012.png b/docs/_images/sphx_glr_plot_histogram_2d_012.png new file mode 100644 index 00000000..7bb5d566 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_012.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_013.png b/docs/_images/sphx_glr_plot_histogram_2d_013.png new file mode 100644 index 00000000..7bb5d566 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_013.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_014.png b/docs/_images/sphx_glr_plot_histogram_2d_014.png new file mode 100644 index 00000000..7bb5d566 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_014.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_2d_thumb.png b/docs/_images/sphx_glr_plot_histogram_2d_thumb.png new file mode 100644 index 00000000..96c84093 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_2d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_001.png b/docs/_images/sphx_glr_plot_histogram_3d_001.png new file mode 100644 index 00000000..3af9842e Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_001.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_002.png b/docs/_images/sphx_glr_plot_histogram_3d_002.png new file mode 100644 index 00000000..1eb9f24d Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_002.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_003.png b/docs/_images/sphx_glr_plot_histogram_3d_003.png new file mode 100644 index 00000000..b1ec5798 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_003.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_004.png b/docs/_images/sphx_glr_plot_histogram_3d_004.png new file mode 100644 index 00000000..128acadf Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_004.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_005.png b/docs/_images/sphx_glr_plot_histogram_3d_005.png new file mode 100644 index 00000000..6abad9e2 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_005.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_006.png b/docs/_images/sphx_glr_plot_histogram_3d_006.png new file mode 100644 index 00000000..b11e8cf0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_006.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_007.png b/docs/_images/sphx_glr_plot_histogram_3d_007.png new file mode 100644 index 00000000..7cb8a62c Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_007.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_008.png b/docs/_images/sphx_glr_plot_histogram_3d_008.png new file mode 100644 index 00000000..aeacbf35 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_008.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_009.png b/docs/_images/sphx_glr_plot_histogram_3d_009.png new file mode 100644 index 00000000..20b3c88c Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_009.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_010.png b/docs/_images/sphx_glr_plot_histogram_3d_010.png new file mode 100644 index 00000000..223b6d26 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_010.png differ diff --git a/docs/_images/sphx_glr_plot_histogram_3d_thumb.png b/docs/_images/sphx_glr_plot_histogram_3d_thumb.png new file mode 100644 index 00000000..c4acecc9 Binary files /dev/null and b/docs/_images/sphx_glr_plot_histogram_3d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_resolve_001.png b/docs/_images/sphx_glr_plot_inference_1d_resolve_001.png new file mode 100644 index 00000000..912aeb1c Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_resolve_001.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_resolve_002.png b/docs/_images/sphx_glr_plot_inference_1d_resolve_002.png new file mode 100644 index 00000000..dbcf1a22 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_resolve_002.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_resolve_thumb.png b/docs/_images/sphx_glr_plot_inference_1d_resolve_thumb.png new file mode 100644 index 00000000..95ae4b8c Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_resolve_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_skytem_thumb.png b/docs/_images/sphx_glr_plot_inference_1d_skytem_thumb.png new file mode 100644 index 00000000..95ae4b8c Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_skytem_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_tempest_001.png b/docs/_images/sphx_glr_plot_inference_1d_tempest_001.png new file mode 100644 index 00000000..912aeb1c Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_tempest_001.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_tempest_002.png b/docs/_images/sphx_glr_plot_inference_1d_tempest_002.png new file mode 100644 index 00000000..6545273a Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_tempest_002.png differ diff --git a/docs/_images/sphx_glr_plot_inference_1d_tempest_thumb.png b/docs/_images/sphx_glr_plot_inference_1d_tempest_thumb.png new file mode 100644 index 00000000..95ae4b8c Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_1d_tempest_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_001.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_001.png new file mode 100644 index 00000000..b18d99ce Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_001.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_002.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_002.png new file mode 100644 index 00000000..044412c6 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_002.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_003.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_003.png new file mode 100644 index 00000000..e7263d5e Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_003.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_004.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_004.png new file mode 100644 index 00000000..e961b893 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_004.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_005.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_005.png new file mode 100644 index 00000000..be396397 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_005.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_006.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_006.png new file mode 100644 index 00000000..17dfefd5 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_006.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_resolve_thumb.png b/docs/_images/sphx_glr_plot_inference_2d_resolve_thumb.png new file mode 100644 index 00000000..bff08cf3 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_resolve_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_001.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_001.png new file mode 100644 index 00000000..ba50fb72 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_001.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_002.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_002.png new file mode 100644 index 00000000..81d1cb42 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_002.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_003.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_003.png new file mode 100644 index 00000000..f7d8fea6 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_003.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_004.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_004.png new file mode 100644 index 00000000..7fcc4a39 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_004.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_005.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_005.png new file mode 100644 index 00000000..ef78e0f8 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_005.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_006.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_006.png new file mode 100644 index 00000000..9162f2a5 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_006.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_skytem_thumb.png b/docs/_images/sphx_glr_plot_inference_2d_skytem_thumb.png new file mode 100644 index 00000000..9b2c7207 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_skytem_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_001.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_001.png new file mode 100644 index 00000000..dac3a044 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_001.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_002.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_002.png new file mode 100644 index 00000000..7e28d6d0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_002.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_003.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_003.png new file mode 100644 index 00000000..44b06aaa Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_003.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_004.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_004.png new file mode 100644 index 00000000..d9fb6ce5 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_004.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_005.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_005.png new file mode 100644 index 00000000..718003c2 Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_005.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_006.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_006.png new file mode 100644 index 00000000..12d42c6e Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_006.png differ diff --git a/docs/_images/sphx_glr_plot_inference_2d_tempest_thumb.png b/docs/_images/sphx_glr_plot_inference_2d_tempest_thumb.png new file mode 100644 index 00000000..e173e3df Binary files /dev/null and b/docs/_images/sphx_glr_plot_inference_2d_tempest_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_model_1d_001.png b/docs/_images/sphx_glr_plot_model_1d_001.png new file mode 100644 index 00000000..da47bb5b Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_1d_001.png differ diff --git a/docs/_images/sphx_glr_plot_model_1d_002.png b/docs/_images/sphx_glr_plot_model_1d_002.png new file mode 100644 index 00000000..da465384 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_1d_002.png differ diff --git a/docs/_images/sphx_glr_plot_model_1d_003.png b/docs/_images/sphx_glr_plot_model_1d_003.png new file mode 100644 index 00000000..de7a2cf3 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_1d_003.png differ diff --git a/docs/_images/sphx_glr_plot_model_1d_thumb.png b/docs/_images/sphx_glr_plot_model_1d_thumb.png new file mode 100644 index 00000000..013a0ae7 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_1d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_model_2d_001.png b/docs/_images/sphx_glr_plot_model_2d_001.png new file mode 100644 index 00000000..c706a6e8 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_2d_001.png differ diff --git a/docs/_images/sphx_glr_plot_model_2d_002.png b/docs/_images/sphx_glr_plot_model_2d_002.png new file mode 100644 index 00000000..00f24ae6 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_2d_002.png differ diff --git a/docs/_images/sphx_glr_plot_model_2d_thumb.png b/docs/_images/sphx_glr_plot_model_2d_thumb.png new file mode 100644 index 00000000..77951a1a Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_2d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_001.png b/docs/_images/sphx_glr_plot_model_3d_001.png new file mode 100644 index 00000000..7da3aba1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_001.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_002.png b/docs/_images/sphx_glr_plot_model_3d_002.png new file mode 100644 index 00000000..374d2590 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_002.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_003.png b/docs/_images/sphx_glr_plot_model_3d_003.png new file mode 100644 index 00000000..279d41b0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_003.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_004.png b/docs/_images/sphx_glr_plot_model_3d_004.png new file mode 100644 index 00000000..99fac821 Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_004.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_005.png b/docs/_images/sphx_glr_plot_model_3d_005.png new file mode 100644 index 00000000..39e4716e Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_005.png differ diff --git a/docs/_images/sphx_glr_plot_model_3d_thumb.png b/docs/_images/sphx_glr_plot_model_3d_thumb.png new file mode 100644 index 00000000..115c6baf Binary files /dev/null and b/docs/_images/sphx_glr_plot_model_3d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_001.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_001.png new file mode 100644 index 00000000..5e0f397d Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_001.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_002.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_002.png new file mode 100644 index 00000000..65dbfb93 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_002.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_003.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_003.png new file mode 100644 index 00000000..05655cb0 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_003.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_004.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_004.png new file mode 100644 index 00000000..256be4a9 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_004.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_005.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_005.png new file mode 100644 index 00000000..82902058 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_005.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_006.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_006.png new file mode 100644 index 00000000..a30ddb83 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_006.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_007.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_007.png new file mode 100644 index 00000000..2d699c9b Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_007.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_008.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_008.png new file mode 100644 index 00000000..6b482b22 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_008.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_009.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_009.png new file mode 100644 index 00000000..41636a42 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_009.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_010.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_010.png new file mode 100644 index 00000000..5b46cbb9 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_010.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_011.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_011.png new file mode 100644 index 00000000..6a28baa1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_011.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_012.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_012.png new file mode 100644 index 00000000..abd084d2 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_012.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_013.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_013.png new file mode 100644 index 00000000..6a28baa1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_013.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_014.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_014.png new file mode 100644 index 00000000..d6574164 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_014.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_015.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_015.png new file mode 100644 index 00000000..ddf7e637 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_015.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_thumb.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_thumb.png new file mode 100644 index 00000000..1500c54b Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_1d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_001.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_001.png new file mode 100644 index 00000000..99de9218 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_001.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_002.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_002.png new file mode 100644 index 00000000..68907f52 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_002.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_003.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_003.png new file mode 100644 index 00000000..f00ef97d Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_003.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_004.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_004.png new file mode 100644 index 00000000..fab2d6d7 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_004.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_005.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_005.png new file mode 100644 index 00000000..9ae4ccc7 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_005.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_006.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_006.png new file mode 100644 index 00000000..8d1a385c Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_006.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_007.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_007.png new file mode 100644 index 00000000..b2c86133 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_007.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_008.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_008.png new file mode 100644 index 00000000..7a0707ef Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_008.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_009.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_009.png new file mode 100644 index 00000000..bd23479c Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_009.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_010.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_010.png new file mode 100644 index 00000000..1d0e3a10 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_010.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_011.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_011.png new file mode 100644 index 00000000..a1a7c9ef Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_011.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_012.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_012.png new file mode 100644 index 00000000..3215bec3 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_012.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_013.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_013.png new file mode 100644 index 00000000..f7b4e0e2 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_013.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_014.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_014.png new file mode 100644 index 00000000..6a6f722c Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_014.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_thumb.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_thumb.png new file mode 100644 index 00000000..a84e01cf Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_2d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_001.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_001.png new file mode 100644 index 00000000..fe5c2c29 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_001.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_002.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_002.png new file mode 100644 index 00000000..5a006d04 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_002.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_003.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_003.png new file mode 100644 index 00000000..19d07ed1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_003.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_004.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_004.png new file mode 100644 index 00000000..dc0002dc Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_004.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_005.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_005.png new file mode 100644 index 00000000..9cc33e7f Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_005.png differ diff --git a/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_thumb.png b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_thumb.png new file mode 100644 index 00000000..a12f231c Binary files /dev/null and b/docs/_images/sphx_glr_plot_rectilinear_mesh_3d_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_resolve_datapoint_001.png b/docs/_images/sphx_glr_plot_resolve_datapoint_001.png new file mode 100644 index 00000000..b9fc850e Binary files /dev/null and b/docs/_images/sphx_glr_plot_resolve_datapoint_001.png differ diff --git a/docs/_images/sphx_glr_plot_resolve_datapoint_002.png b/docs/_images/sphx_glr_plot_resolve_datapoint_002.png new file mode 100644 index 00000000..f4974ea5 Binary files /dev/null and b/docs/_images/sphx_glr_plot_resolve_datapoint_002.png differ diff --git a/docs/_images/sphx_glr_plot_resolve_datapoint_003.png b/docs/_images/sphx_glr_plot_resolve_datapoint_003.png new file mode 100644 index 00000000..a97c10b6 Binary files /dev/null and b/docs/_images/sphx_glr_plot_resolve_datapoint_003.png differ diff --git a/docs/_images/sphx_glr_plot_resolve_datapoint_004.png b/docs/_images/sphx_glr_plot_resolve_datapoint_004.png new file mode 100644 index 00000000..6645172a Binary files /dev/null and b/docs/_images/sphx_glr_plot_resolve_datapoint_004.png differ diff --git a/docs/_images/sphx_glr_plot_resolve_datapoint_thumb.png b/docs/_images/sphx_glr_plot_resolve_datapoint_thumb.png new file mode 100644 index 00000000..2597ad22 Binary files /dev/null and b/docs/_images/sphx_glr_plot_resolve_datapoint_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_001.png b/docs/_images/sphx_glr_plot_skytem_datapoint_001.png new file mode 100644 index 00000000..2335fffd Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_001.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_002.png b/docs/_images/sphx_glr_plot_skytem_datapoint_002.png new file mode 100644 index 00000000..6fc99c0f Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_002.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_003.png b/docs/_images/sphx_glr_plot_skytem_datapoint_003.png new file mode 100644 index 00000000..24675853 Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_003.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_004.png b/docs/_images/sphx_glr_plot_skytem_datapoint_004.png new file mode 100644 index 00000000..5d652b70 Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_004.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_005.png b/docs/_images/sphx_glr_plot_skytem_datapoint_005.png new file mode 100644 index 00000000..cdb990c1 Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_005.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_006.png b/docs/_images/sphx_glr_plot_skytem_datapoint_006.png new file mode 100644 index 00000000..0f214359 Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_006.png differ diff --git a/docs/_images/sphx_glr_plot_skytem_datapoint_thumb.png b/docs/_images/sphx_glr_plot_skytem_datapoint_thumb.png new file mode 100644 index 00000000..e7451db3 Binary files /dev/null and b/docs/_images/sphx_glr_plot_skytem_datapoint_thumb.png differ diff --git a/docs/_images/sphx_glr_plot_tempest_datapoint_001.png b/docs/_images/sphx_glr_plot_tempest_datapoint_001.png new file mode 100644 index 00000000..59b5be14 Binary files /dev/null and b/docs/_images/sphx_glr_plot_tempest_datapoint_001.png differ diff --git a/docs/_images/sphx_glr_plot_tempest_datapoint_002.png b/docs/_images/sphx_glr_plot_tempest_datapoint_002.png new file mode 100644 index 00000000..fc80afdb Binary files /dev/null and b/docs/_images/sphx_glr_plot_tempest_datapoint_002.png differ diff --git a/docs/_images/sphx_glr_plot_tempest_datapoint_003.png b/docs/_images/sphx_glr_plot_tempest_datapoint_003.png new file mode 100644 index 00000000..1af5399f Binary files /dev/null and b/docs/_images/sphx_glr_plot_tempest_datapoint_003.png differ diff --git a/docs/_images/sphx_glr_plot_tempest_datapoint_004.png b/docs/_images/sphx_glr_plot_tempest_datapoint_004.png new file mode 100644 index 00000000..6dc1222a Binary files /dev/null and b/docs/_images/sphx_glr_plot_tempest_datapoint_004.png differ diff --git a/docs/_images/sphx_glr_plot_tempest_datapoint_thumb.png b/docs/_images/sphx_glr_plot_tempest_datapoint_thumb.png new file mode 100644 index 00000000..c5579f35 Binary files /dev/null and b/docs/_images/sphx_glr_plot_tempest_datapoint_thumb.png differ diff --git a/docs/_sources/2D_Inference/index.rst.txt b/docs/_sources/2D_Inference/index.rst.txt new file mode 100644 index 00000000..5087790b --- /dev/null +++ b/docs/_sources/2D_Inference/index.rst.txt @@ -0,0 +1,40 @@ + + +.. _sphx_glr_examples_2D_Inference: + +Inference 2D +============ + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/2D_Inference/images/thumb/sphx_glr_inference_2d_plotting_thumb.png + :alt: + + :ref:`sphx_glr_examples_2D_Inference_inference_2d_plotting.py` + +.. raw:: html + +
2D Posterior analysis of the Bayesian inference
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/2D_Inference/inference_2d_plotting + diff --git a/docs/_sources/2D_Inference/inference_2d_plotting.rst.txt b/docs/_sources/2D_Inference/inference_2d_plotting.rst.txt new file mode 100644 index 00000000..c3e64ce4 --- /dev/null +++ b/docs/_sources/2D_Inference/inference_2d_plotting.rst.txt @@ -0,0 +1,202 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/2D_Inference/inference_2d_plotting.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_2D_Inference_inference_2d_plotting.py: + + +2D Posterior analysis of the Bayesian inference +----------------------------------------------- + +All plotting in GeoBIPy can be carried out using the 3D inference class + +.. GENERATED FROM PYTHON SOURCE LINES 8-14 + +.. code-block:: Python + + import argparse + import matplotlib.pyplot as plt + import numpy as np + from geobipy import Inference2D + from create_model import create_model + + +.. GENERATED FROM PYTHON SOURCE LINES 15-155 + +.. code-block:: Python + + def create_plots(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 4)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(3, 4) + ax1 = fig.add_subplot(gs0[0, 0]) + true_model = create_model(model_type) + + if data_type == 'resolve': + true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1 + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + true_model.pcolor(**kwargs) + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + if data_type == 'resolve': + plt.ylim([-240, 60]) + else: + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[1, 0]) + results_2d.plot_mean_model(**kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[2, 0]) + results_2d.plot_mode_model(use_variance=False, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # # We can also choose to keep parameters above the DOI opaque. + # results_2d.compute_doi() + # plt.subplot(313) + # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # results_2d.plot_data_elevation(linewidth=0.3); + # results_2d.plot_elevation(linewidth=0.3); + + #%% + # We can plot the parameter values that produced the highest posterior + ax = fig.add_subplot(gs0[0, 1]) + results_2d.plot_k_layers() + + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax) + results_2d.plot_best_model(**kwargs); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[0, 2]) + plt.title('5%') + results_2d.plot_percentile(percent=0.05, **kwargs) + ax1 = fig.add_subplot(gs0[1, 2]) + plt.title('50%') + results_2d.plot_percentile(percent=0.5, **kwargs) + ax1 = fig.add_subplot(gs0[2, 2]) + plt.title('95%') + results_2d.plot_percentile(percent=0.95, **kwargs) + + + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[0, 3]) + results_2d.plot_confidence(); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[1, 3]) + plt.title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 3]) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5); + results_2d.plot_data_elevation(linewidth=0.3); + results_2d.plot_elevation(linewidth=0.3); + + # plt.show(block=True) + plt.savefig('{}_{}_{}.png'.format(folder, data_type, model_type), dpi=300) + + + if __name__ == '__main__': + + Parser = argparse.ArgumentParser(description="Plotting 2D inferences", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--data_type', dest='data_type', default=None, help='Skip the creation of the HDF5 files. Only do this if you know they have been created.') + Parser.add_argument('--model_type', dest='model_type', default=None, help='Specify a numpy seed file to fix the random number generator. Only used in serial mode.') + + args = Parser.parse_args() + + data_types = ['skytem_512', 'resolve', 'tempest'] if args.data_type is None else args.data_type + model_types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] if args.model_type is None else args.model_type + + if not isinstance(data_types, list): data_types = [data_types] + if not isinstance(model_types, list): model_types = [model_types] + + for data in data_types: + print(data) + for model in model_types: + print(' ',model) + create_plots("no_reverse_jump", data, model) + + +.. _sphx_glr_download_examples_2D_Inference_inference_2d_plotting.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: inference_2d_plotting.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: inference_2d_plotting.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/2D_Inference/readme.rst.txt b/docs/_sources/2D_Inference/readme.rst.txt new file mode 100644 index 00000000..088c5bab --- /dev/null +++ b/docs/_sources/2D_Inference/readme.rst.txt @@ -0,0 +1,2 @@ +Inference 2D +============ \ No newline at end of file diff --git a/docs/_sources/2D_Inference/sg_execution_times.rst.txt b/docs/_sources/2D_Inference/sg_execution_times.rst.txt new file mode 100644 index 00000000..38adede0 --- /dev/null +++ b/docs/_sources/2D_Inference/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_2D_Inference_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 1 file **from examples/2D_Inference**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_2D_Inference_inference_2d_plotting.py` (``inference_2d_plotting.py``) + - 00:00.000 + - 0.0 diff --git a/docs/_sources/Parallel_Inference/index.rst.txt b/docs/_sources/Parallel_Inference/index.rst.txt new file mode 100644 index 00000000..974154c3 --- /dev/null +++ b/docs/_sources/Parallel_Inference/index.rst.txt @@ -0,0 +1,66 @@ + + +.. _sphx_glr_examples_Parallel_Inference: + +Parallel Inference +------------------ + +The best way to run geobipy with MPI is through the command line entry point. +Upon install, pip will create the "geobipy" entry point into the code base. +This entry point can be used for both serial and parallel modes. + +.. code-block:: bash + + srun geobipy options.py --mpi + +Please refer to the installation instructions for getting your Python environment setup with mpi4py and mpi enabled hdf5. +Install those two packages first before installing geobipy otherwise pip might inadvertently install the non-parallel-enabled hdf5 library. + +Parallelization ++++++++++++++++ + +Geopbipy is currently parallelized using only MPI. We do not use single machine parallel libraries like multiprocessing or joblib because we wanted scalability from the start. +We currently have no dependence between data points in a data set, so we can treat each data point independently from its neighbours. This lends itself well to distributed parallelization using MPI. +One of the biggest bottlenecks of any parallel enabled program is file IO, we therefore alleviate this bottleneck by writing results to HDF5 files (With future scope to have these be properly georeferenced netcdf files) +Each unique line number in a data file will have its own separate hdf5 file. + +Here is a sample slurm script to submit an mpi enabled job to the queue. Since we only care about total cores available, we dont need to worry too much about cores per node, or increasing RAM per core. Geobipy operates with relatively small memory requirements, and we have tested with only 256MB per core available. +The code is currently showing linear scalability upto 9000 cores (which was our maximum available at the time). + +.. code-block:: bash + + #!/bin/bash + #SBATCH --job-name=geobipy + #SBATCH -n 5000 + #SBATCH -p + #SBATCH --account= + #SBATCH --time=dd-hh:mm:ss + #SBATCH -o %j.out + + # Your module load section to enable python + module load cray-hdf5-parallel cray-python + # FFTW is required when compiling the time domain forward modeller from Geoscience Australia + module load cray-fftw + + # We use Numba to compile the Python frequency domain forward modeller into C + export OMP_NUM_THREADS=1 + export NUMBA_CPU_NAME='skylake' # Change your CPU name + + # Source your python environment how you need, either conda or venv + source + conda activate geobipy + + mkdir + rm /*.h5 # We recommend this in case you have to restart a run. HDF5 files can corrupt on unsuccessful exit. + srun geobipy options.py --mpi + + +.. raw:: html + +
+ + +.. raw:: html + +
+ diff --git a/docs/_sources/Parallel_Inference/readme.rst.txt b/docs/_sources/Parallel_Inference/readme.rst.txt new file mode 100644 index 00000000..80a90ca0 --- /dev/null +++ b/docs/_sources/Parallel_Inference/readme.rst.txt @@ -0,0 +1,51 @@ +Parallel Inference +------------------ + +The best way to run geobipy with MPI is through the command line entry point. +Upon install, pip will create the "geobipy" entry point into the code base. +This entry point can be used for both serial and parallel modes. + +.. code-block:: bash + + srun geobipy options.py --mpi + +Please refer to the installation instructions for getting your Python environment setup with mpi4py and mpi enabled hdf5. +Install those two packages first before installing geobipy otherwise pip might inadvertently install the non-parallel-enabled hdf5 library. + +Parallelization ++++++++++++++++ + +Geopbipy is currently parallelized using only MPI. We do not use single machine parallel libraries like multiprocessing or joblib because we wanted scalability from the start. +We currently have no dependence between data points in a data set, so we can treat each data point independently from its neighbours. This lends itself well to distributed parallelization using MPI. +One of the biggest bottlenecks of any parallel enabled program is file IO, we therefore alleviate this bottleneck by writing results to HDF5 files (With future scope to have these be properly georeferenced netcdf files) +Each unique line number in a data file will have its own separate hdf5 file. + +Here is a sample slurm script to submit an mpi enabled job to the queue. Since we only care about total cores available, we dont need to worry too much about cores per node, or increasing RAM per core. Geobipy operates with relatively small memory requirements, and we have tested with only 256MB per core available. +The code is currently showing linear scalability upto 9000 cores (which was our maximum available at the time). + +.. code-block:: bash + + #!/bin/bash + #SBATCH --job-name=geobipy + #SBATCH -n 5000 + #SBATCH -p + #SBATCH --account= + #SBATCH --time=dd-hh:mm:ss + #SBATCH -o %j.out + + # Your module load section to enable python + module load cray-hdf5-parallel cray-python + # FFTW is required when compiling the time domain forward modeller from Geoscience Australia + module load cray-fftw + + # We use Numba to compile the Python frequency domain forward modeller into C + export OMP_NUM_THREADS=1 + export NUMBA_CPU_NAME='skylake' # Change your CPU name + + # Source your python environment how you need, either conda or venv + source + conda activate geobipy + + mkdir + rm /*.h5 # We recommend this in case you have to restart a run. HDF5 files can corrupt on unsuccessful exit. + srun geobipy options.py --mpi \ No newline at end of file diff --git a/docs/_sources/Parallel_Inference/sg_execution_times.rst.txt b/docs/_sources/Parallel_Inference/sg_execution_times.rst.txt new file mode 100644 index 00000000..729759af --- /dev/null +++ b/docs/_sources/Parallel_Inference/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_Parallel_Inference_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from examples/Parallel_Inference**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_sources/content/api/api.rst.txt b/docs/_sources/content/api/api.rst.txt new file mode 100644 index 00000000..af707cb2 --- /dev/null +++ b/docs/_sources/content/api/api.rst.txt @@ -0,0 +1,11 @@ +*** +API +*** + +The source code is split into two types of files. Those that contain a set of python functions, and those that contain classes. + +.. toctree:: + :maxdepth: 1 + + base/base + classes/classes diff --git a/docs/_sources/content/api/base/HDF.rst.txt b/docs/_sources/content/api/base/HDF.rst.txt new file mode 100644 index 00000000..622d0e4e --- /dev/null +++ b/docs/_sources/content/api/base/HDF.rst.txt @@ -0,0 +1,7 @@ +Heirarchical Data Format (HDF) +============================== + +.. automodule:: geobipy.src.base.HDF.hdfRead + :members: +.. automodule:: geobipy.src.base.HDF.hdfWrite + :members: diff --git a/docs/_sources/content/api/base/MPI.rst.txt b/docs/_sources/content/api/base/MPI.rst.txt new file mode 100644 index 00000000..7e1f75dd --- /dev/null +++ b/docs/_sources/content/api/base/MPI.rst.txt @@ -0,0 +1,5 @@ +MPI wrapper functions +===================== + +.. automodule:: geobipy.src.base.MPI + :members: diff --git a/docs/_sources/content/api/base/base.rst.txt b/docs/_sources/content/api/base/base.rst.txt new file mode 100644 index 00000000..1feb68bc --- /dev/null +++ b/docs/_sources/content/api/base/base.rst.txt @@ -0,0 +1,14 @@ +******************************** +Core routines needed for GeoBIPy +******************************** + +.. toctree:: + :maxdepth: 1 + + utilities + plotting + fileIO + interpolation + HDF + MPI + diff --git a/docs/_sources/content/api/base/fileIO.rst.txt b/docs/_sources/content/api/base/fileIO.rst.txt new file mode 100644 index 00000000..5cbf82e2 --- /dev/null +++ b/docs/_sources/content/api/base/fileIO.rst.txt @@ -0,0 +1,5 @@ +fileIO +====== + +.. automodule:: geobipy.src.base.fileIO + :members: diff --git a/docs/_sources/content/api/base/interpolation.rst.txt b/docs/_sources/content/api/base/interpolation.rst.txt new file mode 100644 index 00000000..be572b21 --- /dev/null +++ b/docs/_sources/content/api/base/interpolation.rst.txt @@ -0,0 +1,5 @@ +Interpolation +============= + +.. automodule:: geobipy.src.base.interpolation + :members: diff --git a/docs/_sources/content/api/base/plotting.rst.txt b/docs/_sources/content/api/base/plotting.rst.txt new file mode 100644 index 00000000..817f9cbc --- /dev/null +++ b/docs/_sources/content/api/base/plotting.rst.txt @@ -0,0 +1,5 @@ +plotting +======== + +.. automodule:: geobipy.src.base.plotting + :members: diff --git a/docs/_sources/content/api/base/utilities.rst.txt b/docs/_sources/content/api/base/utilities.rst.txt new file mode 100644 index 00000000..98345120 --- /dev/null +++ b/docs/_sources/content/api/base/utilities.rst.txt @@ -0,0 +1,5 @@ +utilities +========= + +.. automodule:: geobipy.src.base.utilities + :members: diff --git a/docs/_sources/content/api/classes/classes.rst.txt b/docs/_sources/content/api/classes/classes.rst.txt new file mode 100644 index 00000000..3c29c371 --- /dev/null +++ b/docs/_sources/content/api/classes/classes.rst.txt @@ -0,0 +1,15 @@ +*********************** +Classes used in GeoBIPy +*********************** + + +.. toctree:: + :maxdepth: 1 + + core/core + data/data + mesh/mesh + model/model + pointcloud/pointcloud + statistics/statistics + system/system diff --git a/docs/_sources/content/api/classes/core/StatArray.rst.txt b/docs/_sources/content/api/classes/core/StatArray.rst.txt new file mode 100644 index 00000000..8ef3b391 --- /dev/null +++ b/docs/_sources/content/api/classes/core/StatArray.rst.txt @@ -0,0 +1,10 @@ +StatArray +--------- + +.. inheritance-diagram:: geobipy.src.classes.core.StatArray.StatArray + :parts: 1 + +.. automodule:: geobipy.src.classes.core.StatArray + :members: + :undoc-members: + diff --git a/docs/_sources/content/api/classes/core/core.rst.txt b/docs/_sources/content/api/classes/core/core.rst.txt new file mode 100644 index 00000000..18fffe5a --- /dev/null +++ b/docs/_sources/content/api/classes/core/core.rst.txt @@ -0,0 +1,9 @@ +Core classes +============ + +.. toctree:: + :maxdepth: 1 + + myObject + StatArray + diff --git a/docs/_sources/content/api/classes/core/myObject.rst.txt b/docs/_sources/content/api/classes/core/myObject.rst.txt new file mode 100644 index 00000000..dce4f231 --- /dev/null +++ b/docs/_sources/content/api/classes/core/myObject.rst.txt @@ -0,0 +1,5 @@ +Core object class +----------------- + +.. automodule:: geobipy.src.classes.core.myObject + :members: diff --git a/docs/_sources/content/api/classes/data/data.rst.txt b/docs/_sources/content/api/classes/data/data.rst.txt new file mode 100644 index 00000000..994b8e24 --- /dev/null +++ b/docs/_sources/content/api/classes/data/data.rst.txt @@ -0,0 +1,8 @@ +Data classes +============ + +.. toctree:: + :maxdepth: 1 + + dataset/dataset + datapoint/datapointrst diff --git a/docs/_sources/content/api/classes/data/datapoint/EmDataPoint.rst.txt b/docs/_sources/content/api/classes/data/datapoint/EmDataPoint.rst.txt new file mode 100644 index 00000000..5c02be96 --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/EmDataPoint.rst.txt @@ -0,0 +1,8 @@ +EmDataPoint +^^^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint + :parts: 1 + +.. automodule:: geobipy.src.classes.data.datapoint.EmDataPoint + :members: diff --git a/docs/_sources/content/api/classes/data/datapoint/FdemDataPoint.rst.txt b/docs/_sources/content/api/classes/data/datapoint/FdemDataPoint.rst.txt new file mode 100644 index 00000000..b521cdd2 --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/FdemDataPoint.rst.txt @@ -0,0 +1,8 @@ +FdemDataPoint +^^^^^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint + :parts: 1 + +.. automodule:: geobipy.src.classes.data.datapoint.FdemDataPoint + :members: diff --git a/docs/_sources/content/api/classes/data/datapoint/TdemDataPoint.rst.txt b/docs/_sources/content/api/classes/data/datapoint/TdemDataPoint.rst.txt new file mode 100644 index 00000000..45ca6a07 --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/TdemDataPoint.rst.txt @@ -0,0 +1,8 @@ +TdemDataPoint +^^^^^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint + :parts: 1 + +.. automodule:: geobipy.src.classes.data.datapoint.TdemDataPoint + :members: diff --git a/docs/_sources/content/api/classes/data/datapoint/Tempest_dataPoint.rst.txt b/docs/_sources/content/api/classes/data/datapoint/Tempest_dataPoint.rst.txt new file mode 100644 index 00000000..e8a6288e --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/Tempest_dataPoint.rst.txt @@ -0,0 +1,8 @@ +Tempest_datapoint +^^^^^^^^^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.datapoint.Tempest_datapoint + :parts: 1 + +.. automodule:: geobipy.src.classes.data.datapoint.Tempest_datapoint + :members: diff --git a/docs/_sources/content/api/classes/data/datapoint/datapoint.rst.txt b/docs/_sources/content/api/classes/data/datapoint/datapoint.rst.txt new file mode 100644 index 00000000..e1e4f6f1 --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/datapoint.rst.txt @@ -0,0 +1,8 @@ +DataPoint +^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.datapoint.DataPoint.DataPoint + :parts: 1 + +.. automodule:: geobipy.src.classes.data.datapoint.DataPoint + :members: diff --git a/docs/_sources/content/api/classes/data/datapoint/datapointrst.rst.txt b/docs/_sources/content/api/classes/data/datapoint/datapointrst.rst.txt new file mode 100644 index 00000000..b5a34a1d --- /dev/null +++ b/docs/_sources/content/api/classes/data/datapoint/datapointrst.rst.txt @@ -0,0 +1,10 @@ +Datapoint classes +----------------- + +.. toctree:: + :maxdepth: 1 + + datapoint + EmDataPoint + FdemDataPoint + TdemDataPoint diff --git a/docs/_sources/content/api/classes/data/dataset/Data.rst.txt b/docs/_sources/content/api/classes/data/dataset/Data.rst.txt new file mode 100644 index 00000000..192a83cd --- /dev/null +++ b/docs/_sources/content/api/classes/data/dataset/Data.rst.txt @@ -0,0 +1,8 @@ +Data +^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.dataset.Data.Data + :parts: 1 + +.. automodule:: geobipy.src.classes.data.dataset.Data + :members: diff --git a/docs/_sources/content/api/classes/data/dataset/FdemData.rst.txt b/docs/_sources/content/api/classes/data/dataset/FdemData.rst.txt new file mode 100644 index 00000000..7256f21f --- /dev/null +++ b/docs/_sources/content/api/classes/data/dataset/FdemData.rst.txt @@ -0,0 +1,7 @@ +FdemData +^^^^^^^^ +.. inheritance-diagram:: geobipy.src.classes.data.dataset.FdemData + :parts: 1 + +.. automodule:: geobipy.src.classes.data.dataset.FdemData + :members: diff --git a/docs/_sources/content/api/classes/data/dataset/TdemData.rst.txt b/docs/_sources/content/api/classes/data/dataset/TdemData.rst.txt new file mode 100644 index 00000000..5786ddc2 --- /dev/null +++ b/docs/_sources/content/api/classes/data/dataset/TdemData.rst.txt @@ -0,0 +1,8 @@ +TdemData +^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.dataset.TdemData + :parts: 1 + +.. automodule:: geobipy.src.classes.data.dataset.TdemData + :members: diff --git a/docs/_sources/content/api/classes/data/dataset/TempestData.rst.txt b/docs/_sources/content/api/classes/data/dataset/TempestData.rst.txt new file mode 100644 index 00000000..8a08b82f --- /dev/null +++ b/docs/_sources/content/api/classes/data/dataset/TempestData.rst.txt @@ -0,0 +1,8 @@ +TempestData +^^^^^^^^^^^ + +.. inheritance-diagram:: geobipy.src.classes.data.dataset.TempestData + :parts: 1 + +.. automodule:: geobipy.src.classes.data.dataset.TempestData + :members: diff --git a/docs/_sources/content/api/classes/data/dataset/dataset.rst.txt b/docs/_sources/content/api/classes/data/dataset/dataset.rst.txt new file mode 100644 index 00000000..c829cb99 --- /dev/null +++ b/docs/_sources/content/api/classes/data/dataset/dataset.rst.txt @@ -0,0 +1,10 @@ +Dataset classes +--------------- + +.. toctree:: + :maxdepth: 1 + + Data + FdemData + TdemData + TempestData diff --git a/docs/_sources/content/api/classes/mesh/RectilinearMesh1D.rst.txt b/docs/_sources/content/api/classes/mesh/RectilinearMesh1D.rst.txt new file mode 100644 index 00000000..9104f467 --- /dev/null +++ b/docs/_sources/content/api/classes/mesh/RectilinearMesh1D.rst.txt @@ -0,0 +1,8 @@ +RectilinearMesh1D +================= + +.. inheritance-diagram:: geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D + :parts: 1 + +.. automodule:: geobipy.src.classes.mesh.RectilinearMesh1D + :members: diff --git a/docs/_sources/content/api/classes/mesh/RectilinearMesh2D.rst.txt b/docs/_sources/content/api/classes/mesh/RectilinearMesh2D.rst.txt new file mode 100644 index 00000000..a2f2fa64 --- /dev/null +++ b/docs/_sources/content/api/classes/mesh/RectilinearMesh2D.rst.txt @@ -0,0 +1,8 @@ +RectilinearMesh2D +================= + +.. inheritance-diagram:: geobipy.src.classes.mesh.RectilinearMesh2D + :parts: 1 + +.. automodule:: geobipy.src.classes.mesh.RectilinearMesh2D + :members: diff --git a/docs/_sources/content/api/classes/mesh/RectilinearMesh2D_stitched.rst.txt b/docs/_sources/content/api/classes/mesh/RectilinearMesh2D_stitched.rst.txt new file mode 100644 index 00000000..af033881 --- /dev/null +++ b/docs/_sources/content/api/classes/mesh/RectilinearMesh2D_stitched.rst.txt @@ -0,0 +1,8 @@ +RectilinearMesh2D_stitched +========================== + +.. inheritance-diagram:: geobipy.src.classes.mesh.RectilinearMesh2D_stitched + :parts: 1 + +.. automodule:: geobipy.src.classes.mesh.RectilinearMesh2D_stitched + :members: diff --git a/docs/_sources/content/api/classes/mesh/RectilinearMesh3D.rst.txt b/docs/_sources/content/api/classes/mesh/RectilinearMesh3D.rst.txt new file mode 100644 index 00000000..940cca60 --- /dev/null +++ b/docs/_sources/content/api/classes/mesh/RectilinearMesh3D.rst.txt @@ -0,0 +1,8 @@ +RectilinearMesh3D +================= + +.. inheritance-diagram:: geobipy.src.classes.mesh.RectilinearMesh3D + :parts: 1 + +.. automodule:: geobipy.src.classes.mesh.RectilinearMesh3D + :members: diff --git a/docs/_sources/content/api/classes/mesh/mesh.rst.txt b/docs/_sources/content/api/classes/mesh/mesh.rst.txt new file mode 100644 index 00000000..95210c6f --- /dev/null +++ b/docs/_sources/content/api/classes/mesh/mesh.rst.txt @@ -0,0 +1,10 @@ +Mesh classes +================================= + +.. toctree:: + :maxdepth: 1 + + RectilinearMesh1D + RectilinearMesh2D + RectilinearMesh2D_stitched + RectilinearMesh3D diff --git a/docs/_sources/content/api/classes/model/Model_.rst.txt b/docs/_sources/content/api/classes/model/Model_.rst.txt new file mode 100644 index 00000000..0f0f9341 --- /dev/null +++ b/docs/_sources/content/api/classes/model/Model_.rst.txt @@ -0,0 +1,8 @@ +Model +========================= + +.. inheritance-diagram:: geobipy.src.classes.model.Model + :parts: 1 + +.. automodule:: geobipy.src.classes.model.Model + :members: diff --git a/docs/_sources/content/api/classes/model/model.rst.txt b/docs/_sources/content/api/classes/model/model.rst.txt new file mode 100644 index 00000000..87acf8e0 --- /dev/null +++ b/docs/_sources/content/api/classes/model/model.rst.txt @@ -0,0 +1,7 @@ +Model classes +================================= + +.. toctree:: + :maxdepth: 1 + + Model_ diff --git a/docs/_sources/content/api/classes/pointcloud/Point.rst.txt b/docs/_sources/content/api/classes/pointcloud/Point.rst.txt new file mode 100644 index 00000000..4b67dff8 --- /dev/null +++ b/docs/_sources/content/api/classes/pointcloud/Point.rst.txt @@ -0,0 +1,7 @@ +Point +============ +.. inheritance-diagram:: geobipy.src.classes.pointcloud.Point + :parts: 1 + +.. automodule:: geobipy.src.classes.pointcloud.Point + :members: diff --git a/docs/_sources/content/api/classes/pointcloud/pointcloud.rst.txt b/docs/_sources/content/api/classes/pointcloud/pointcloud.rst.txt new file mode 100644 index 00000000..b7c05794 --- /dev/null +++ b/docs/_sources/content/api/classes/pointcloud/pointcloud.rst.txt @@ -0,0 +1,7 @@ +Pointcloud classes +================================= + +.. toctree:: + :maxdepth: 1 + + Point \ No newline at end of file diff --git a/docs/_sources/content/api/classes/statistics/Distribution.rst.txt b/docs/_sources/content/api/classes/statistics/Distribution.rst.txt new file mode 100644 index 00000000..4dc7d624 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/Distribution.rst.txt @@ -0,0 +1,8 @@ +Distribution Wrapper +================================= + +.. .. inheritance-diagram:: geobipy.src.classes.statistics.Distribution +.. :parts: 1 + +.. automodule:: geobipy.src.classes.statistics.Distribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/GammaDistribution.rst.txt b/docs/_sources/content/api/classes/statistics/GammaDistribution.rst.txt new file mode 100644 index 00000000..432c3e32 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/GammaDistribution.rst.txt @@ -0,0 +1,9 @@ +Gamma Distribution +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.GammaDistribution + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.GammaDistribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/Histogram.rst.txt b/docs/_sources/content/api/classes/statistics/Histogram.rst.txt new file mode 100644 index 00000000..3b894888 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/Histogram.rst.txt @@ -0,0 +1,9 @@ +Histogram +========= + +.. inheritance-diagram:: geobipy.src.classes.statistics.Histogram + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.Histogram + :members: diff --git a/docs/_sources/content/api/classes/statistics/Histogram1D.rst.txt b/docs/_sources/content/api/classes/statistics/Histogram1D.rst.txt new file mode 100644 index 00000000..3b894888 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/Histogram1D.rst.txt @@ -0,0 +1,9 @@ +Histogram +========= + +.. inheritance-diagram:: geobipy.src.classes.statistics.Histogram + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.Histogram + :members: diff --git a/docs/_sources/content/api/classes/statistics/Histogram2D.rst.txt b/docs/_sources/content/api/classes/statistics/Histogram2D.rst.txt new file mode 100644 index 00000000..5acce13a --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/Histogram2D.rst.txt @@ -0,0 +1,9 @@ +Histogram2D +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.Histogram2D + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.Histogram2D + :members: diff --git a/docs/_sources/content/api/classes/statistics/Hitmap2D.rst.txt b/docs/_sources/content/api/classes/statistics/Hitmap2D.rst.txt new file mode 100644 index 00000000..06c39499 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/Hitmap2D.rst.txt @@ -0,0 +1,9 @@ +Hitmap2D +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.Hitmap2D + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.Hitmap2D + :members: diff --git a/docs/_sources/content/api/classes/statistics/MvNormalDistribution.rst.txt b/docs/_sources/content/api/classes/statistics/MvNormalDistribution.rst.txt new file mode 100644 index 00000000..6210866f --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/MvNormalDistribution.rst.txt @@ -0,0 +1,8 @@ +MvNormal +======== +.. inheritance-diagram:: geobipy.src.classes.statistics.MvNormalDistribution + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.MvNormalDistribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/NormalDistribution.rst.txt b/docs/_sources/content/api/classes/statistics/NormalDistribution.rst.txt new file mode 100644 index 00000000..ef806bb9 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/NormalDistribution.rst.txt @@ -0,0 +1,8 @@ +Normal distribution +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.NormalDistribution + :parts: 1 + +.. automodule:: geobipy.src.classes.statistics.NormalDistribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/OrderStatistics.rst.txt b/docs/_sources/content/api/classes/statistics/OrderStatistics.rst.txt new file mode 100644 index 00000000..4f0293ee --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/OrderStatistics.rst.txt @@ -0,0 +1,9 @@ +Order Statistics +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.OrderStatistics + :parts: 1 + + +.. automodule:: geobipy.src.classes.statistics.OrderStatistics + :members: diff --git a/docs/_sources/content/api/classes/statistics/UniformDistribution.rst.txt b/docs/_sources/content/api/classes/statistics/UniformDistribution.rst.txt new file mode 100644 index 00000000..95e11d53 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/UniformDistribution.rst.txt @@ -0,0 +1,8 @@ +Uniform distribution +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.UniformDistribution + :parts: 1 + +.. automodule:: geobipy.src.classes.statistics.UniformDistribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/baseDistribution.rst.txt b/docs/_sources/content/api/classes/statistics/baseDistribution.rst.txt new file mode 100644 index 00000000..1977a063 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/baseDistribution.rst.txt @@ -0,0 +1,8 @@ +baseDistribution +================================= + +.. inheritance-diagram:: geobipy.src.classes.statistics.baseDistribution + :parts: 1 + +.. automodule:: geobipy.src.classes.statistics.baseDistribution + :members: diff --git a/docs/_sources/content/api/classes/statistics/statistics.rst.txt b/docs/_sources/content/api/classes/statistics/statistics.rst.txt new file mode 100644 index 00000000..0966ed51 --- /dev/null +++ b/docs/_sources/content/api/classes/statistics/statistics.rst.txt @@ -0,0 +1,14 @@ +Statistics classes +================== + +.. toctree:: + :maxdepth: 1 + + Distribution + Histogram + baseDistribution + NormalDistribution + MvNormalDistribution + UniformDistribution + GammaDistribution + OrderStatistics diff --git a/docs/_sources/content/api/classes/system/CircularLoop.rst.txt b/docs/_sources/content/api/classes/system/CircularLoop.rst.txt new file mode 100644 index 00000000..3a1ef55c --- /dev/null +++ b/docs/_sources/content/api/classes/system/CircularLoop.rst.txt @@ -0,0 +1,8 @@ +Circular Loop +============= + +.. inheritance-diagram:: geobipy.src.classes.system.CircularLoop + :parts: 1 + +.. automodule:: geobipy.src.classes.system.CircularLoop + :members: diff --git a/docs/_sources/content/api/classes/system/EmLoop.rst.txt b/docs/_sources/content/api/classes/system/EmLoop.rst.txt new file mode 100644 index 00000000..b6d69075 --- /dev/null +++ b/docs/_sources/content/api/classes/system/EmLoop.rst.txt @@ -0,0 +1,8 @@ +EmLoop +====== + +.. inheritance-diagram:: geobipy.src.classes.system.EmLoop + :parts: 1 + +.. automodule:: geobipy.src.classes.system.EmLoop + :members: diff --git a/docs/_sources/content/api/classes/system/FdemSystem.rst.txt b/docs/_sources/content/api/classes/system/FdemSystem.rst.txt new file mode 100644 index 00000000..8de0ceeb --- /dev/null +++ b/docs/_sources/content/api/classes/system/FdemSystem.rst.txt @@ -0,0 +1,8 @@ +Frequency domain system +======================= + +.. inheritance-diagram:: geobipy.src.classes.system.FdemSystem + :parts: 1 + +.. automodule:: geobipy.src.classes.system.FdemSystem + :members: diff --git a/docs/_sources/content/api/classes/system/TdemSystem.rst.txt b/docs/_sources/content/api/classes/system/TdemSystem.rst.txt new file mode 100644 index 00000000..a2b39a53 --- /dev/null +++ b/docs/_sources/content/api/classes/system/TdemSystem.rst.txt @@ -0,0 +1,8 @@ +Time domain system +======================= + +.. inheritance-diagram:: geobipy.src.classes.system.TdemSystem + :parts: 1 + +.. automodule:: geobipy.src.classes.system.TdemSystem + :members: diff --git a/docs/_sources/content/api/classes/system/system.rst.txt b/docs/_sources/content/api/classes/system/system.rst.txt new file mode 100644 index 00000000..3921db3d --- /dev/null +++ b/docs/_sources/content/api/classes/system/system.rst.txt @@ -0,0 +1,10 @@ +System classes +============== + +.. toctree:: + :maxdepth: 1 + + EmLoop + CircularLoop + FdemSystem + TdemSystem diff --git a/docs/_sources/content/getting_started/getting_started.rst.txt b/docs/_sources/content/getting_started/getting_started.rst.txt new file mode 100644 index 00000000..959f125b --- /dev/null +++ b/docs/_sources/content/getting_started/getting_started.rst.txt @@ -0,0 +1,9 @@ +*************** +Getting Started +*************** + +.. toctree:: + :maxdepth: 1 + + installation + running_geobipy \ No newline at end of file diff --git a/docs/_sources/content/getting_started/installation.rst.txt b/docs/_sources/content/getting_started/installation.rst.txt new file mode 100644 index 00000000..d2af4d5c --- /dev/null +++ b/docs/_sources/content/getting_started/installation.rst.txt @@ -0,0 +1,195 @@ +****************** +Installing GeoBIPy +****************** + +First things first, install a Python 3.5+ distribution. This is the minimum version that we have tested with. +You will also need to install Numpy and a Fortran compiler. + +This package has a few requirements depending on what you wish to do with it. + +If you require a serial version of the code, see `Installing a serial version of GeoBIPy`_. + +If you require an parallel implementation, you will need to install an MPI library, and Python's mpi4py module. See `Installing MPI and mpi4py`_. + +If you require parallel file reading and writing, you will also need to install an MPI enabled HDF5 library, as well as Python's h5py wrapper to that library. It is important to read the notes below on installing h5py on top of a parallel HDF library. The traditional "pip install h5py" will not work correctly. See `Installing parallel HDF5 and h5py`_ to do this correctly. + +If you need to install the parallel IO version of the code, we would recommend that you start with a clean install of Python. This makes it easier to determine whether you have installed and linked the correct version of the parallel HDF5 library. + + +There are two versions when installing GeoBIPy, a serial version, and a parallel version. Since GeoBIPy uses a Fortran backend for forward modelling frequency domain data, you will need to have a Fortran compiler installed. Make sure that the compiler can handle derived data types since I make use of object oriented programming in Fortran. + +Installing a serial version of GeoBIPy +====================================== +This is the easiest installation and provides access to a serial implementation of the code. + +Simply clone the git repository, navigate to the package folder that contains the setup.py file, and type "pip install ." + +You should then be able to import modules from geobipy. For this type of installation mpi will not need to be installed, and the serial version of h5py will suffice i.e. the standard "pip install h5py" is fine. h5py will automatically be installed during the install of GeoBIPy since it is a dependency. + +**Side note:** Let's say you ran a production run on a parallel machine with MPI and parallel HDF capabilities. You generated all the results, copied them back to your local machine, and wish to make plots and images. You will only need to install the serial version of the code on your local machine to do this. + +Installing a parallel version of GeoBIPy +======================================== +Installing the parallel version of the code is a little trickier due to the dependencies necessary between the OpenMPI and/or HDF libraries, and how Python's mpi4py and h5py wrap around those. + + +Installing MPI and mpi4py +------------------------- +To run this code in parallel you will need both an MPI library and the python wrapper, mpi4py. You must install MPI first before mpi4py. + +MPI +^^^ + +If you are installing GeoBIPy on a parallel machine, I would think that you have access to prebuilt MPI libraries. +If you are on a local laptop, you will need to install one. + +mpi4py +^^^^^^ + +At this point, if you have an mpi4py module already installed, please remove it (you can check with "pip list"). +If you started with a clean installation you should not have to worry about this. +To test whether a new install of mpi4py will see the mpi library you have, just type "which mpicc". +The path that you see should point to the implementation that you want mpi4py to link to. +Make sure you are about to install mpi4py to the correct python installation. +If you type 'which python' it should return the path to the correct python distribution. +If you are using environments, make sure you have activated the correct one. + +Next, use "pip install mpi4py --no-cache-dir". This last option is very important, without it, pip might install its own MPI library called MPICH2. +I would try to avoid this because if you need to install the HDF5 library you will need know which directories to link to (see `Installing parallel HDF5 and h5py`_). + +At the end of the day, h5py needs to communicate with both the correct HDF5 library and mpi4py, and both of those need to communicate with the same MPI library. + +Installing parallel HDF5 and h5py +--------------------------------- +If a parallel HDF5 library is not available, you will need to install one. First make sure you follow `Installing MPI and mpi4py`_ so that an MPI library is available to you. You must install a HDF5 library first before h5py. + +HDF5 +^^^^ +When you install HDF5, make sure that the correct MPI library can be seen by typing "which mpicc". When you configure the HDF5 library, be sure to use the --enable-parallel option. + +h5py +^^^^ +Once the HDF5 library is installed you will need to install a parallel enabled `h5py package`_ + +.. _`h5py package`: https://github.com/h5py/h5py + +Make sure you are about to install h5py to the correct python installation. If you type 'which python' it should return the path to the correct python installation. + +First check the following + +- HDF5_DIR = Get the path to the HDF5 installation. +- Check that 'which mpicc' returns the correct version of an mpi enabled compiler. This needs to point to the same MPI library that mpi4py was installed on top of. + +- Do the following, replacing items in < > with your mpicc compiler and you HDF5 install directory. + +This will install h5py and compile the source. + +.. code:: bash + + CC= HDF5_MPI="ON" HDF5_DIR= pip install --no-binary=h5py h5py + +.. _Installing_time_domain_forward_modeller: + +Installing the time domain forward modeller +=========================================== +Ross Brodie at Geoscience Australia has written a great forward modeller, gatdaem1D, in C++ with a python interface. +You can obtain that code here at the `GA repository`_ + +.. _`GA repository`: https://github.com/GeoscienceAustralia/ga-aem + +Go ahead and "git clone" that repository. + +These instructions only describe how to install Ross' forward modeller, but it is part of a larger code base for inversion. +If you wish to install his entire package, please follow his instructions. + +Prerequisites +------------- + +To compile his forward modeller, you will need a c++ compiler, and `FFTW`_ + +.. _`FFTW`: http://www.fftw.org/ + +On a Mac, installing these two items is easy if you use a package manager such as `homebrew`_ + +.. _`homebrew`: https://brew.sh/ + +If you use brew, simply do the following + +.. code:: bash + + brew install gcc + brew install fftw + +If you do not have brew, or use a package manager, you can install fftw from source instead. + +Download fftw-3.3.7.tar.gz from the `FFTW downloads`_ . + +.. _`FFTW downloads`: http://www.fftw.org/download.html + +Untar the folder and install fftw using the following. + +.. code:: bash + + tar -zxvf fftw-3.3.7.tar.gz + cd fftw-3.3.7 + mkdir build + cd build + ../configure --prefix=path-to-install-to/fftw-3.3.7 --enable-threads + make + make install + +where, path-to-install-to is the location where you want fftw to be installed. + + +Compile the gatdaem1d shared library +------------------------------------ +Next, within the gatdaem1d folder, navigate to the makefiles folder and modify the top part of the file "gatdaem1d_python.make" to the following + +.. code:: bash + + SHELL = /bin/sh + .SUFFIXES: + .SUFFIXES: .cpp .o + cxx = g++ + cxxflags = -std=c++11 -O3 -Wall -fPIC + FFTW_DIR = path-to-fftw + + ldflags += -shared + bindir = ../python/gatdaem1d + + srcdir = ../src + objdir = ./obj + includes = -I$(srcdir) -I$(FFTW_DIR)/include + libs = -L$(FFTW_DIR)/lib -lfftw3 + library = $(bindir)/gatdaem1d.so + +You can find out where brew installed fftw by typing + +.. code:: bash + + brew info fftw + +Which may return something like "/usr/local/Cellar/fftw/3.3.5" + +In this case, path-to-fftw is "/usr/local/Cellar/fftw/3.3.5" + +If you installed fftw from source, then path-to-fftw is that install path. + +Next, type the following to compile the gatdaem1d c++ code. + +.. code:: bash + + make -f gatdaem1d_python.make + +Installing the Python Bindings +------------------------------ + +Finally, to install the python wrapper to gatdaem1d, navigate to the python folder of the gatdaem1d repository. +Type, + +.. code:: bash + + pip install . + +You should now have access to the time domain forward modeller within geobipy. + diff --git a/docs/_sources/content/getting_started/running_geobipy.rst.txt b/docs/_sources/content/getting_started/running_geobipy.rst.txt new file mode 100644 index 00000000..2e1ca0eb --- /dev/null +++ b/docs/_sources/content/getting_started/running_geobipy.rst.txt @@ -0,0 +1,197 @@ +*************** +Running GeoBIPy +*************** +There are two methods of running GeoBIPy from the command line once it is installed. +For the serial version the following can be used + +.. code:: bash + + geobipySerial + +For a parallel installed version use the following, (replace the MPI redirect with whatever is suitable for your machine) + +.. code:: bash + + mpirun geobipyParallel + +In both cases, specifies where the HDF5 files will be written, while the is a python script that contains the customizable parameters for GeoBIPy. +Below is an example scipt that you can use for reference. + +.. highlight:: python +.. code-block:: python + + # General information about specifying parameters. + # The following list of parameters can be given either a single value or a list of values + # of length equal to the number of systems in the data. If one value is specified and there + # are multiple systems, that value is used for all of them. + # initialRelativeError + # minimumRelativeError + # maximumRelativeError + # initialAdditiveError + # minimumAdditiveError + # maximumAdditiveError + # relativeErrorProposalVariance + # additiveErrorProposalVariance + + # ------------------------------------------------------- + # General file structure information. + # ------------------------------------------------------- + # Data folder + data_directory = "..//..//supplementary//data" + # The data_filename and system_filename options are single strings for single system dataset, + # or a list of str for multi-system datasets like Skytem. + # Data File Name. If there are multiple, encompass them with [ ]. + data_filename = data_directory + "//Resolve_single.txt" + # System File Name. If there are multiple, encompass them with [ ]. + system_filename = data_directory + "//FdemSystem2.stm" + + # Define the data type to invert + data_type = FdemData + + # Maximum number of Markov Chains per data point. + n_markov_chains = 10000 + + # ------------------------------------------------------- + # General GeoBIPy options. + # ------------------------------------------------------- + # Interactively plot a single data point as it progresses + interactive_plot = False + # How often to update the plot. (lower is generally slower) + update_plot_every = 1000 + # Save a PNG of the final results for each data point. + save_png = False + # Save the results of the McMC inversion to HDF5 files. (Generally always True) + save_hdf5 = True + + # ------------------------------------------------------- + # Turning on or off different solvable parameters. + # ------------------------------------------------------- + # Parameter Priors + # solveParameter will prevent parameters from exploding to very large or very small numbers. + # solveGradient prevents large changes in parameters value from occurring. + # If both of these are active, the recovered earth models generally contain + # less layers due to an implicit constraint. + # If you feel that your recovered models are too conservative, try turning one of these off. + # It is highly recommended to have at least one of these options turned on! + # Use a prior on the parameter magnitude. + solve_parameter = False + # Use the Prior on the difference in log parameter diff(log(X)) + solve_gradient = True + + # Use the prior on the relative data errors + solve_relative_error = True + # Use the prior on the additive data errors + solve_additive_error = True + # Use the prior on the data height + solve_height = True + # Use the prior on the calibration parameters for the data + solve_calibration = False + + # ------------------------------------------------------- + # Prior Details + # ------------------------------------------------------- + # Earth model prior details + # ------------------------- + # Maximum number of layers in the 1D model + maximum_number_of_layers = 30 + # Minimum layer depth in metres + minimum_depth = 1.0 + # Maximum layer depth in metres + maximum_depth = 150.0 + # Minimum layer thickness. + # If minimumThickness: None, it will be autocalculated. + minimum_thickness = None + + # Data prior details + # ------------------ + # The data priors are imposed on three different aspects of the data. + # The relative and additive error and the elevation of the data point. + # Data uncertainty priors are used if solveRelativeError or solveAdditiveError are True. + # If the data file contains columns of the estimated standard deviations, they are used as the initial values + # when starting an McMC inversion. If the file does not contain these estimates, then the initial + # values are used below as sqrt((relative * data)^2 + (additive)^2). + + # Assign an initial percentage relative Error + # If the file contains no standard deviations, this will be used + # to assign the initial data uncertainties. + initial_relative_error = 0.05 + ## Relative Error Prior Details + # Minimum Relative Error + minimum_relative_error = 0.001 + # Maximum Relative Error + maximum_relative_error = 0.5 + + # Assign an initial additive error level. + # If the file contains no standard deviations, this will be used + # to assign the initial data uncertainties. + initial_additive_error = 5.0 + # Additive Error Prior Details + # Minimum Additive Error + minimum_additive_error = 3.0 + # Maximum Relative Error + maximum_additive_error = 20.0 + + # Elevation range allowed (m), either side of measured height + maximum_height_change = 1.0 + + # ------------------------------------------------------- + # Proposal details + # ------------------------------------------------------- + + # Data proposal details + # --------------------- + # The relative, additive, and elevation proposal variances are assigned to + # normal distributions with a mean equal to its value in the current model (of the Markov chain) + # These variances are used when we randomly choose a new value for that given variable. + # Proposal variance for the relative error + relative_error_proposal_variance = 2.5e-7 + # Proposal variance for the additive error + additive_error_proposal_variance = 1.0e-4 + # Proposal variance of the elevation + height_proposal_variance = 0.01 + + # Earth model proposal details + # ---------------------------- + # Evolution Probabilities for earth model manipulation during the Markov chain. + # These four values are internally scaled such that their sum is 1.0. + # Probability that a layer is inserted into the model. + probability_of_birth = 1.0/6.0 + # Probablitiy that a layer is removed from the model. + probability_of_death = 1.0/6.0 + # Probability that an interface in the model is perturbed. + probability_of_perturb = 1.0/6.0 + # Probability of no change occuring to the layers of the model. + probability_of_no_change = 0.5 + + # ------------------------------------------------------- + # Typically Defaulted parameters + # ------------------------------------------------------- + # Standard Deviation of log(rho): log(1 + factor) + # Default is 10.0 + factor = None + # Standard Deviation for the difference in layer resistivity + # Default is 1.5 + gradient_standard_deviation = None + # Initial scaling factor for proposal covariance + covariance_scaling = None + # Scaling factor for data misfit + multiplier = None + # Clipping Ratio for interface contrasts + clip_ratio = None + # Only sample the prior + ignore_likelihood = False + + # Impose bounds on the parameter value + # None, or a length 2 list i.e. [a, b] + parameter_limits = None + + # Display the resistivity? + reciprocate_parameters = True + + verbose = False + + # Don't change this. + if (timeDomain): + dataInit = 'TdemData()' + else: + dataInit = 'FdemData()' \ No newline at end of file diff --git a/docs/_sources/examples/1D_Inference/index.rst.txt b/docs/_sources/examples/1D_Inference/index.rst.txt new file mode 100644 index 00000000..2a48accb --- /dev/null +++ b/docs/_sources/examples/1D_Inference/index.rst.txt @@ -0,0 +1,86 @@ + + +.. _sphx_glr_examples_1D_Inference: + +1D Inference +============ + +There are a couple of ways to run an inference using geobipy, the first is via command line using + +.. code-block:: bash + + geobipy skytem_options.py + +The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples) + + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/1D_Inference/images/thumb/sphx_glr_plot_inference_1d_resolve_thumb.png + :alt: + + :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_resolve.py` + +.. raw:: html + +
Running GeoBIPy to invert Resolve data
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/1D_Inference/images/thumb/sphx_glr_plot_inference_1d_skytem_thumb.png + :alt: + + :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_skytem.py` + +.. raw:: html + +
Running GeoBIPy to invert Skytem data
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/1D_Inference/images/thumb/sphx_glr_plot_inference_1d_tempest_thumb.png + :alt: + + :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_tempest.py` + +.. raw:: html + +
Running GeoBIPy to invert Tempest data
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/1D_Inference/plot_inference_1d_resolve + /examples/1D_Inference/plot_inference_1d_skytem + /examples/1D_Inference/plot_inference_1d_tempest + diff --git a/docs/_sources/examples/1D_Inference/plot_inference_1d_resolve.rst.txt b/docs/_sources/examples/1D_Inference/plot_inference_1d_resolve.rst.txt new file mode 100644 index 00000000..aad9bb4a --- /dev/null +++ b/docs/_sources/examples/1D_Inference/plot_inference_1d_resolve.rst.txt @@ -0,0 +1,197 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/1D_Inference/plot_inference_1d_resolve.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_1D_Inference_plot_inference_1d_resolve.py: + + +Running GeoBIPy to invert Resolve data +-------------------------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-40 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + data_type = "Resolve" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 43-87 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + parameter_file = "../../supplementary/options_files/{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=2, **kwargs) + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_resolve_001.png + :alt: plot inference 1d resolve + :srcset: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_resolve_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_resolve_002.png + :alt: Fiducial [2], Frequency Domain EM Data + :srcset: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_resolve_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ../../supplementary/options_files/Resolve_options + Output files will be produced at Resolve/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary//data//Resolve_glacial.csv and system files ..//..//supplementary//data//FdemSystem2.stm + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:00.097752 h:m:s + i=5000, k=2, acc=*34.600, 0.007 s/Model, 35.645 s Elapsed + + Remaining Points -2/1 || Elapsed Time: 0:00:36.760574 h:m:s || ETA 0:00:12.253525 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 37.269 seconds) + + +.. _sphx_glr_download_examples_1D_Inference_plot_inference_1d_resolve.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_resolve.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_resolve.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/1D_Inference/plot_inference_1d_skytem.rst.txt b/docs/_sources/examples/1D_Inference/plot_inference_1d_skytem.rst.txt new file mode 100644 index 00000000..d50f5bc9 --- /dev/null +++ b/docs/_sources/examples/1D_Inference/plot_inference_1d_skytem.rst.txt @@ -0,0 +1,180 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/1D_Inference/plot_inference_1d_skytem.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_1D_Inference_plot_inference_1d_skytem.py: + + +Running GeoBIPy to invert Skytem data +------------------------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-40 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + data_type = "Skytem_512" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 43-87 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + parameter_file = "../../supplementary/options_files/{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=2, **kwargs) + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ../../supplementary/options_files/Skytem_512_options + Output files will be produced at Skytem_512/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary//data//Skytem_512_glacial.csv and system files ['..//..//supplementary//data/SkytemHM_512.stm', '..//..//supplementary//data/SkytemLM_512.stm'] + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:00.170724 h:m:s + i=5000, k=6, acc=*17.440, 0.012 s/Model, 58.130 s Elapsed + + Remaining Points -2/1 || Elapsed Time: 0:00:58.301548 h:m:s || ETA 0:00:19.433849 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 58.527 seconds) + + +.. _sphx_glr_download_examples_1D_Inference_plot_inference_1d_skytem.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_skytem.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_skytem.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/1D_Inference/plot_inference_1d_tempest.rst.txt b/docs/_sources/examples/1D_Inference/plot_inference_1d_tempest.rst.txt new file mode 100644 index 00000000..0e4ab25b --- /dev/null +++ b/docs/_sources/examples/1D_Inference/plot_inference_1d_tempest.rst.txt @@ -0,0 +1,198 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/1D_Inference/plot_inference_1d_tempest.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_1D_Inference_plot_inference_1d_tempest.py: + + +Running GeoBIPy to invert Tempest data +-------------------------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-40 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + data_type = "Tempest" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 43-88 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + parameter_file = "../../supplementary/options_files/{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv' + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=2, **kwargs) + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_tempest_001.png + :alt: plot inference 1d tempest + :srcset: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_tempest_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_tempest_002.png + :alt: Fiducial [2.], Time Domain EM Data + :srcset: /examples/1D_Inference/images/sphx_glr_plot_inference_1d_tempest_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ../../supplementary/options_files/Tempest_options + Output files will be produced at Tempest/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary//data//Tempest_glacial.csv and system files ..//..//supplementary//data/Tempest.stm + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:00.264718 h:m:s + i=5000, k=7, acc=*27.680, 0.016 s/Model, 79.015 s Elapsed + + Remaining Points -2/1 || Elapsed Time: 0:01:20.439016 h:m:s || ETA 0:00:26.813005 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 21.185 seconds) + + +.. _sphx_glr_download_examples_1D_Inference_plot_inference_1d_tempest.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_tempest.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_tempest.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/1D_Inference/readme.rst.txt b/docs/_sources/examples/1D_Inference/readme.rst.txt new file mode 100644 index 00000000..9c93f798 --- /dev/null +++ b/docs/_sources/examples/1D_Inference/readme.rst.txt @@ -0,0 +1,11 @@ +1D Inference +============ + +There are a couple of ways to run an inference using geobipy, the first is via command line using + +.. code-block:: bash + + geobipy skytem_options.py + +The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples) diff --git a/docs/_sources/examples/1D_Inference/sg_execution_times.rst.txt b/docs/_sources/examples/1D_Inference/sg_execution_times.rst.txt new file mode 100644 index 00000000..d9f42844 --- /dev/null +++ b/docs/_sources/examples/1D_Inference/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_1D_Inference_sg_execution_times: + + +Computation times +================= +**02:56.981** total execution time for 3 files **from examples/1D_Inference**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_tempest.py` (``plot_inference_1d_tempest.py``) + - 01:21.185 + - 0.0 + * - :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_skytem.py` (``plot_inference_1d_skytem.py``) + - 00:58.527 + - 0.0 + * - :ref:`sphx_glr_examples_1D_Inference_plot_inference_1d_resolve.py` (``plot_inference_1d_resolve.py``) + - 00:37.269 + - 0.0 diff --git a/docs/_sources/examples/Data/README.rst.txt b/docs/_sources/examples/Data/README.rst.txt new file mode 100644 index 00000000..f18be396 --- /dev/null +++ b/docs/_sources/examples/Data/README.rst.txt @@ -0,0 +1,2 @@ +Data +==== \ No newline at end of file diff --git a/docs/_sources/examples/Data/index.rst.txt b/docs/_sources/examples/Data/index.rst.txt new file mode 100644 index 00000000..ebda9d4f --- /dev/null +++ b/docs/_sources/examples/Data/index.rst.txt @@ -0,0 +1,17 @@ + + +.. _sphx_glr_examples_Data: + +Data +==== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ diff --git a/docs/_sources/examples/Data/sg_execution_times.rst.txt b/docs/_sources/examples/Data/sg_execution_times.rst.txt new file mode 100644 index 00000000..67b49694 --- /dev/null +++ b/docs/_sources/examples/Data/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_Data_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from examples/Data**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_sources/examples/Datapoints/README.rst.txt b/docs/_sources/examples/Datapoints/README.rst.txt new file mode 100644 index 00000000..4b1753c1 --- /dev/null +++ b/docs/_sources/examples/Datapoints/README.rst.txt @@ -0,0 +1,2 @@ +Datapoints +========== \ No newline at end of file diff --git a/docs/_sources/examples/Datapoints/index.rst.txt b/docs/_sources/examples/Datapoints/index.rst.txt new file mode 100644 index 00000000..20df3cf8 --- /dev/null +++ b/docs/_sources/examples/Datapoints/index.rst.txt @@ -0,0 +1,76 @@ + + +.. _sphx_glr_examples_Datapoints: + +Datapoints +========== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_resolve_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_resolve_datapoint.py` + +.. raw:: html + +
Frequency domain datapoint
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_skytem_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_skytem_datapoint.py` + +.. raw:: html + +
Skytem Datapoint Class
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_tempest_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_tempest_datapoint.py` + +.. raw:: html + +
Tempest Datapoint Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Datapoints/plot_resolve_datapoint + /examples/Datapoints/plot_skytem_datapoint + /examples/Datapoints/plot_tempest_datapoint + diff --git a/docs/_sources/examples/Datapoints/plot_resolve_datapoint.rst.txt b/docs/_sources/examples/Datapoints/plot_resolve_datapoint.rst.txt new file mode 100644 index 00000000..c6e08928 --- /dev/null +++ b/docs/_sources/examples/Datapoints/plot_resolve_datapoint.rst.txt @@ -0,0 +1,344 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Datapoints/plot_resolve_datapoint.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Datapoints_plot_resolve_datapoint.py: + + +Frequency domain datapoint +-------------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 6-88 + +.. code-block:: Python + + from os.path import join + import numpy as np + import h5py + import matplotlib.pyplot as plt + from geobipy import CircularLoops + from geobipy import FdemSystem + from geobipy import FdemData + from geobipy import FdemDataPoint + from geobipy import RectilinearMesh1D + from geobipy import Model + from geobipy import StatArray + from geobipy import Distribution + + # Instantiating a frequency domain data point + # +++++++++++++++++++++++++++++++++++++++++++ + # + # To instantiate a frequency domain datapoint we need to define some + # characteristics of the acquisition system. + # + # We need to define the frequencies in Hz of the transmitter, + # and the geometery of the loops used for each frequency. + + frequencies = np.asarray([380.0, 1776.0, 3345.0, 8171.0, 41020.0, 129550.0]) + + # Transmitter positions are defined relative to the observation locations in the data + # This is usually a constant offset for all data points. + transmitters = CircularLoops(orientation=['z','z','x','z','z','z'], + moment=np.r_[1, 1, -1, 1, 1, 1], + x = np.r_[0,0,0,0,0,0], + y = np.r_[0,0,0,0,0,0], + z = np.r_[0,0,0,0,0,0], + pitch = np.r_[0,0,0,0,0,0], + roll = np.r_[0,0,0,0,0,0], + yaw = np.r_[0,0,0,0,0,0], + radius = np.r_[1,1,1,1,1,1]) + + # Receiver positions are defined relative to the transmitter + receivers = CircularLoops(orientation=['z','z','x','z','z','z'], + moment=np.r_[1, 1, -1, 1, 1, 1], + x = np.r_[7.91, 7.91, 9.03, 7.91, 7.91, 7.89], + y = np.r_[0,0,0,0,0,0], + z = np.r_[0,0,0,0,0,0], + pitch = np.r_[0,0,0,0,0,0], + roll = np.r_[0,0,0,0,0,0], + yaw = np.r_[0,0,0,0,0,0], + radius = np.r_[1,1,1,1,1,1]) + + # Now we can instantiate the system. + fds = FdemSystem(frequencies, transmitters, receivers) + + # And use the system to instantiate a datapoint + # + # Note the extra arguments that can be used to create the data point. + # data is for any observed data one might have, while std are the estimated standard + # deviations of those observed data. + # + # Define some in-phase then quadrature data for each frequency. + data = np.r_[145.3, 435.8, 260.6, 875.1, 1502.7, 1516.9, + 217.9, 412.5, 178.7, 516.5, 405.7, 255.7] + + fdp = FdemDataPoint(x=0.0, y=0.0, z=30.0, elevation=0.0, + data=data, std=None, predictedData=None, + system=fds, lineNumber=0.0, fiducial=0.0) + + # plt.figure() + # _ = fdp.plot() + + # Obtaining a datapoint from a dataset + # ++++++++++++++++++++++++++++++++++++ + # + # More often than not, our observed data is stored in a file on disk. + # We can read in a dataset and pull datapoints from it. + # + # For more information about the frequency domain data set see :ref:`Frequency domain dataset` + + # Set some paths and file names + dataFolder = "..//..//supplementary//Data//" + # The data file name + dataFile = dataFolder + 'Resolve2.txt' + # The EM system file name + systemFile = dataFolder + 'FdemSystem2.stm' + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 89-91 + +Initialize and read an EM data set +Prepare the dataset so that we can read a point at a time. + +.. GENERATED FROM PYTHON SOURCE LINES 91-94 + +.. code-block:: Python + + Dataset = FdemData._initialize_sequential_reading(dataFile, systemFile) + # Get a datapoint from the file. + fdp = Dataset._read_record() + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 95-227 + +.. code-block:: Python + + + # # Initialize and read an EM data set + # D = FdemData.read_csv(dataFile,systemFile) + + # # Get a data point from the dataset + # fdp = D.datapoint(0) + # plt.figure() + # _ = fdp.plot() + + # Using a resolve datapoint + # +++++++++++++++++++++++++ + + # We can define a 1D layered earth model, and use it to predict some data + nCells = 19 + par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$") + depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm') + depth[-1] = np.inf + mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par) + + # Forward model the data + fdp.forward(mod) + + plt.figure() + plt.subplot(121) + _ = mod.pcolor(transpose=True) + plt.subplot(122) + _ = fdp.plot_predicted() + plt.tight_layout() + + # Compute the sensitivity matrix for a given model + J = fdp.sensitivity(mod) + + plt.figure() + _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + + # Attaching statistical descriptors to the resolve datapoint + # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + # Set values of relative and additive error for both systems. + fdp.relative_error = 0.05 + fdp.additive_error = 10.0 + # Define a multivariate log normal distribution as the prior on the predicted data. + fdp.predictedData.prior = Distribution('MvLogNormal', fdp.data[fdp.active], fdp.std[fdp.active]**2.0, prng=prng) + + # This allows us to evaluate the likelihood of the predicted data + print(fdp.likelihood(log=True)) + # Or the misfit + print(fdp.data_misfit()) + + # Plot the misfits for a range of half space conductivities + plt.figure() + _ = fdp.plotHalfSpaceResponses(-6.0, 4.0, 200) + + plt.title("Halfspace responses"); + + # We can perform a quick search for the best fitting half space + halfspace = fdp.find_best_halfspace() + print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) + plt.figure() + _ = fdp.plot() + _ = fdp.plot_predicted() + + # Compute the misfit between observed and predicted data + print(fdp.data_misfit()) + + # We can attach priors to the height of the datapoint, + # the relative error multiplier, and the additive error noise floor + + + # Define the distributions used as priors. + zPrior = Distribution('Uniform', min=np.float64(fdp.z) - 2.0, max=np.float64(fdp.z) + 2.0, prng=prng) + relativePrior = Distribution('Uniform', min=0.01, max=0.5, prng=prng) + additivePrior = Distribution('Uniform', min=5, max=15, prng=prng) + fdp.set_priors(z_prior=zPrior, relative_error_prior=relativePrior, additive_error_prior=additivePrior, prng=prng) + + + # In order to perturb our solvable parameters, we need to attach proposal distributions + z_proposal = Distribution('Normal', mean=fdp.z, variance = 0.01, prng=prng) + relativeProposal = Distribution('MvNormal', mean=fdp.relative_error, variance=2.5e-7, prng=prng) + additiveProposal = Distribution('MvLogNormal', mean=fdp.additive_error, variance=1e-4, prng=prng) + fdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal) + + # With priors set we can auto generate the posteriors + fdp.set_posteriors() + + + nCells = 19 + par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$") + depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm') + depth[-1] = np.inf + mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par) + fdp.forward(mod) + + # Perturb the datapoint and record the perturbations + for i in range(10): + fdp.perturb() + fdp.update_posteriors() + + + # Plot the posterior distributions + # fig = plt.figure() + fdp.plot_posteriors(overlay=fdp) + + import h5py + with h5py.File('fdp.h5', 'w') as f: + fdp.createHdf(f, 'fdp', withPosterior=True) + fdp.writeHdf(f, 'fdp', withPosterior=True) + + with h5py.File('fdp.h5', 'r') as f: + fdp1 = FdemDataPoint.fromHdf(f['fdp']) + + fdp1.plot_posteriors(overlay=fdp1) + + import h5py + with h5py.File('fdp.h5', 'w') as f: + fdp.createHdf(f, 'fdp', withPosterior=True, add_axis=np.arange(10.0)) + + for i in range(10): + fdp.writeHdf(f, 'fdp', withPosterior=True, index=i) + + from geobipy import FdemData + with h5py.File('fdp.h5', 'r') as f: + fdp1 = FdemDataPoint.fromHdf(f['fdp'], index=0) + fdp2 = FdemData.fromHdf(f['fdp']) + + fdp1.plot_posteriors(overlay=fdp1) + + plt.show() + # %% + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_001.png + :alt: Frequency Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_002.png + :alt: plot resolve datapoint + :srcset: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_003.png + :alt: Halfspace responses + :srcset: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_004.png + :alt: Frequency Domain EM Data, Frequency Domain EM Data, Frequency Domain EM Data, Frequency Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_resolve_datapoint_004.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + -733.5454886696688 + 1367.81945885548 + Best half space conductivity is [0.097701] $S/m$ + 45286.828623928755 + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 8.395 seconds) + + +.. _sphx_glr_download_examples_Datapoints_plot_resolve_datapoint.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_resolve_datapoint.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_resolve_datapoint.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Datapoints/plot_skytem_datapoint.rst.txt b/docs/_sources/examples/Datapoints/plot_skytem_datapoint.rst.txt new file mode 100644 index 00000000..0207708a --- /dev/null +++ b/docs/_sources/examples/Datapoints/plot_skytem_datapoint.rst.txt @@ -0,0 +1,568 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Datapoints/plot_skytem_datapoint.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Datapoints_plot_skytem_datapoint.py: + + +Skytem Datapoint Class +---------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 7-15 + +Credits: +We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +https://github.com/GeoscienceAustralia/ga-aem + +For ground-based time domain data, we are using Dieter Werthmuller's python package Empymod +https://empymod.github.io/ + +Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy + +.. GENERATED FROM PYTHON SOURCE LINES 17-46 + +.. code-block:: Python + + from os.path import join + import numpy as np + import h5py + import matplotlib.pyplot as plt + from geobipy import Waveform + from geobipy import SquareLoop, CircularLoop + from geobipy import butterworth + from geobipy import TdemSystem + from geobipy import TdemData + from geobipy import TdemDataPoint + from geobipy import RectilinearMesh1D + from geobipy import Model + from geobipy import StatArray + from geobipy import Distribution + + dataFolder = "..//..//supplementary//data//" + + # Obtaining a datapoint from a dataset + # ++++++++++++++++++++++++++++++++++++ + # More often than not, our observed data is stored in a file on disk. + # We can read in a dataset and pull datapoints from it. + # + # For more information about the time domain data set, see :ref:`Time domain dataset` + + # The data file name + dataFile=dataFolder + 'skytem_512_saline_clay.csv' + # The EM system file name + systemFile=[dataFolder + 'SkytemHM_512.stm', dataFolder + 'SkytemLM_512.stm'] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 47-49 + +Initialize and read an EM data set +Prepare the dataset so that we can read a point at a time. + +.. GENERATED FROM PYTHON SOURCE LINES 49-55 + +.. code-block:: Python + + Dataset = TdemData._initialize_sequential_reading(dataFile, systemFile) + # Get a datapoint from the file. + tdp = Dataset._read_record() + + Dataset._file.close() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 56-58 + +Using a time domain datapoint ++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 60-61 + +We can define a 1D layered earth model, and use it to predict some data + +.. GENERATED FROM PYTHON SOURCE LINES 61-64 + +.. code-block:: Python + + par = StatArray(np.r_[500.0, 20.0], "Conductivity", "$\frac{S}{m}$") + mod = Model(RectilinearMesh1D(edges=np.r_[0, 75.0, np.inf]), values=par) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 65-66 + +Forward model the data + +.. GENERATED FROM PYTHON SOURCE LINES 66-68 + +.. code-block:: Python + + tdp.forward(mod) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 69-77 + +.. code-block:: Python + + plt.figure() + plt.subplot(121) + _ = mod.pcolor() + plt.subplot(122) + _ = tdp.plot() + _ = tdp.plot_predicted() + plt.tight_layout() + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_001.png + :alt: Time Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /Users/nfoks/codes/repositories/geobipy/geobipy/src/classes/data/datapoint/TdemDataPoint.py:354: RuntimeWarning: divide by zero encountered in log + additive_error = exp(log(self.additive_error[i]) - 0.5 * (log(off_times) - log(1e-3))) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 78-82 + +.. code-block:: Python + + plt.figure() + tdp.plotDataResidual(yscale='log', xscale='log') + plt.title('new') + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_002.png + :alt: new + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + Text(0.5, 1.0, 'new') + + + +.. GENERATED FROM PYTHON SOURCE LINES 83-84 + +Compute the sensitivity matrix for a given model + +.. GENERATED FROM PYTHON SOURCE LINES 84-88 + +.. code-block:: Python + + J = tdp.sensitivity(mod) + plt.figure() + _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_003.png + :alt: plot skytem datapoint + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 89-91 + +Attaching statistical descriptors to the skytem datapoint ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 91-102 + +.. code-block:: Python + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + # Set values of relative and additive error for both systems. + tdp.relative_error = np.r_[0.05, 0.05] + tdp.additive_error = np.r_[1e-14, 1e-13] + # Define a multivariate log normal distribution as the prior on the predicted data. + tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 103-104 + +This allows us to evaluate the likelihood of the predicted data + +.. GENERATED FROM PYTHON SOURCE LINES 104-108 + +.. code-block:: Python + + print(tdp.likelihood(log=True)) + # Or the misfit + print(tdp.data_misfit()) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + -324824.70759632764 + 652129.2354668385 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 109-110 + +Plot the misfits for a range of half space conductivities + +.. GENERATED FROM PYTHON SOURCE LINES 110-114 + +.. code-block:: Python + + plt.figure() + _ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200) + plt.title("Halfspace responses") + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_004.png + :alt: Halfspace responses + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_004.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + Text(0.5, 1.0, 'Halfspace responses') + + + +.. GENERATED FROM PYTHON SOURCE LINES 115-116 + +We can perform a quick search for the best fitting half space + +.. GENERATED FROM PYTHON SOURCE LINES 116-123 + +.. code-block:: Python + + halfspace = tdp.find_best_halfspace() + + print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) + plt.figure() + _ = tdp.plot() + _ = tdp.plot_predicted() + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_005.png + :alt: Time Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_005.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Best half space conductivity is [0.01047616] $S/m$ + + + + +.. GENERATED FROM PYTHON SOURCE LINES 124-125 + +Compute the misfit between observed and predicted data + +.. GENERATED FROM PYTHON SOURCE LINES 125-127 + +.. code-block:: Python + + print(tdp.data_misfit()) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 19992.94964076136 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 128-130 + +We can attach priors to the height of the datapoint, +the relative error multiplier, and the additive error noise floor + +.. GENERATED FROM PYTHON SOURCE LINES 130-137 + +.. code-block:: Python + + + # Define the distributions used as priors. + z_prior = Distribution('Uniform', min=np.float64(tdp.z) - 2.0, max=np.float64(tdp.z) + 2.0, prng=prng) + relativePrior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng) + additivePrior = Distribution('Uniform', min=np.r_[1e-16, 1e-16], max=np.r_[1e-10, 1e-10], log=True, prng=prng) + tdp.set_priors(relative_error_prior=relativePrior, additive_error_prior=additivePrior, z_prior=z_prior, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 138-139 + +In order to perturb our solvable parameters, we need to attach proposal distributions + +.. GENERATED FROM PYTHON SOURCE LINES 139-144 + +.. code-block:: Python + + z_proposal = Distribution('Normal', mean=tdp.z, variance = 0.01, prng=prng) + relativeProposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-7, prng=prng) + additiveProposal = Distribution('MvLogNormal', mean=tdp.additive_error, variance=2.5e-3, linearSpace=True, prng=prng) + tdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 145-146 + +With priorss set we can auto generate the posteriors + +.. GENERATED FROM PYTHON SOURCE LINES 146-148 + +.. code-block:: Python + + tdp.set_posteriors() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 149-151 + +Perturb the datapoint and record the perturbations +Note we are not using the priors to accept or reject perturbations. + +.. GENERATED FROM PYTHON SOURCE LINES 151-156 + +.. code-block:: Python + + for i in range(10): + tdp.perturb() + tdp.update_posteriors() + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 157-158 + +Plot the posterior distributions + +.. GENERATED FROM PYTHON SOURCE LINES 158-162 + +.. code-block:: Python + + tdp.plot_posteriors(overlay=tdp) + + plt.show() + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_006.png + :alt: Time Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_skytem_datapoint_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 163-240 + +File Format for a time domain datapoint ++++++++++++++++++++++++++++++++++++++++ +Here we describe the file format for a time domain datapoint. + +For individual datapoints we are using the AarhusInv data format. + +Here we take the description for the AarhusInv TEM data file, modified to reflect what we can +currently handle in GeoBIPy. + +Line 1 :: string + User-defined label describing the TEM datapoint. + This line must contain the following, separated by semicolons. + XUTM= + YUTM= + Elevation= + StationNumber= + LineNumber= + Current= + +Line 2 :: first integer, sourceType + 7 = Rectangular loop source parallel to the x - y plane +Line 2 :: second integer, polarization + 3 = Vertical magnetic field + +Line 3 :: 6 floats, transmitter and receiver offsets relative to X/Y UTM location. + If sourceType = 7, Position of the center loop sounding. + +Line 4 :: Transmitter loop dimensions + If sourceType = 7, 2 floats. Loop side length in the x and y directions + +Line 5 :: Fixed + 3 3 3 + +Line 6 :: first integer, transmitter waveform type. Fixed + 3 = User defined waveform. + +Line 6 :: second integer, number of transmitter waveforms. Fixed + 1 + +Line 7 :: transmitter waveform definition + A user-defined waveform with piecewise linear segments. + A full transmitter waveform definition consists of a number of linear segments + This line contains an integer as the first entry, which specifies the number of + segments, followed by each segment with 4 floats each. The 4 floats per segment + are the start and end times, and start and end amplitudes of the waveform. e.g. + 3 -8.333e-03 -8.033e-03 0.0 1.0 -8.033e-03 0.0 1.0 1.0 0.0 5.4e-06 1.0 0.0 + +Line 8 :: On time information. Not used but needs specifying. + 1 1 1 + +Line 9 :: On time low-pass filters. Not used but need specifying. + 0 + +Line 10 :: On time high-pass filters. Not used but need specifying. + 0 + +Line 11 :: Front-gate time. Not used but need specifying. + 0.0 + +Line 12 :: first integer, Number of off time filters + Number of filters + +Line 12 :: second integer, Order of the butterworth filter + 1 or 2 + +Line 12 :: cutoff frequencies Hz, one per the number of filters + e.g. 4.5e5 + +Line 13 :: Off time high pass filters. + See Line 12 + +Lines after 13 contain 3 columns that pertain to +Measurement Time, Data Value, Estimated Standard Deviation + +Example data files are contained in +`the supplementary folder`_ in this repository + +.. _the supplementary folder: https://github.com/usgs/geobipy/tree/master/documentation_source/source/examples/supplementary/Data + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 3.346 seconds) + + +.. _sphx_glr_download_examples_Datapoints_plot_skytem_datapoint.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_skytem_datapoint.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_skytem_datapoint.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Datapoints/plot_tempest_datapoint.rst.txt b/docs/_sources/examples/Datapoints/plot_tempest_datapoint.rst.txt new file mode 100644 index 00000000..bb082f31 --- /dev/null +++ b/docs/_sources/examples/Datapoints/plot_tempest_datapoint.rst.txt @@ -0,0 +1,439 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Datapoints/plot_tempest_datapoint.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Datapoints_plot_tempest_datapoint.py: + + +Tempest Datapoint Class +----------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 7-15 + +Credits: +We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +https://github.com/GeoscienceAustralia/ga-aem + +For ground-based time domain data, we are using Dieter Werthmuller's python package Empymod +https://empymod.github.io/ + +Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy + +.. GENERATED FROM PYTHON SOURCE LINES 17-54 + +.. code-block:: Python + + from os.path import join + import numpy as np + import h5py + import matplotlib.pyplot as plt + from geobipy import TempestData + # from geobipy import TemDataPoint + from geobipy import RectilinearMesh1D + from geobipy import Model + from geobipy import StatArray + from geobipy import Distribution + from geobipy import get_prng + + dataFolder = "..//..//supplementary//data//" + # dataFolder = "source//examples//supplementary//Data" + + # Obtaining a tempest datapoint from a dataset + # ++++++++++++++++++++++++++++++++++++++++++++ + # More often than not, our observed data is stored in a file on disk. + # We can read in a dataset and pull datapoints from it. + # + # For more information about the time domain data set, see :ref:`Time domain dataset` + + # The data file name + dataFile = dataFolder + 'tempest_saline_clay.csv' + # The EM system file name + systemFile = dataFolder + 'Tempest.stm' + + # Prepare the dataset so that we can read a point at a time. + Dataset = TempestData._initialize_sequential_reading(dataFile, systemFile) + # Get a datapoint from the file. + tdp = Dataset._read_record(0) + + plt.figure() + tdp.plot() + + prng = get_prng(seed=146100583096709124601953385843316024947) + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_001.png + :alt: Time Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 55-57 + +Using a tempest domain datapoint +++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 59-60 + +We can define a 1D layered earth model, and use it to predict some data + +.. GENERATED FROM PYTHON SOURCE LINES 60-67 + +.. code-block:: Python + + par = StatArray(np.r_[0.01, 0.1, 1.], "Conductivity", "$\frac{S}{m}$") + mod = Model(mesh=RectilinearMesh1D(edges=np.r_[0.0, 50.0, 75.0, np.inf]), values=par) + + par = StatArray(np.logspace(-3, 3, 30), "Conductivity", "$\frac{S}{m}$") + e = np.linspace(0, 350, 31); e[-1] = np.inf + mod = Model(mesh=RectilinearMesh1D(edges=e), values=par) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 68-69 + +Forward model the data + +.. GENERATED FROM PYTHON SOURCE LINES 69-108 + +.. code-block:: Python + + tdp.forward(mod) + + print('primary', tdp.primary_field) + print('sx', tdp.secondary_field[:15]) + print('sz', tdp.secondary_field[15:]) + + # #%% + # plt.figure() + # plt.subplot(121) + # _ = mod.pcolor(transpose=True) + # plt.subplot(122) + # _ = tdp.plot() + # _ = tdp.plot_predicted() + # plt.tight_layout() + # plt.suptitle('Model and response') + + # #%% + # # plt.figure() + # # tdp.plotDataResidual(xscale='log') + # # plt.title('data residual') + + # #%% + # # Compute the sensitivity matrix for a given model + J = tdp.sensitivity(mod) + # plt.figure() + # _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True) + + print('J', J) + # print('J shape', J.shape) + # print('sx 0', J[:16, 0]) + + tdp.fm_dlogc(mod) + + print('new primary', tdp.primary_field) + print('sx', tdp.secondary_field[:15]) + print('sz', tdp.secondary_field[15:]) + + print('new J', tdp.sensitivity_matrix) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + primary [34.27253219 17.55503397] + sx [4.50040745 2.57068627 2.01534336 ... 0.33251557 0.29674627 0.15444462] + sz [6.46667394 4.43233932 3.84850348 ... 1.04330666 0.76773288 0.54604945] + J [[ 1.13463137e-01 1.49920887e-01 1.76789170e-01 ... -1.01809840e-09 + 1.13341751e-11 7.27489718e-13] + [ 2.09383016e-02 3.20412212e-02 4.74815387e-02 ... -1.02489023e-09 + 1.15994185e-11 7.25910166e-13] + [ 1.04188675e-02 1.61552555e-02 2.45575508e-02 ... -1.03167228e-09 + 1.18645190e-11 7.24296662e-13] + ... + [ 7.20880061e-05 1.13758034e-04 1.79138645e-04 ... -6.62044639e-09 + 1.91310127e-10 4.83737910e-13] + [ 3.95655826e-05 6.25753935e-05 9.87713313e-05 ... -6.33418159e-09 + 2.26727066e-10 -1.05451995e-12] + [ 1.60007270e-05 3.08385747e-05 5.05626410e-05 ... -1.28316523e-09 + 1.11041966e-10 -2.41585978e-12]] + new primary [34.27253219 17.55503397] + sx [4.50040745 2.57068627 2.01534336 ... 0.33251557 0.29674627 0.15444462] + sz [6.46667394 4.43233932 3.84850348 ... 1.04330666 0.76773288 0.54604945] + new J [[ 1.13463137e-01 1.49920887e-01 1.76789170e-01 ... -1.01809840e-09 + 1.13341751e-11 7.27489718e-13] + [ 2.09383016e-02 3.20412212e-02 4.74815387e-02 ... -1.02489023e-09 + 1.15994185e-11 7.25910166e-13] + [ 1.04188675e-02 1.61552555e-02 2.45575508e-02 ... -1.03167228e-09 + 1.18645190e-11 7.24296662e-13] + ... + [ 7.20880061e-05 1.13758034e-04 1.79138645e-04 ... -6.62044639e-09 + 1.91310127e-10 4.83737910e-13] + [ 3.95655826e-05 6.25753935e-05 9.87713313e-05 ... -6.33418159e-09 + 2.26727066e-10 -1.05451995e-12] + [ 1.60007270e-05 3.08385747e-05 5.05626410e-05 ... -1.28316523e-09 + 1.11041966e-10 -2.41585978e-12]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 109-111 + +Attaching statistical descriptors to the tempest datapoint +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 111-125 + +.. code-block:: Python + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + # Set relative errors for the primary fields, and secondary fields. + tdp.relative_error = np.r_[0.001, 0.001] + + # Set the additive errors for + tdp.additive_error = np.hstack([[0.011474, 0.012810, 0.008507, 0.005154, 0.004742, 0.004477, 0.004168, 0.003539, 0.003352, 0.003213, 0.003161, 0.003122, 0.002587, 0.002038, 0.002201], + [0.007383, 0.005693, 0.005178, 0.003659, 0.003426, 0.003046, 0.003095, 0.003247, 0.002775, 0.002627, 0.002460, 0.002178, 0.001754, 0.001405, 0.001283]]) + # Define a multivariate log normal distribution as the prior on the predicted data. + tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 126-127 + +This allows us to evaluate the likelihood of the predicted data + +.. GENERATED FROM PYTHON SOURCE LINES 127-131 + +.. code-block:: Python + + print(tdp.likelihood(log=True)) + # Or the misfit + print(tdp.data_misfit()) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + -35698.4834358605 + 71558.40557872524 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 132-133 + +Plot the misfits for a range of half space conductivities + +.. GENERATED FROM PYTHON SOURCE LINES 133-138 + +.. code-block:: Python + + plt.figure() + plt.subplot(1, 2, 1) + _ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200) + plt.title("Halfspace responses") + + + + +.. image-sg:: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_002.png + :alt: Halfspace responses + :srcset: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + Text(0.5, 1.0, 'Halfspace responses') + + + +.. GENERATED FROM PYTHON SOURCE LINES 139-140 + +We can perform a quick search for the best fitting half space + +.. GENERATED FROM PYTHON SOURCE LINES 140-161 + +.. code-block:: Python + + halfspace = tdp.find_best_halfspace() + print('Best half space conductivity is {} $S/m$'.format(halfspace.values)) + plt.subplot(1, 2, 2) + _ = tdp.plot() + _ = tdp.plot_predicted() + + plt.figure() + tdp.plot_secondary_field() + tdp.plot_predicted_secondary_field() + + # #%% + # # We can attach priors to the height of the datapoint, + # # the relative error multiplier, and the additive error noise floor + + # Define the distributions used as priors. + relative_prior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng) + receiver_x_prior = Distribution('Uniform', min=np.float64(tdp.receiver.x) - 1.0, max=np.float64(tdp.receiver.x) + 1.0, prng=prng) + receiver_z_prior = Distribution('Uniform', min=np.float64(tdp.receiver.z) - 1.0, max=np.float64(tdp.receiver.z) + 1.0, prng=prng) + receiver_pitch_prior = Distribution('Uniform', min=tdp.receiver.pitch - 5.0, max=tdp.receiver.pitch + 5.0, prng=prng) + tdp.set_priors(relative_error_prior=relative_prior, receiver_x_prior=receiver_x_prior, receiver_z_prior=receiver_z_prior, receiver_pitch_prior=receiver_pitch_prior, prng=prng) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_003.png + :alt: Time Domain EM Data + :srcset: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_004.png + :alt: plot tempest datapoint + :srcset: /examples/Datapoints/images/sphx_glr_plot_tempest_datapoint_004.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Best half space conductivity is [0.01830738] $S/m$ + + + + +.. GENERATED FROM PYTHON SOURCE LINES 162-163 + +In order to perturb our solvable parameters, we need to attach proposal distributions + +.. GENERATED FROM PYTHON SOURCE LINES 163-173 + +.. code-block:: Python + + relative_proposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-4, prng=prng) + receiver_x_proposal = Distribution('Normal', mean=tdp.receiver.x, variance = 0.01, prng=prng) + receiver_z_proposal = Distribution('Normal', mean=tdp.receiver.z, variance = 0.01, prng=prng) + receiver_pitch_proposal = Distribution('Normal', mean=tdp.receiver.pitch, variance = 0.01, prng=prng) + tdp.set_proposals(relative_error_proposal=relative_proposal, + receiver_x_proposal=receiver_x_proposal, + receiver_z_proposal=receiver_z_proposal, + receiver_pitch_proposal=receiver_pitch_proposal, + solve_additive_error=True, additive_error_proposal_variance=1e-4, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 174-175 + +With priors set we can auto generate the posteriors + +.. GENERATED FROM PYTHON SOURCE LINES 175-177 + +.. code-block:: Python + + tdp.set_posteriors() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 178-180 + +Perturb the datapoint and record the perturbations +Note we are not using the priors to accept or reject perturbations. + +.. GENERATED FROM PYTHON SOURCE LINES 180-184 + +.. code-block:: Python + + for i in range(10): + tdp.perturb() + tdp.update_posteriors() + + plt.show() + + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 4.060 seconds) + + +.. _sphx_glr_download_examples_Datapoints_plot_tempest_datapoint.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_tempest_datapoint.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_tempest_datapoint.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Datapoints/sg_execution_times.rst.txt b/docs/_sources/examples/Datapoints/sg_execution_times.rst.txt new file mode 100644 index 00000000..5203b600 --- /dev/null +++ b/docs/_sources/examples/Datapoints/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_Datapoints_sg_execution_times: + + +Computation times +================= +**00:15.801** total execution time for 3 files **from examples/Datapoints**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Datapoints_plot_resolve_datapoint.py` (``plot_resolve_datapoint.py``) + - 00:08.395 + - 0.0 + * - :ref:`sphx_glr_examples_Datapoints_plot_tempest_datapoint.py` (``plot_tempest_datapoint.py``) + - 00:04.060 + - 0.0 + * - :ref:`sphx_glr_examples_Datapoints_plot_skytem_datapoint.py` (``plot_skytem_datapoint.py``) + - 00:03.346 + - 0.0 diff --git a/docs/_sources/examples/Distributions/README.rst.txt b/docs/_sources/examples/Distributions/README.rst.txt new file mode 100644 index 00000000..c9d04d99 --- /dev/null +++ b/docs/_sources/examples/Distributions/README.rst.txt @@ -0,0 +1,2 @@ +Distributions +============= \ No newline at end of file diff --git a/docs/_sources/examples/Distributions/index.rst.txt b/docs/_sources/examples/Distributions/index.rst.txt new file mode 100644 index 00000000..651ba5c8 --- /dev/null +++ b/docs/_sources/examples/Distributions/index.rst.txt @@ -0,0 +1,40 @@ + + +.. _sphx_glr_examples_Distributions: + +Distributions +============= + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Distributions/images/thumb/sphx_glr_plot_distributions_thumb.png + :alt: + + :ref:`sphx_glr_examples_Distributions_plot_distributions.py` + +.. raw:: html + +
Distribution Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Distributions/plot_distributions + diff --git a/docs/_sources/examples/Distributions/plot_distributions.rst.txt b/docs/_sources/examples/Distributions/plot_distributions.rst.txt new file mode 100644 index 00000000..23583d55 --- /dev/null +++ b/docs/_sources/examples/Distributions/plot_distributions.rst.txt @@ -0,0 +1,182 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Distributions/plot_distributions.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Distributions_plot_distributions.py: + + +Distribution Class +++++++++++++++++++ + +Handles the initialization of different statistical distribution + +.. GENERATED FROM PYTHON SOURCE LINES 9-19 + +.. code-block:: Python + + from geobipy import Distribution + from geobipy import plotting as cP + import matplotlib.pyplot as plt + import numpy as np + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 20-22 + +Univariate Normal Distribution +++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 22-37 + +.. code-block:: Python + + D = Distribution('Normal', 0.0, 1.0, prng=prng) + + # Get the bins of the Distribution from +- 4 standard deviations of the mean + bins = D.bins() + + # Grab random samples from the distribution + D.rng(10) + + # We can then get the Probability Density Function for those bins + pdf = D.probability(bins, log=False) + + # And we can plot that PDF + plt.figure() + plt.plot(bins, pdf) + + + + +.. image-sg:: /examples/Distributions/images/sphx_glr_plot_distributions_001.png + :alt: plot distributions + :srcset: /examples/Distributions/images/sphx_glr_plot_distributions_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + [] + + + +.. GENERATED FROM PYTHON SOURCE LINES 39-41 + +Multivariate Normal Distribution +++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 41-45 + +.. code-block:: Python + + D = Distribution('MvNormal',[0.0,1.0,2.0],[1.0,1.0,1.0], prng=prng) + D.rng() + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + array([ 0.64050649, 1.77177243, -0.34500474]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 46-47 + +Uniform Distribution + +.. GENERATED FROM PYTHON SOURCE LINES 47-49 + +.. code-block:: Python + + D = Distribution('Uniform', 0.0, 1.0, prng=prng) + D.bins() + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + StatArray([0. , 0.01010101, 0.02020202, 0.03030303, 0.04040404, + 0.05050505, 0.06060606, 0.07070707, 0.08080808, 0.09090909, + 0.1010101 , 0.11111111, 0.12121212, 0.13131313, 0.14141414, + 0.15151515, 0.16161616, 0.17171717, 0.18181818, 0.19191919, + 0.2020202 , 0.21212121, 0.22222222, 0.23232323, 0.24242424, + 0.25252525, 0.26262626, 0.27272727, 0.28282828, 0.29292929, + 0.3030303 , 0.31313131, 0.32323232, 0.33333333, 0.34343434, + 0.35353535, 0.36363636, 0.37373737, 0.38383838, 0.39393939, + 0.4040404 , 0.41414141, 0.42424242, 0.43434343, 0.44444444, + 0.45454545, 0.46464646, 0.47474747, 0.48484848, 0.49494949, + 0.50505051, 0.51515152, 0.52525253, 0.53535354, 0.54545455, + 0.55555556, 0.56565657, 0.57575758, 0.58585859, 0.5959596 , + 0.60606061, 0.61616162, 0.62626263, 0.63636364, 0.64646465, + 0.65656566, 0.66666667, 0.67676768, 0.68686869, 0.6969697 , + 0.70707071, 0.71717172, 0.72727273, 0.73737374, 0.74747475, + 0.75757576, 0.76767677, 0.77777778, 0.78787879, 0.7979798 , + 0.80808081, 0.81818182, 0.82828283, 0.83838384, 0.84848485, + 0.85858586, 0.86868687, 0.87878788, 0.88888889, 0.8989899 , + 0.90909091, 0.91919192, 0.92929293, 0.93939394, 0.94949495, + 0.95959596, 0.96969697, 0.97979798, 0.98989899, 1. ]) + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 4.664 seconds) + + +.. _sphx_glr_download_examples_Distributions_plot_distributions.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_distributions.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_distributions.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Distributions/sg_execution_times.rst.txt b/docs/_sources/examples/Distributions/sg_execution_times.rst.txt new file mode 100644 index 00000000..19dc8a27 --- /dev/null +++ b/docs/_sources/examples/Distributions/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_Distributions_sg_execution_times: + + +Computation times +================= +**00:04.664** total execution time for 1 file **from examples/Distributions**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Distributions_plot_distributions.py` (``plot_distributions.py``) + - 00:04.664 + - 0.0 diff --git a/docs/_sources/examples/HDF5/README.rst.txt b/docs/_sources/examples/HDF5/README.rst.txt new file mode 100644 index 00000000..7582962c --- /dev/null +++ b/docs/_sources/examples/HDF5/README.rst.txt @@ -0,0 +1,2 @@ +HDF 5 +===== \ No newline at end of file diff --git a/docs/_sources/examples/HDF5/hdf5.rst.txt b/docs/_sources/examples/HDF5/hdf5.rst.txt new file mode 100644 index 00000000..78c88d50 --- /dev/null +++ b/docs/_sources/examples/HDF5/hdf5.rst.txt @@ -0,0 +1,178 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/HDF5/hdf5.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_HDF5_hdf5.py: + + +Using HDF5 within GeoBIPy +------------------------- + +Inference for large scale datasets in GeoBIPy is handled using MPI and distributed memory systems. +A common bottleneck with large parallel algorithms is the input output of information to disk. +We use HDF5 to read and write data in order to leverage the parallel capabililties of the HDF5 API. + +Each object within GeoBIPy has a create_hdf, write_hdf, and read_hdf routine. + +.. GENERATED FROM PYTHON SOURCE LINES 12-16 + +.. code-block:: Python + + import numpy as np + import h5py + from geobipy import StatArray + + +.. GENERATED FROM PYTHON SOURCE LINES 17-18 + +StatArray + +.. GENERATED FROM PYTHON SOURCE LINES 18-33 + +.. code-block:: Python + + + # Instantiate a StatArray + x = StatArray(np.arange(10.0), name = 'an Array', units = 'some units') + + # Write the StatArray to a HDF file. + with h5py.File("x.h5", 'w') as f: + x.toHdf(f, "x") + + # Read the StatArray back in. + with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x') + + print('x', x) + print('y', y) + + +.. GENERATED FROM PYTHON SOURCE LINES 34-39 + +There are actually steps within the "toHdf" function. +First, space is created within the HDF file and second, the data is written to that space +These functions are split because during the execution of a parallel enabled program, +all the space within the HDF file needs to be allocated before we can write to the file +using multiple cores. + +.. GENERATED FROM PYTHON SOURCE LINES 39-52 + +.. code-block:: Python + + + # Write the StatArray to a HDF file. + with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x") + x.writeHdf(f, "x") + + # Read the StatArray back in. + with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x') + + print('x', x) + print('y', y) + + +.. GENERATED FROM PYTHON SOURCE LINES 53-57 + +The create and write HDF methods also allow extra space to be allocated so that +the extra memory can be written later, perhaps by multiple cores. +Here we specify space for 2 arrays, the memory is stored contiguously as a numpy array. +We then write to only the first index. + +.. GENERATED FROM PYTHON SOURCE LINES 57-71 + +.. code-block:: Python + + + # Write the StatArray to a HDF file. + with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=2) + x.writeHdf(f, "x", index=0) + + # Read the StatArray back in. + with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=0) + + print('x', x) + print('y', y) + + + +.. GENERATED FROM PYTHON SOURCE LINES 72-73 + +The duplication can also be a shape. + +.. GENERATED FROM PYTHON SOURCE LINES 73-86 + +.. code-block:: Python + + + # Write the StatArray to a HDF file. + with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=(2, 2)) + x.writeHdf(f, "x", index=(0, 0)) + + # Read the StatArray back in. + with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=(0, 0)) + + print('x', x) + print('y', y) + + +.. GENERATED FROM PYTHON SOURCE LINES 87-88 + +Similarly, we can duplicate a 2D array with an extra 2D duplication + +.. GENERATED FROM PYTHON SOURCE LINES 88-100 + +.. code-block:: Python + + + x = StatArray(np.random.randn(2, 2), name = 'an Array', units = 'some units') + # Write the StatArray to a HDF file. + with h5py.File("x.h5", 'w') as f: + x.createHdf(f, "x", nRepeats=(2, 2)) + x.writeHdf(f, "x", index=(0, 0)) + + # Read the StatArray back in. + with h5py.File("x.h5", 'r') as f: + y = StatArray.fromHdf(f, 'x', index=(0, 0)) + + print('x', x) + print('y', y) + +.. _sphx_glr_download_examples_HDF5_hdf5.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: hdf5.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: hdf5.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/HDF5/index.rst.txt b/docs/_sources/examples/HDF5/index.rst.txt new file mode 100644 index 00000000..1d7f26a2 --- /dev/null +++ b/docs/_sources/examples/HDF5/index.rst.txt @@ -0,0 +1,40 @@ + + +.. _sphx_glr_examples_HDF5: + +HDF 5 +===== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/HDF5/images/thumb/sphx_glr_hdf5_thumb.png + :alt: + + :ref:`sphx_glr_examples_HDF5_hdf5.py` + +.. raw:: html + +
Using HDF5 within GeoBIPy
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/HDF5/hdf5 + diff --git a/docs/_sources/examples/HDF5/sg_execution_times.rst.txt b/docs/_sources/examples/HDF5/sg_execution_times.rst.txt new file mode 100644 index 00000000..c7859313 --- /dev/null +++ b/docs/_sources/examples/HDF5/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_HDF5_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 1 file **from examples/HDF5**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_HDF5_hdf5.py` (``hdf5.py``) + - 00:00.000 + - 0.0 diff --git a/docs/_sources/examples/Inference/1D/readme.rst.txt b/docs/_sources/examples/Inference/1D/readme.rst.txt new file mode 100644 index 00000000..dbad9266 --- /dev/null +++ b/docs/_sources/examples/Inference/1D/readme.rst.txt @@ -0,0 +1,11 @@ +1D Inference +------------ + +There are a couple of ways to run an inference using geobipy, the first is via command line using + +.. code-block:: bash + + geobipy skytem_options.py + +The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples) diff --git a/docs/_sources/examples/Inference/README.rst.txt b/docs/_sources/examples/Inference/README.rst.txt new file mode 100644 index 00000000..3fe80034 --- /dev/null +++ b/docs/_sources/examples/Inference/README.rst.txt @@ -0,0 +1,2 @@ +Inference +========= \ No newline at end of file diff --git a/docs/_sources/examples/Inference/index.rst.txt b/docs/_sources/examples/Inference/index.rst.txt new file mode 100644 index 00000000..a1a2382b --- /dev/null +++ b/docs/_sources/examples/Inference/index.rst.txt @@ -0,0 +1,17 @@ + + +.. _sphx_glr_examples_Inference: + +Inference +========= + + +.. raw:: html + +
+ + +.. raw:: html + +
+ diff --git a/docs/_sources/examples/Inference/sg_execution_times.rst.txt b/docs/_sources/examples/Inference/sg_execution_times.rst.txt new file mode 100644 index 00000000..91768475 --- /dev/null +++ b/docs/_sources/examples/Inference/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_Inference_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from examples/Inference**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_sources/examples/Inference_1D/plot_inference_1d_resolve.rst.txt b/docs/_sources/examples/Inference_1D/plot_inference_1d_resolve.rst.txt new file mode 100644 index 00000000..f4fc1432 --- /dev/null +++ b/docs/_sources/examples/Inference_1D/plot_inference_1d_resolve.rst.txt @@ -0,0 +1,199 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_1D/plot_inference_1d_resolve.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_1D_plot_inference_1d_resolve.py: + + +Running GeoBIPy to invert Resolve data +++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-39 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + data_type = "Resolve" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 40-42 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 42-89 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + supplementary = "..//..//supplementary//" + + parameter_file = supplementary + "//options_files//{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' + kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename'] + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=30, **kwargs) + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_resolve_001.png + :alt: plot inference 1d resolve + :srcset: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_resolve_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_resolve_002.png + :alt: Fiducial [30], Frequency Domain EM Data + :srcset: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_resolve_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ..//..//supplementary////options_files//Resolve_options + Output files will be produced at Resolve/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary////data//Resolve_glacial.csv and system files ..//..//supplementary////data//..//data/FdemSystem2.stm + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:06.650509 h:m:s + i=5000, k=2, acc=*42.520, 0.007 s/Model, 37.213 s Elapsed, eta=--:--:-- h:m:s + + Remaining Points -30/1 || Elapsed Time: 0:00:39.027413 h:m:s || ETA 0:00:01.258949 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 50.537 seconds) + + +.. _sphx_glr_download_examples_Inference_1D_plot_inference_1d_resolve.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_resolve.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_resolve.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_1D/plot_inference_1d_skytem.rst.txt b/docs/_sources/examples/Inference_1D/plot_inference_1d_skytem.rst.txt new file mode 100644 index 00000000..2db7e55c --- /dev/null +++ b/docs/_sources/examples/Inference_1D/plot_inference_1d_skytem.rst.txt @@ -0,0 +1,182 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_1D/plot_inference_1d_skytem.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_1D_plot_inference_1d_skytem.py: + + +Running GeoBIPy to invert Skytem data +++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-40 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + data_type = "Skytem_512" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 43-89 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + supplementary = "..//..//supplementary//" + parameter_file = supplementary + "//options_files//{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' + kwargs['system_filename'] = [supplementary + "//data//" + x for x in kwargs['system_filename']] + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=2, **kwargs) + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ..//..//supplementary////options_files//Skytem_512_options + Output files will be produced at Skytem_512/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary////data//Skytem_512_glacial.csv and system files ['..//..//supplementary////data//..//data//SkytemHM_512.stm', '..//..//supplementary////data//..//data//SkytemLM_512.stm'] + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:00.171754 h:m:s + i=5000, k=6, acc=*17.440, 0.012 s/Model, 60.254 s Elapsed, eta=--:--:-- h:m:s + + Remaining Points -2/1 || Elapsed Time: 0:01:00.423246 h:m:s || ETA 0:00:20.141082 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 6.343 seconds) + + +.. _sphx_glr_download_examples_Inference_1D_plot_inference_1d_skytem.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_skytem.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_skytem.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_1D/plot_inference_1d_tempest.rst.txt b/docs/_sources/examples/Inference_1D/plot_inference_1d_tempest.rst.txt new file mode 100644 index 00000000..11ea6c50 --- /dev/null +++ b/docs/_sources/examples/Inference_1D/plot_inference_1d_tempest.rst.txt @@ -0,0 +1,201 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_1D/plot_inference_1d_tempest.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_1D_plot_inference_1d_tempest.py: + + +Running GeoBIPy to invert Tempest data +++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 5-29 + +.. code-block:: Python + + + import os + import sys + import pathlib + from datetime import timedelta + import time + import numpy as np + from geobipy import Inference3D + from geobipy import user_parameters + from geobipy import get_prng + + def checkCommandArguments(): + """Check the users command line arguments. """ + import argparse + # warnings.filterwarnings('error') + + Parser = argparse.ArgumentParser(description="GeoBIPy", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + Parser.add_argument('--index', default=0, type=int, help='job array index 0-18') + Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']") + Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']") + + return Parser.parse_args() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 30-40 + +.. code-block:: Python + + np.random.seed(0) + + args = checkCommandArguments() + sys.path.append(os.getcwd()) + + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + data_type = "Tempest" + model_type = models[args.index] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +The directory where HDF files will be stored +%% + +.. GENERATED FROM PYTHON SOURCE LINES 43-91 + +.. code-block:: Python + + file_path = os.path.join(data_type, model_type) + pathlib.Path(file_path).mkdir(parents=True, exist_ok=True) + + for filename in os.listdir(file_path): + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (file_path, e)) + + output_directory = file_path + + data_filename = data_type + '_' + model_type + + supplementary = "..//..//supplementary//" + + parameter_file = supplementary + "//options_files//{}_options".format(data_type) + inputFile = pathlib.Path(parameter_file) + assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile)) + + output_directory = pathlib.Path(output_directory) + assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory)) + + print('Using user input file {}'.format(parameter_file)) + print('Output files will be produced at {}'.format(output_directory)) + + kwargs = user_parameters.read(inputFile) + + kwargs['n_markov_chains'] = 5000 + + kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv' + kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename'] + + # Everyone needs the system classes read in early. + data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename']) + + # Start keeping track of time. + t0 = time.time() + + seed = 146100583096709124601953385843316024947 + prng = get_prng(seed=seed) + + inference3d = Inference3D(data, prng=prng) + inference3d.create_hdf5(directory=output_directory, **kwargs) + + print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0)))) + + inference3d.infer(index=2, **kwargs) + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_tempest_001.png + :alt: plot inference 1d tempest + :srcset: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_tempest_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_tempest_002.png + :alt: Fiducial [2.], Time Domain EM Data + :srcset: /examples/Inference_1D/images/sphx_glr_plot_inference_1d_tempest_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Using user input file ..//..//supplementary////options_files//Tempest_options + Output files will be produced at Tempest/glacial + Creating HDF5 files, this may take a few minutes... + Files are being created for data files ..//..//supplementary////data//Tempest_glacial.csv and system files ..//..//supplementary////data//..//data/Tempest.stm + Created hdf5 file for line 0.0 with 79 data points + Created hdf5 files 79 total data points + Created hdf5 files in 0:00:00.360661 h:m:s + i=5000, k=7, acc=*27.680, 0.015 s/Model, 76.969 s Elapsed, eta=--:--:-- h:m:s + + Remaining Points -2/1 || Elapsed Time: 0:01:18.267442 h:m:s || ETA 0:00:26.089147 h:m:s + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 22.225 seconds) + + +.. _sphx_glr_download_examples_Inference_1D_plot_inference_1d_tempest.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_1d_tempest.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_1d_tempest.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_1D/readme.rst.txt b/docs/_sources/examples/Inference_1D/readme.rst.txt new file mode 100644 index 00000000..9c93f798 --- /dev/null +++ b/docs/_sources/examples/Inference_1D/readme.rst.txt @@ -0,0 +1,11 @@ +1D Inference +============ + +There are a couple of ways to run an inference using geobipy, the first is via command line using + +.. code-block:: bash + + geobipy skytem_options.py + +The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples) diff --git a/docs/_sources/examples/Inference_1D/sg_execution_times.rst.txt b/docs/_sources/examples/Inference_1D/sg_execution_times.rst.txt new file mode 100644 index 00000000..7819fda9 --- /dev/null +++ b/docs/_sources/examples/Inference_1D/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_Inference_1D_sg_execution_times: + + +Computation times +================= +**02:28.568** total execution time for 3 files **from examples/Inference_1D**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_tempest.py` (``plot_inference_1d_tempest.py``) + - 01:22.225 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_skytem.py` (``plot_inference_1d_skytem.py``) + - 01:06.343 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_resolve.py` (``plot_inference_1d_resolve.py``) + - 00:00.000 + - 0.0 diff --git a/docs/_sources/examples/Inference_2D/index.rst.txt b/docs/_sources/examples/Inference_2D/index.rst.txt new file mode 100644 index 00000000..5087790b --- /dev/null +++ b/docs/_sources/examples/Inference_2D/index.rst.txt @@ -0,0 +1,40 @@ + + +.. _sphx_glr_examples_2D_Inference: + +Inference 2D +============ + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/2D_Inference/images/thumb/sphx_glr_inference_2d_plotting_thumb.png + :alt: + + :ref:`sphx_glr_examples_2D_Inference_inference_2d_plotting.py` + +.. raw:: html + +
2D Posterior analysis of the Bayesian inference
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/2D_Inference/inference_2d_plotting + diff --git a/docs/_sources/examples/Inference_2D/plot_inference_2d_resolve.rst.txt b/docs/_sources/examples/Inference_2D/plot_inference_2d_resolve.rst.txt new file mode 100644 index 00000000..52eca4ac --- /dev/null +++ b/docs/_sources/examples/Inference_2D/plot_inference_2d_resolve.rst.txt @@ -0,0 +1,283 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_2D/plot_inference_2d_resolve.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_2D_plot_inference_2d_resolve.py: + + +2D Posterior analysis of Resolve inference +------------------------------------------ + +All plotting in GeoBIPy can be carried out using the 3D inference class + +.. GENERATED FROM PYTHON SOURCE LINES 8-151 + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_001.png + :alt: resolve glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_002.png + :alt: resolve saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_003.png + :alt: resolve resistive_dolomites, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_004.png + :alt: resolve resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_004.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_005.png + :alt: resolve coastal_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_005.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_006.png + :alt: resolve ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_resolve_006.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + + + + + + +| + +.. code-block:: Python + + + import matplotlib.pyplot as plt + import numpy as np + from geobipy import Model + from geobipy import Inference2D + + def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1 + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-160, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + + if __name__ == '__main__': + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + for model in models: + try: + plot_2d_summary("../../../Parallel_Inference/", "resolve", model) + except Exception as e: + print(model) + print(e) + pass + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 24.877 seconds) + + +.. _sphx_glr_download_examples_Inference_2D_plot_inference_2d_resolve.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_2d_resolve.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_2d_resolve.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_2D/plot_inference_2d_skytem.rst.txt b/docs/_sources/examples/Inference_2D/plot_inference_2d_skytem.rst.txt new file mode 100644 index 00000000..156ea327 --- /dev/null +++ b/docs/_sources/examples/Inference_2D/plot_inference_2d_skytem.rst.txt @@ -0,0 +1,278 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_2D/plot_inference_2d_skytem.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_2D_plot_inference_2d_skytem.py: + + +2D Posterior analysis of Skytem inference +----------------------------------------- + +All plotting in GeoBIPy can be carried out using the 3D inference class + +.. GENERATED FROM PYTHON SOURCE LINES 8-150 + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_001.png + :alt: skytem_512 glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_002.png + :alt: skytem_512 saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_003.png + :alt: skytem_512 resistive_dolomites + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_004.png + :alt: skytem_512 resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_004.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_005.png + :alt: skytem_512 coastal_salt_water + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_005.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_006.png + :alt: skytem_512 ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_skytem_006.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + resistive_dolomites + x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + coastal_salt_water + x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + + + + + + +| + +.. code-block:: Python + + + import argparse + import matplotlib.pyplot as plt + import numpy as np + from geobipy import Model + from geobipy import Inference2D + + def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + + + if __name__ == '__main__': + types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + for model in types: + try: + plot_2d_summary('../../../Parallel_Inference/', "skytem_512", model) + except Exception as e: + print(model) + print(e) + pass + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 10.130 seconds) + + +.. _sphx_glr_download_examples_Inference_2D_plot_inference_2d_skytem.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_2d_skytem.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_2d_skytem.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_2D/plot_inference_2d_tempest.rst.txt b/docs/_sources/examples/Inference_2D/plot_inference_2d_tempest.rst.txt new file mode 100644 index 00000000..a7d03a0a --- /dev/null +++ b/docs/_sources/examples/Inference_2D/plot_inference_2d_tempest.rst.txt @@ -0,0 +1,283 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Inference_2D/plot_inference_2d_tempest.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Inference_2D_plot_inference_2d_tempest.py: + + +2D Posterior analysis of Tempest inference +------------------------------------------ + +All plotting in GeoBIPy can be carried out using the 3D inference class + +.. GENERATED FROM PYTHON SOURCE LINES 8-153 + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_001.png + :alt: tempest glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_002.png + :alt: tempest saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_003.png + :alt: tempest resistive_dolomites, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_004.png + :alt: tempest resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_004.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_005.png + :alt: tempest coastal_salt_water + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_005.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_006.png + :alt: tempest ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface) + :srcset: /examples/Inference_2D/images/sphx_glr_plot_inference_2d_tempest_006.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + coastal_salt_water + x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars + self._mtx[1, 2] += ty + /Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars + return (x0, y0, x1 - x0, y1 - y0) + + + + + + +| + +.. code-block:: Python + + + import argparse + import matplotlib.pyplot as plt + import numpy as np + from geobipy import Model + from geobipy import Inference2D + + def plot_2d_summary(folder, data_type, model_type): + #%% + # Inference for a line of inferences + # ++++++++++++++++++++++++++++++++++ + # + # We can instantiate the inference handler by providing a path to the directory containing + # HDF5 files generated by GeoBIPy. + # + # The InfereceXD classes are low memory. They only read information from the HDF5 files + # as and when it is needed. + # + # The first time you use these classes to create plots, expect longer initial processing times. + # I precompute expensive properties and store them in the HDF5 files for later use. + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + #%% + results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng) + + kwargs = { + "log" : 10, + "cmap" : 'jet' + } + + fig = plt.figure(figsize=(16, 8)) + plt.suptitle("{} {}".format(data_type, model_type)) + gs0 = fig.add_gridspec(6, 2, hspace=1.0) + + true_model = Model.create_synthetic_model(model_type) + + kwargs['vmin'] = np.log10(np.min(true_model.values)) + kwargs['vmax'] = np.log10(np.max(true_model.values)) + + ax = fig.add_subplot(gs0[0, 0]) + true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False); + + plt.ylim([-550, 60]) + + ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax) + results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # By adding the useVariance keyword, we can make regions of lower confidence more transparent + ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax) + results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + # # # # # We can also choose to keep parameters above the DOI opaque. + # # # # results_2d.compute_doi() + # # # # plt.subplot(313) + # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs); + # # # # results_2d.plot_data_elevation(linewidth=0.3); + # # # # results_2d.plot_elevation(linewidth=0.3); + + ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax) + results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + ax1.set_title('Best model') + + del kwargs['vmin'] + del kwargs['vmax'] + + ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%') + results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%') + results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%') + results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs) + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + #%% + # We can plot the parameter values that produced the highest posterior + ax1 = fig.add_subplot(gs0[2, 0], sharex=ax) + results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True) + + ax1 = fig.add_subplot(gs0[1, 0], sharex=ax) + + ll, bb, ww, hh = ax1.get_position().bounds + ax1.set_position([ll, bb, ww*0.8, hh]) + + results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True) + results_2d.plot_burned_in(ax=ax1, underlay=True) + + #%% + # Now we can start plotting some more interesting posterior properties. + # How about the confidence? + ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax) + results_2d.plot_confidence(ax=ax1); + results_2d.plot_data_elevation(ax=ax1, linewidth=0.3); + results_2d.plot_elevation(ax=ax1, linewidth=0.3); + + #%% + # We can take the interface depth posterior for each data point, + # and display an interface probability cross section + # This posterior can be washed out, so the clim_scaling keyword lets me saturate + # the top and bottom 0.5% of the colour range + ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax) + ax1.set_title('P(Interface)') + results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax) + results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1); + results_2d.plot_data_elevation(linewidth=0.3, ax=ax1); + results_2d.plot_elevation(linewidth=0.3, ax=ax1); + + plt.show() + # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300) + + + if __name__ == '__main__': + models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water'] + + # import warnings + # warnings.filterwarnings('error') + for model in models: + try: + plot_2d_summary('../../../Parallel_Inference/', "tempest", model) + except Exception as e: + print(model) + print(e) + pass + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 12.999 seconds) + + +.. _sphx_glr_download_examples_Inference_2D_plot_inference_2d_tempest.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_inference_2d_tempest.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_inference_2d_tempest.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Inference_2D/readme.rst.txt b/docs/_sources/examples/Inference_2D/readme.rst.txt new file mode 100644 index 00000000..088c5bab --- /dev/null +++ b/docs/_sources/examples/Inference_2D/readme.rst.txt @@ -0,0 +1,2 @@ +Inference 2D +============ \ No newline at end of file diff --git a/docs/_sources/examples/Inference_2D/sg_execution_times.rst.txt b/docs/_sources/examples/Inference_2D/sg_execution_times.rst.txt new file mode 100644 index 00000000..b4fc1cd1 --- /dev/null +++ b/docs/_sources/examples/Inference_2D/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_Inference_2D_sg_execution_times: + + +Computation times +================= +**00:48.006** total execution time for 3 files **from examples/Inference_2D**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_resolve.py` (``plot_inference_2d_resolve.py``) + - 00:24.877 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_tempest.py` (``plot_inference_2d_tempest.py``) + - 00:12.999 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_skytem.py` (``plot_inference_2d_skytem.py``) + - 00:10.130 + - 0.0 diff --git a/docs/_sources/examples/Meshes/README.rst.txt b/docs/_sources/examples/Meshes/README.rst.txt new file mode 100644 index 00000000..781066d7 --- /dev/null +++ b/docs/_sources/examples/Meshes/README.rst.txt @@ -0,0 +1,2 @@ +Meshes +====== \ No newline at end of file diff --git a/docs/_sources/examples/Meshes/index.rst.txt b/docs/_sources/examples/Meshes/index.rst.txt new file mode 100644 index 00000000..822eebee --- /dev/null +++ b/docs/_sources/examples/Meshes/index.rst.txt @@ -0,0 +1,77 @@ + + +.. _sphx_glr_examples_Meshes: + +====== +Meshes +====== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_1d.py` + +.. raw:: html + +
1D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_2d.py` + +.. raw:: html + +
2D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_3d.py` + +.. raw:: html + +
3D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Meshes/plot_rectilinear_mesh_1d + /examples/Meshes/plot_rectilinear_mesh_2d + /examples/Meshes/plot_rectilinear_mesh_3d + diff --git a/docs/_sources/examples/Meshes/plot_rectilinear_mesh_1d.rst.txt b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_1d.rst.txt new file mode 100644 index 00000000..38c9f9ef --- /dev/null +++ b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_1d.rst.txt @@ -0,0 +1,645 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Meshes/plot_rectilinear_mesh_1d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Meshes_plot_rectilinear_mesh_1d.py: + + +1D Rectilinear Mesh +------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 6-14 + +.. code-block:: Python + + from copy import deepcopy + from geobipy import StatArray + from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh2D_stitched + import matplotlib.gridspec as gridspec + import matplotlib.pyplot as plt + import numpy as np + import h5py + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 15-18 + +The basics +++++++++++ +Instantiate a new 1D rectilinear mesh by specifying cell centres, edges, or widths. + +.. GENERATED FROM PYTHON SOURCE LINES 18-20 + +.. code-block:: Python + + x = StatArray(np.cumsum(np.arange(0.0, 10.0)), 'Depth', 'm') + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 21-22 + +Cell edges + +.. GENERATED FROM PYTHON SOURCE LINES 22-24 + +.. code-block:: Python + + rm = RectilinearMesh1D(edges=x, centres=None, widths=None) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 25-27 + +We can plot the grid of the mesh +Or Pcolor the mesh showing. An array of cell values is used as the colour. + +.. GENERATED FROM PYTHON SOURCE LINES 27-72 + +.. code-block:: Python + + arr = StatArray(np.random.randn(*rm.shape), "Name", "Units") + p=0; plt.figure(p) + plt.subplot(121) + _ = rm.plotGrid(transpose=True, flip=True) + plt.subplot(122) + _ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + + # Mask the mesh cells by a distance + rm_masked, indices, arr2 = rm.mask_cells(2.0, values=arr) + p+=1; plt.figure(p) + _ = rm_masked.pcolor(StatArray(arr2), grid=True, transpose=True, flip=True) + + # Writing and reading to/from HDF5 + # ++++++++++++++++++++++++++++++++ + with h5py.File('rm1d.h5', 'w') as f: + rm.toHdf(f, 'rm1d') + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(122) + _ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + + with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=10) + for i in range(10): + rm.writeHdf(f, 'rm1d', index=i) + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) + with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(131) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(132) + _ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) + plt.subplot(133) + _ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True) + + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_001.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_002.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_003.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_004.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_004.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 73-77 + +Log-space rectilinear mesh +++++++++++++++++++++++++++ +Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +Here we use edges + +.. GENERATED FROM PYTHON SOURCE LINES 77-79 + +.. code-block:: Python + + x = StatArray(np.logspace(-3, 3, 10), 'Depth', 'm') + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 80-123 + +.. code-block:: Python + + rm = RectilinearMesh1D(edges=x, log=10) + + # We can plot the grid of the mesh + # Or Pcolor the mesh showing. An array of cell values is used as the colour. + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.plotGrid(transpose=True, flip=True) + plt.subplot(122) + arr = StatArray(np.random.randn(rm.nCells), "Name", "Units") + _ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + + # Writing and reading to/from HDF5 + # ++++++++++++++++++++++++++++++++ + with h5py.File('rm1d.h5', 'w') as f: + rm.toHdf(f, 'rm1d') + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(122) + _ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + + with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=10) + for i in range(10): + rm.writeHdf(f, 'rm1d', index=i) + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) + with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(131) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(132) + _ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) + plt.subplot(133) + _ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_005.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_005.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_006.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_006.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_007.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_007.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 124-128 + +RelativeTo +++++++++++ +Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +Here we use edges + +.. GENERATED FROM PYTHON SOURCE LINES 128-130 + +.. code-block:: Python + + x = StatArray(np.arange(11.0), 'Deviation', 'm') + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 131-133 + +.. code-block:: Python + + rm = RectilinearMesh1D(edges=x, relativeTo=5.0) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 134-136 + +We can plot the grid of the mesh +Or Pcolor the mesh showing. An array of cell values is used as the colour. + +.. GENERATED FROM PYTHON SOURCE LINES 136-184 + +.. code-block:: Python + + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.plotGrid(transpose=True, flip=True) + plt.subplot(122) + arr = StatArray(np.random.randn(rm.nCells), "Name", "Units") + _ = rm.pcolor(arr, grid=True, transpose=True, flip=True) + + # Writing and reading to/from HDF5 + # ++++++++++++++++++++++++++++++++ + with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d') + rm.writeHdf(f, 'rm1d') + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(122) + _ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + + with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', add_axis=3) + for i in range(3): + rm.relativeTo += 0.5 + rm.writeHdf(f, 'rm1d', index=i) + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0) + with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(131) + _ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True) + plt.subplot(132) + _ = rm1.pcolor(arr, grid=True, transpose=True, flip=True) + plt.subplot(133) + _ = rm2.pcolor(np.repeat(arr[None, :], 3, 0), grid=True, flipY=True) + + + # Making a mesh perturbable + # +++++++++++++++++++++++++ + n_cells = 2 + widths = StatArray(np.full(n_cells, fill_value=10.0), 'test') + rm = RectilinearMesh1D(widths=widths, relativeTo=0.0) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_008.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_008.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_009.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_009.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_010.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_010.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 185-192 + +Randomness and Model Perturbations +++++++++++++++++++++++++++++++++++ +We can set the priors on the 1D model by assigning minimum and maximum layer +depths and a maximum number of layers. These are used to create priors on +the number of cells in the model, a new depth interface, new parameter values +and the vertical gradient of those parameters. +The halfSpaceValue is used as a reference value for the parameter prior. + +.. GENERATED FROM PYTHON SOURCE LINES 192-203 + +.. code-block:: Python + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + # Set the priors + rm.set_priors(min_edge = 1.0, + max_edge = 150.0, + max_cells = 30, + prng = prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 204-205 + +We can evaluate the prior of the model using depths only + +.. GENERATED FROM PYTHON SOURCE LINES 205-207 + +.. code-block:: Python + + print('Log probability of the Mesh given its priors: ', rm.probability) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Log probability of the Mesh given its priors: -13.338200594791775 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 208-211 + +To propose new meshes, we specify the probabilities of creating, removing, perturbing, and not changing +an edge interface +Here we force the creation of a layer. + +.. GENERATED FROM PYTHON SOURCE LINES 211-216 + +.. code-block:: Python + + rm.set_proposals(probabilities = [0.25, 0.25, 0.25, 0.25], prng=prng) + rm.set_posteriors() + + rm0 = deepcopy(rm) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 217-218 + +We can then perturb the layers of the model + +.. GENERATED FROM PYTHON SOURCE LINES 218-222 + +.. code-block:: Python + + for i in range(1000): + rm = rm.perturb() + rm.update_posteriors() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 223-245 + +.. code-block:: Python + + p+=1; fig = plt.figure(p) + ax = rm._init_posterior_plots(fig) + + rm.plot_posteriors(axes=ax) + + with h5py.File('rm1d.h5', 'w') as f: + rm.createHdf(f, 'rm1d', withPosterior = True) + rm.writeHdf(f, 'rm1d', withPosterior = True) + + with h5py.File('rm1d.h5', 'r') as f: + rm1 = RectilinearMesh1D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(121) + _ = rm.pcolor(StatArray(rm.shape), grid=True, transpose=True, flip=True) + plt.subplot(122) + _ = rm1.pcolor(StatArray(rm1.shape), grid=True, transpose=True, flip=True) + + p+=1; fig = plt.figure(p) + ax = rm1._init_posterior_plots(fig) + rm1.plot_posteriors(axes=ax) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_011.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_011.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_012.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_012.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_013.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_013.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + [, ] + + + +.. GENERATED FROM PYTHON SOURCE LINES 246-247 + +Expanded + +.. GENERATED FROM PYTHON SOURCE LINES 247-286 + +.. code-block:: Python + + with h5py.File('rm1d.h5', 'w') as f: + tmp = rm.pad(rm.max_cells) + tmp.createHdf(f, 'rm1d', withPosterior=True, add_axis=StatArray(np.arange(3.0), name='Easting', units="m")) + + rm.relativeTo = 5.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=0) + + rm = deepcopy(rm0) + for i in range(1000): + rm = rm.perturb(); rm.update_posteriors() + rm.relativeTo = 10.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=1) + + rm = deepcopy(rm0) + for i in range(1000): + rm = rm.perturb(); rm.update_posteriors() + rm.relativeTo = 25.0 + rm.writeHdf(f, 'rm1d', withPosterior = True, index=2) + + with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d']) + + p+=1; plt.figure(p) + plt.subplot(121) + arr = np.random.randn(3, rm.max_cells) * 10 + _ = rm0.pcolor(arr[0, :rm0.nCells.item()], grid=True, transpose=True, flip=True) + plt.subplot(122) + _ = rm2.pcolor(arr, grid=True, flipY=True, equalize=True) + + from geobipy import RectilinearMesh2D + with h5py.File('rm1d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['rm1d'], index=0) + + plt.figure() + plt.subplot(121) + rm2.plotGrid(transpose=True, flip=True) + plt.subplot(122) + rm2.edges.posterior.pcolor(transpose=True, flip=True) + + plt.show() + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_014.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_014.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_015.png + :alt: plot rectilinear mesh 1d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_1d_015.png + :class: sphx-glr-multi-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 4.711 seconds) + + +.. _sphx_glr_download_examples_Meshes_plot_rectilinear_mesh_1d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_rectilinear_mesh_1d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_rectilinear_mesh_1d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Meshes/plot_rectilinear_mesh_2d.rst.txt b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_2d.rst.txt new file mode 100644 index 00000000..9f97c29a --- /dev/null +++ b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_2d.rst.txt @@ -0,0 +1,618 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Meshes/plot_rectilinear_mesh_2d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Meshes_plot_rectilinear_mesh_2d.py: + + +2D Rectilinear Mesh +------------------- +This 2D rectilinear mesh defines a grid with straight cell boundaries. + +It can be instantiated in two ways. + +The first is by providing the cell centres or +cell edges in two dimensions. + +The second embeds the 2D mesh in 3D by providing the cell centres or edges in three dimensions. +The first two dimensions specify the mesh coordinates in the horiztontal cartesian plane +while the third discretizes in depth. This allows us to characterize a mesh whose horizontal coordinates +do not follow a line that is parallel to either the "x" or "y" axis. + +.. GENERATED FROM PYTHON SOURCE LINES 19-26 + +.. code-block:: Python + + import h5py + from geobipy import StatArray + from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh3D + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 27-28 + +Specify some cell centres in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 28-32 + +.. code-block:: Python + + x = StatArray(np.arange(10.0), 'Easting', 'm') + y = StatArray(np.arange(20.0), 'Depth', 'm') + rm = RectilinearMesh2D(x_centres=x, y_centres=y) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 33-34 + +We can plot the grid lines of the mesh. + +.. GENERATED FROM PYTHON SOURCE LINES 34-45 + +.. code-block:: Python + + p=0; + plt.figure(p) + _ = rm.plotGrid(flipY=True, linewidth=0.5) + + # Intersecting multisegment lines with a mesh + arr = np.zeros(rm.shape) + i = rm.line_indices([0.0, 3.0, 6.0, 9], [2.0, 6.0, 0.0, 10]) + arr[i[:, 0], i[:, 1]] = 1 + p += 1; plt.figure(p) + rm.pcolor(values = arr) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_001.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_002.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 46-47 + +We can pcolor the mesh by providing cell values. + +.. GENERATED FROM PYTHON SOURCE LINES 47-67 + +.. code-block:: Python + + xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) + arr = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values") + + p += 1; plt.figure(p) + _ = rm.pcolor(arr, grid=True, flipY=True, linewidth=0.5) + + # xG = rm.xGradientMatrix() + # zG = rm.yGradientMatrix() + + # dax = StatArray((xG * arr.flatten()).reshape((arr.shape[0], arr.shape[1]-1))) + # rm2 = rm[:, :9] + + # plt.figure() + # rm2.pcolor(dax, xAxis='r', grid=True, flipY=True, linewidth=0.5) + + # dax = StatArray((zG * arr.flatten()).reshape((arr.shape[0]-1, arr.shape[1]))) + + # plt.figure() + # dax.pcolor(grid=True, flipY=True, linewidth=0.5) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_003.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 68-69 + +Mask the x axis cells by a distance + +.. GENERATED FROM PYTHON SOURCE LINES 69-73 + +.. code-block:: Python + + rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, values=arr) + p += 1; plt.figure(p) + _ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_004.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 74-75 + +Mask the z axis cells by a distance + +.. GENERATED FROM PYTHON SOURCE LINES 75-79 + +.. code-block:: Python + + rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(y_distance=0.2, values=arr) + p += 1; plt.figure(p) + _ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_005.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 80-81 + +Mask axes by a distance + +.. GENERATED FROM PYTHON SOURCE LINES 81-89 + +.. code-block:: Python + + rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, y_distance=0.2, values=arr) + p += 1; plt.figure(p) + _ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True) + + x = StatArray(np.arange(10.0), 'Easting', 'm') + y = StatArray(np.cumsum(np.arange(15.0)), 'Depth', 'm') + rm = RectilinearMesh2D(x_centres=x, y_centres=y) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_006.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 90-92 + +We can perform some interval statistics on the cell values of the mesh +Generate some values + +.. GENERATED FROM PYTHON SOURCE LINES 92-94 + +.. code-block:: Python + + a = np.repeat(np.arange(1.0, np.float64(rm.x.nCells+1))[:, np.newaxis], rm.y.nCells, 1) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 95-96 + +Compute the mean over an interval for the mesh. + +.. GENERATED FROM PYTHON SOURCE LINES 96-98 + +.. code-block:: Python + + rm.intervalStatistic(a, intervals=[6.8, 12.4], axis=0, statistic='mean') + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (array([[9., 9., 9., ..., 9., 9., 9.]]), [6.8, 12.4]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 99-100 + +Compute the mean over multiple intervals for the mesh. + +.. GENERATED FROM PYTHON SOURCE LINES 100-102 + +.. code-block:: Python + + rm.intervalStatistic(a, intervals=[6.8, 12.4, 20.0, 40.0], axis=0, statistic='mean') + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (array([[ 9., 9., 9., ..., 9., 9., 9.], + [nan, nan, nan, ..., nan, nan, nan], + [nan, nan, nan, ..., nan, nan, nan]]), [6.8, 12.4, 20.0, 40.0]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 103-104 + +We can specify either axis + +.. GENERATED FROM PYTHON SOURCE LINES 104-106 + +.. code-block:: Python + + rm.intervalStatistic(a, intervals=[2.8, 4.2], axis=1, statistic='mean') + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (array([[ 1.], + [ 2.], + [ 3.], + ..., + [ 8.], + [ 9.], + [10.]]), [2.8, 4.2]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 107-109 + +.. code-block:: Python + + rm.intervalStatistic(a, intervals=[2.8, 4.2, 5.1, 8.4], axis=1, statistic='mean') + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (array([[ 1., nan, 1.], + [ 2., nan, 2.], + [ 3., nan, 3.], + ..., + [ 8., nan, 8.], + [ 9., nan, 9.], + [10., nan, 10.]]), [2.8, 4.2, 5.1, 8.4]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 110-111 + +Slice the 2D mesh to retrieve either a 2D mesh or 1D mesh + +.. GENERATED FROM PYTHON SOURCE LINES 111-123 + +.. code-block:: Python + + rm2 = rm[:5, :5] + rm3 = rm[:5, 5] + rm4 = rm[5, :5] + + p += 1; plt.figure(p) + plt.subplot(131) + rm2.plotGrid() + plt.subplot(132) + rm3.plotGrid() + plt.subplot(133) + rm4.plotGrid(transpose=True) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_007.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_007.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 124-125 + +Resample a grid + +.. GENERATED FROM PYTHON SOURCE LINES 125-134 + +.. code-block:: Python + + values = StatArray(np.random.randn(*rm.shape)) + rm2, values2 = rm.resample(0.5, 0.5, values) + + p += 1; plt.figure(p) + plt.subplot(121) + rm.pcolor(values) + plt.subplot(122) + rm2.pcolor(values2) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_008.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_008.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 135-137 + +Axes in log space ++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 137-145 + +.. code-block:: Python + + x = StatArray(np.logspace(-1, 4, 10), 'x') + y = StatArray(np.logspace(0, 3, 10), 'y') + rm = RectilinearMesh2D(x_edges=x, x_log=10, y_edges=y, y_log=10) + + # We can plot the grid lines of the mesh. + p += 1; plt.figure(p) + _ = rm.plotGrid(linewidth=0.5) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_009.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_009.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 146-159 + +.. code-block:: Python + + with h5py.File('rm2d.h5', 'w') as f: + rm.toHdf(f, 'test') + + with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test']) + + arr = np.random.randn(*rm.shape) + p += 1; plt.figure(p) + plt.subplot(211) + rm.pcolor(arr) + plt.subplot(212) + rm2.pcolor(arr) + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_010.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_010.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 160-162 + +RelativeTo +++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 162-220 + +.. code-block:: Python + + x = StatArray(np.arange(10.0), 'Northing', 'm') + y = StatArray(np.arange(20.0), 'Depth', 'm') + + rm = RectilinearMesh2D(x_centres=x, y_centres=y) + + p += 1; plt.figure(p) + plt.subplot(121) + _ = rm.plotGrid(linewidth=0.5, flipY=True) + rm = RectilinearMesh2D(x_centres=x, x_relative_to=0.2*np.random.randn(y.size), y_centres=y, y_relative_to=0.2*np.random.randn(x.size)) + plt.subplot(122) + _ = rm.plotGrid(linewidth=0.5, flipY=True) + + # RelativeTo single + with h5py.File('rm2d.h5', 'w') as f: + rm.toHdf(f, 'test') + + with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test']) + + arr = np.random.randn(*rm.shape) + p += 1; plt.figure(p) + plt.subplot(211) + rm.pcolor(arr, flipY=True) + plt.subplot(212) + rm2.pcolor(arr, flipY=True) + + # RelativeTo expanded + with h5py.File('rm2d.h5', 'w') as f: + rm.createHdf(f, 'test', add_axis=RectilinearMesh1D(centres=StatArray(np.arange(3.0), name='Easting', units="m"), relativeTo = 0.2*np.random.randn(x.size, y.size))) + for i in range(3): + rm.x.relativeTo += 0.5 + rm.y.relativeTo += 0.5 + rm.writeHdf(f, 'test', index=i) + + with h5py.File('rm2d.h5', 'r') as f: + rm2 = RectilinearMesh2D.fromHdf(f['test'], index=0) + + with h5py.File('rm2d.h5', 'r') as f: + rm3 = RectilinearMesh3D.fromHdf(f['test']) + + p += 1; plt.figure(p) + plt.subplot(311) + rm.pcolor(arr, flipY=True) + plt.subplot(312) + rm2.pcolor(arr, flipY=True) + + p += 1; plt.figure(p) + arr = np.random.randn(*rm3.shape) + plt.subplot(311) + mesh = rm3[0, :, :] + mesh.pcolor(arr[0, :, :], flipY=True) + plt.subplot(312) + mesh = rm3[:, 0, :] + mesh.pcolor(arr[:, 0, :], flipY=True) + plt.subplot(313) + rm3[:, :, 0].pcolor(arr[:, :, 0]) + + plt.show() + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_011.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_011.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_012.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_012.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_013.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_013.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_014.png + :alt: plot rectilinear mesh 2d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_2d_014.png + :class: sphx-glr-multi-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 2.015 seconds) + + +.. _sphx_glr_download_examples_Meshes_plot_rectilinear_mesh_2d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_rectilinear_mesh_2d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_rectilinear_mesh_2d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Meshes/plot_rectilinear_mesh_3d.rst.txt b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_3d.rst.txt new file mode 100644 index 00000000..ebb5a69d --- /dev/null +++ b/docs/_sources/examples/Meshes/plot_rectilinear_mesh_3d.rst.txt @@ -0,0 +1,342 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Meshes/plot_rectilinear_mesh_3d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Meshes_plot_rectilinear_mesh_3d.py: + + +3D Rectilinear Mesh +------------------- +This 3D rectilinear mesh defines a grid with straight cell boundaries. + +.. GENERATED FROM PYTHON SOURCE LINES 9-16 + +.. code-block:: Python + + from geobipy import StatArray + from geobipy import RectilinearMesh3D + import matplotlib.pyplot as plt + import numpy as np + import h5py + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 17-18 + +Specify some cell centres in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 18-37 + +.. code-block:: Python + + x = StatArray(np.arange(10.0), 'Easting', 'm') + y = StatArray(np.arange(15.0), 'Northing', 'm') + z = StatArray(np.arange(20.0), 'Depth', 'm') + + rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + + rm1 = rm[:5, :5, :5] + rm2 = rm[:, :, 5] + rm3 = rm[:, 5, :] + rm4 = rm[5, :, :] + + plt.figure() + plt.subplot(231) + rm2.plotGrid() + plt.subplot(232) + rm3.plotGrid() + plt.subplot(233) + rm4.plotGrid() + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_001.png + :alt: plot rectilinear mesh 3d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 38-49 + +.. code-block:: Python + + rm2 = rm[:, 5, 5] + rm3 = rm[5, :, 5] + rm4 = rm[5, 5, :] + + plt.subplot(234) + rm2.plotGrid() + plt.subplot(235) + rm3.plotGrid() + plt.subplot(236) + rm4.plotGrid() + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_002.png + :alt: plot rectilinear mesh 3d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 50-77 + +.. code-block:: Python + + with h5py.File('rm3d.h5', 'w') as f: + rm.createHdf(f, 'test') + rm.writeHdf(f, 'test') + + with h5py.File('rm3d.h5', 'r') as f: + rm2 = RectilinearMesh3D.fromHdf(f['test']) + + rm.pyvista_mesh().save('rm3d.vtk') + + + xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) + z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re) + + rm1 = rm[:5, :5, :5] + rm2 = rm[:, :, 5] + rm3 = rm[:, 5, :] + rm4 = rm[5, :, :] + + plt.figure() + plt.subplot(231) + rm2.plotGrid() + plt.subplot(232) + rm3.plotGrid() + plt.subplot(233) + rm4.plotGrid() + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_003.png + :alt: plot rectilinear mesh 3d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 78-79 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 79-81 + +.. code-block:: Python + + pv = rm.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 82-83 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 83-105 + +.. code-block:: Python + + mesh = rm.pyvista_mesh().save('rm3d_re1.vtk') + + + x_re = StatArray(np.sin(np.repeat(rm.y.centres[:, None], rm.z.nCells, 1)), "x_re") + + xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) + z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re) + + rm1 = rm[:5, :5, :5] + rm2 = rm[:, :, 5] + rm3 = rm[:, 5, :] + rm4 = rm[5, :, :] + + plt.figure() + plt.subplot(231) + rm2.plotGrid() + plt.subplot(232) + rm3.plotGrid() + plt.subplot(233) + rm4.plotGrid() + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_004.png + :alt: plot rectilinear mesh 3d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 106-107 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 107-109 + +.. code-block:: Python + + pv = rm.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 110-111 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 111-137 + +.. code-block:: Python + + mesh = rm.pyvista_mesh().save('rm3d_re2.vtk') + + + xx, yy = np.meshgrid(rm.z.centres, rm.y.centres) + x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re") + + xx, yy = np.meshgrid(rm.z.centres, rm.x.centres) + y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + + xx, yy = np.meshgrid(rm.y.centres, rm.x.centres) + z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) + + rm1 = rm[:5, :5, :5] + rm2 = rm[:, :, 5] + rm3 = rm[:, 5, :] + rm4 = rm[5, :, :] + + plt.figure() + plt.subplot(231) + rm2.plotGrid() + plt.subplot(232) + rm3.plotGrid() + plt.subplot(233) + rm4.plotGrid() + + + + +.. image-sg:: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_005.png + :alt: plot rectilinear mesh 3d + :srcset: /examples/Meshes/images/sphx_glr_plot_rectilinear_mesh_3d_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 138-139 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 139-141 + +.. code-block:: Python + + pv = rm.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 142-143 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 143-154 + +.. code-block:: Python + + mesh = rm.pyvista_mesh().save('rm3d_re3.vtk') + + with h5py.File('rm3d.h5', 'w') as f: + rm.toHdf(f, 'test') + + with h5py.File('rm3d.h5', 'r') as f: + rm2 = RectilinearMesh3D.fromHdf(f['test']) + + rm2.pyvista_mesh().save('rm3d_read.vtk') + + plt.show() + + + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 3.318 seconds) + + +.. _sphx_glr_download_examples_Meshes_plot_rectilinear_mesh_3d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_rectilinear_mesh_3d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_rectilinear_mesh_3d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Meshes/sg_execution_times.rst.txt b/docs/_sources/examples/Meshes/sg_execution_times.rst.txt new file mode 100644 index 00000000..fcf883d9 --- /dev/null +++ b/docs/_sources/examples/Meshes/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_Meshes_sg_execution_times: + + +Computation times +================= +**00:10.044** total execution time for 3 files **from examples/Meshes**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_1d.py` (``plot_rectilinear_mesh_1d.py``) + - 00:04.711 + - 0.0 + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_3d.py` (``plot_rectilinear_mesh_3d.py``) + - 00:03.318 + - 0.0 + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_2d.py` (``plot_rectilinear_mesh_2d.py``) + - 00:02.015 + - 0.0 diff --git a/docs/_sources/examples/Models/README.rst.txt b/docs/_sources/examples/Models/README.rst.txt new file mode 100644 index 00000000..f6155583 --- /dev/null +++ b/docs/_sources/examples/Models/README.rst.txt @@ -0,0 +1,2 @@ +Models +====== \ No newline at end of file diff --git a/docs/_sources/examples/Models/index.rst.txt b/docs/_sources/examples/Models/index.rst.txt new file mode 100644 index 00000000..b87195e7 --- /dev/null +++ b/docs/_sources/examples/Models/index.rst.txt @@ -0,0 +1,76 @@ + + +.. _sphx_glr_examples_Models: + +Models +====== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_1d.py` + +.. raw:: html + +
1D Model with an infinite halfspace
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_2d.py` + +.. raw:: html + +
2D Rectilinear Model
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_3d.py` + +.. raw:: html + +
3D Rectilinear Model
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Models/plot_model_1d + /examples/Models/plot_model_2d + /examples/Models/plot_model_3d + diff --git a/docs/_sources/examples/Models/plot_model_1d.rst.txt b/docs/_sources/examples/Models/plot_model_1d.rst.txt new file mode 100644 index 00000000..1c03c229 --- /dev/null +++ b/docs/_sources/examples/Models/plot_model_1d.rst.txt @@ -0,0 +1,377 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Models/plot_model_1d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Models_plot_model_1d.py: + + +1D Model with an infinite halfspace +----------------------------------- + +.. GENERATED FROM PYTHON SOURCE LINES 7-15 + +.. code-block:: Python + + from copy import deepcopy + from geobipy import StatArray + from geobipy import RectilinearMesh1D + from geobipy import Model + from geobipy import Distribution + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 16-18 + +Instantiate the 1D Model with a Half Space +++++++++++++++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 18-32 + +.. code-block:: Python + + + # Make a test model with 10 layers, and increasing parameter values + nLayers = 2 + par = StatArray(np.linspace(0.001, 0.02, nLayers), "Conductivity", "$\\frac{S}{m}$") + thk = StatArray(np.full(nLayers, fill_value=10.0)) + thk[-1] = np.inf + mesh = RectilinearMesh1D(widths = thk) + + mod = Model(mesh = mesh, values=par) + # mod = Model1D(parameters=par, widths=thk) + + plt.figure() + mod.plotGrid(transpose=True, flip=True) + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_1d_001.png + :alt: plot model 1d + :srcset: /examples/Models/images/sphx_glr_plot_model_1d_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 33-40 + +Randomness and Model Perturbations +++++++++++++++++++++++++++++++++++ +We can set the priors on the 1D model by assigning minimum and maximum layer +depths and a maximum number of layers. These are used to create priors on +the number of cells in the model, a new depth interface, new parameter values +and the vertical gradient of those parameters. +The halfSpaceValue is used as a reference value for the parameter prior. + +.. GENERATED FROM PYTHON SOURCE LINES 40-54 + +.. code-block:: Python + + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + # Set the priors + mod.set_priors(value_mean=0.01, + min_edge=1.0, + max_edge=150.0, + max_cells=30, + solve_value=True, + solve_gradient=True, + prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 55-56 + +We can evaluate the prior of the model using depths only + +.. GENERATED FROM PYTHON SOURCE LINES 56-60 + +.. code-block:: Python + + print('Log probability of the Model given its priors: ', mod.probability(False, False)) + # Or with priors on its parameters, and parameter gradient with depth. + print('Log probability of the Model given its priors: ', mod.probability(True, True)) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Log probability of the Model given its priors: -13.338200594791775 + Log probability of the Model given its priors: -19.780269280707714 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 61-63 + +To propose new models, we specify the probabilities of creating, removing, perturbing, and not changing +a layer interface + +.. GENERATED FROM PYTHON SOURCE LINES 63-66 + +.. code-block:: Python + + pProposal = Distribution('LogNormal', 0.01, np.log(2.0)**2.0, linearSpace=True, prng=prng) + mod.set_proposals(probabilities=[0.25, 0.25, 0.5, 0.25], proposal=pProposal, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 67-68 + +We can then perturb the layers of the model + +.. GENERATED FROM PYTHON SOURCE LINES 68-70 + +.. code-block:: Python + + remapped, perturbed = mod.perturb() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 71-77 + +.. code-block:: Python + + fig = plt.figure(figsize=(8, 6)) + ax = plt.subplot(121) + mod.pcolor(transpose=True, flip=True, log=10) # , grid=True) + ax = plt.subplot(122) + perturbed.pcolor(transpose=True, flip=True, log=10) # , grid=True) + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_1d_002.png + :alt: plot model 1d + :srcset: /examples/Models/images/sphx_glr_plot_model_1d_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 78-79 + +We can evaluate the prior of the model using depths only + +.. GENERATED FROM PYTHON SOURCE LINES 79-84 + +.. code-block:: Python + + print('Log probability of the Model given its priors: ',perturbed.probability(False, False)) + # Or with priors on its parameters, and parameter gradient with depth. + print('Log probability of the Model given its priors: ',perturbed.probability(True, True)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Log probability of the Model given its priors: -13.338200594791775 + Log probability of the Model given its priors: -19.03751254813826 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 85-99 + +Perturbing a model multiple times ++++++++++++++++++++++++++++++++++ +In the stochasitic inference process, we perturb the model structure, +and parameter values, multiple times. +Each time the model is perturbed, we can record its state +in a posterior distribution. + +For a 1D model, the parameter posterior is a 2D hitmap with depth in one dimension +and the parameter value in the other. +We also attach a 1D histogram for the number of layers, +and a 1D histogram for the locations of interfaces. + +Since we have already set the priors on the Model, we can set the posteriors +based on bins from from the priors. + +.. GENERATED FROM PYTHON SOURCE LINES 99-104 + +.. code-block:: Python + + + mod.set_posteriors() + + mod0 = deepcopy(mod) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 105-106 + +Now we randomly perturb the model, and update its posteriors. + +.. GENERATED FROM PYTHON SOURCE LINES 106-115 + +.. code-block:: Python + + mod.update_posteriors() + for i in range(1001): + remapped, perturbed = mod.perturb() + + # And update the model posteriors + perturbed.update_posteriors() + + mod = perturbed + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 116-121 + +We can now plot the posteriors of the model. + +Remember in this case, we are simply perturbing the model structure and parameter values +The proposal for the parameter values is fixed and centred around a single value. +fig = plt.figure(figsize=(8, 6)) + +.. GENERATED FROM PYTHON SOURCE LINES 121-162 + +.. code-block:: Python + + + # plt.subplot(131) + # mod.nCells.posterior.plot() + # ax = plt.subplot(132) + # mod.values.posterior.pcolor(cmap='gray_r', colorbar=False, flipY=True, logX=10) + # plt.subplot(133, sharey=ax) + # mod.mesh.edges.posterior.plot(transpose=True, flipY=True) + + # plt.figure() + # mod.plot_posteriors(**{"cmap": 'gray_r', + # "xscale": 'log', + # "noColorbar": True, + # "flipY": True, + # 'credible_interval_kwargs':{'axis': 1, + # 'reciprocate': True, + # 'xscale': 'log'}}) + # mod.par.posterior.plotCredibleIntervals(xscale='log', axis=1) + + + fig = plt.figure(figsize=(8, 6)) + # gs = fig.add_gridspec(nrows=1, ncols=1) + mod.plot_posteriors(axes=fig, + edges_kwargs = { + "transpose":True, + "flipY":True + }, + parameter_kwargs = { + "cmap": 'gray_r', + "xscale": 'log', + "colorbar": False, + "flipY": True, + 'credible_interval_kwargs':{ + 'reciprocate':True, + # 'axis': 1, + 'xscale': 'log' + } + }, + best = mod) + + + plt.show() + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_1d_003.png + :alt: plot model 1d + :srcset: /examples/Models/images/sphx_glr_plot_model_1d_003.png + :class: sphx-glr-single-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 3.092 seconds) + + +.. _sphx_glr_download_examples_Models_plot_model_1d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_model_1d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_model_1d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Models/plot_model_2d.rst.txt b/docs/_sources/examples/Models/plot_model_2d.rst.txt new file mode 100644 index 00000000..9f484d2f --- /dev/null +++ b/docs/_sources/examples/Models/plot_model_2d.rst.txt @@ -0,0 +1,138 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Models/plot_model_2d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Models_plot_model_2d.py: + + +2D Rectilinear Model +-------------------- +This 2D rectilinear model defines a grid with straight cell boundaries. + +.. GENERATED FROM PYTHON SOURCE LINES 9-17 + +.. code-block:: Python + + from geobipy import StatArray + from geobipy import RectilinearMesh2D + from geobipy import Model + import h5py + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 18-19 + +Specify some cell centres in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 19-56 + +.. code-block:: Python + + x = StatArray(np.arange(11.0), 'Easting', 'm') + y = StatArray(np.arange(11.0), 'Northing', 'm') + mesh = RectilinearMesh2D(x_edges=x, y_edges=y) + + xx, yy = np.meshgrid(mesh.x.centres, mesh.y.centres) + values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values") + + mod = Model(mesh=mesh, values = values) + + plt.figure() + mod.pcolor() + + mod2 = mod.resample(0.5, 0.5) + mod3 = mod.resample(1.5, 1.5) + plt.figure() + plt.subplot(121) + mod2.pcolor() + plt.axis('equal') + plt.subplot(122) + mod3.pcolor() + plt.axis('equal') + + + # #%% + # # We can plot the mesh in 3D! + # pv = rm.pyvista_plotter() + # pv.show() + + # rm.to_vtk('Model3D.vtk') + + with h5py.File('Model2D.h5', 'w') as f: + mod.toHdf(f, 'model') + + with h5py.File('Model2D.h5', 'r') as f: + mod2 = Model.fromHdf(f['model']) + + + plt.show() + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Models/images/sphx_glr_plot_model_2d_001.png + :alt: plot model 2d + :srcset: /examples/Models/images/sphx_glr_plot_model_2d_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Models/images/sphx_glr_plot_model_2d_002.png + :alt: plot model 2d + :srcset: /examples/Models/images/sphx_glr_plot_model_2d_002.png + :class: sphx-glr-multi-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 0.249 seconds) + + +.. _sphx_glr_download_examples_Models_plot_model_2d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_model_2d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_model_2d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Models/plot_model_3d.rst.txt b/docs/_sources/examples/Models/plot_model_3d.rst.txt new file mode 100644 index 00000000..6733e593 --- /dev/null +++ b/docs/_sources/examples/Models/plot_model_3d.rst.txt @@ -0,0 +1,406 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Models/plot_model_3d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Models_plot_model_3d.py: + + +3D Rectilinear Model +-------------------- +This 3D rectilinear model defines a grid with straight cell boundaries. + +.. GENERATED FROM PYTHON SOURCE LINES 9-24 + +.. code-block:: Python + + from geobipy import StatArray + from geobipy import RectilinearMesh3D + from geobipy import Model + import matplotlib.pyplot as plt + import numpy as np + import h5py + + + """ + 3D Rectilinear Mesh + ------------------- + This 3D rectilinear mesh defines a grid with straight cell boundaries. + + """ + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + '\n3D Rectilinear Mesh\n-------------------\nThis 3D rectilinear mesh defines a grid with straight cell boundaries.\n\n' + + + +.. GENERATED FROM PYTHON SOURCE LINES 25-33 + +.. code-block:: Python + + from geobipy import StatArray + from geobipy import RectilinearMesh3D + from geobipy import Model + import matplotlib.pyplot as plt + import numpy as np + import h5py + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 34-35 + +Specify some cell centres in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 35-60 + +.. code-block:: Python + + x = StatArray(np.arange(10.0), 'Easting', 'm') + y = StatArray(np.arange(15.0), 'Northing', 'm') + z = StatArray(np.arange(20.0), 'Depth', 'm') + + mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + + xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) + values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Height") + values = np.repeat(values[:, :, None], mesh.z.nCells, 2) + + model = Model(mesh=mesh, values=values) + + model1 = model[:5, :5, :5] + model2 = model[:, :, 5] + model3 = model[:, 5, :] + model4 = model[5, :, :] + + plt.figure() + plt.subplot(231) + model2.pcolor() + plt.subplot(232) + model3.pcolor() + plt.subplot(233) + model4.pcolor() + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_3d_001.png + :alt: plot model 3d + :srcset: /examples/Models/images/sphx_glr_plot_model_3d_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 61-72 + +.. code-block:: Python + + model2 = model[:, 5, 5] + model3 = model[5, :, 5] + model4 = model[5, 5, :] + + plt.subplot(234) + model2.pcolor() + plt.subplot(235) + model3.pcolor() + plt.subplot(236) + model4.pcolor() + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_3d_002.png + :alt: plot model 3d + :srcset: /examples/Models/images/sphx_glr_plot_model_3d_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 73-101 + +.. code-block:: Python + + with h5py.File('model3d.h5', 'w') as f: + model.createHdf(f, 'test') + model.writeHdf(f, 'test') + + with h5py.File('model3d.h5', 'r') as f: + model2 = Model.fromHdf(f['test']) + + model.pyvista_mesh().save('model3d.vtk') + + + xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) + z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re) + model = Model(mesh=mesh, values=values) + + model1 = model[:5, :5, :5] + model2 = model[:, :, 5] + model3 = model[:, 5, :] + model4 = model[5, :, :] + + plt.figure() + plt.subplot(231) + model2.pcolor() + plt.subplot(232) + model3.pcolor() + plt.subplot(233) + model4.pcolor() + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_3d_003.png + :alt: plot model 3d + :srcset: /examples/Models/images/sphx_glr_plot_model_3d_003.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 102-103 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 103-105 + +.. code-block:: Python + + pv = model.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 106-107 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 107-127 + +.. code-block:: Python + + model.pyvista_mesh().save('model3d_re1.vtk') + + + x_re = StatArray(np.sin(np.repeat(mesh.y.centres[:, None], mesh.z.nCells, 1)), "x_re") + mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re) + model = Model(mesh=mesh, values=values) + + model1 = model[:5, :5, :5] + model2 = model[:, :, 5] + model3 = model[:, 5, :] + model4 = model[5, :, :] + + plt.figure() + plt.subplot(231) + model2.pcolor() + plt.subplot(232) + model3.pcolor() + plt.subplot(233) + model4.pcolor() + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_3d_004.png + :alt: plot model 3d + :srcset: /examples/Models/images/sphx_glr_plot_model_3d_004.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 128-129 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 129-131 + +.. code-block:: Python + + pv = model.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 132-133 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 133-155 + +.. code-block:: Python + + model.pyvista_mesh().save('model3d_re2.vtk') + + + xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres) + y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + + mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) + model = Model(mesh=mesh, values=values) + + model1 = model[:5, :5, :5] + model2 = model[:, :, 5] + model3 = model[:, 5, :] + model4 = model[5, :, :] + + plt.figure() + plt.subplot(231) + model2.pcolor() + plt.subplot(232) + model3.pcolor() + plt.subplot(233) + model4.pcolor() + + + + +.. image-sg:: /examples/Models/images/sphx_glr_plot_model_3d_005.png + :alt: plot model 3d + :srcset: /examples/Models/images/sphx_glr_plot_model_3d_005.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 156-157 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 157-159 + +.. code-block:: Python + + pv = model.pyvista_plotter() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 160-161 + +We can plot the mesh in 3D! + +.. GENERATED FROM PYTHON SOURCE LINES 161-172 + +.. code-block:: Python + + model.pyvista_mesh().save('model3d_re3.vtk') + + # with h5py.File('mesh3d.h5', 'w') as f: + # mesh.toHdf(f, 'test') + + # with h5py.File('mesh3d.h5', 'r') as f: + # mesh2 = RectilinearMesh3D.fromHdf(f['test']) + + # mesh2.pyvista_mesh().save('mesh3d_read.vtk') + + plt.show() + + + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 0.908 seconds) + + +.. _sphx_glr_download_examples_Models_plot_model_3d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_model_3d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_model_3d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Models/sg_execution_times.rst.txt b/docs/_sources/examples/Models/sg_execution_times.rst.txt new file mode 100644 index 00000000..9e270b4c --- /dev/null +++ b/docs/_sources/examples/Models/sg_execution_times.rst.txt @@ -0,0 +1,43 @@ + +:orphan: + +.. _sphx_glr_examples_Models_sg_execution_times: + + +Computation times +================= +**00:04.249** total execution time for 3 files **from examples/Models**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Models_plot_model_1d.py` (``plot_model_1d.py``) + - 00:03.092 + - 0.0 + * - :ref:`sphx_glr_examples_Models_plot_model_3d.py` (``plot_model_3d.py``) + - 00:00.908 + - 0.0 + * - :ref:`sphx_glr_examples_Models_plot_model_2d.py` (``plot_model_2d.py``) + - 00:00.249 + - 0.0 diff --git a/docs/_sources/examples/README.rst.txt b/docs/_sources/examples/README.rst.txt new file mode 100644 index 00000000..0db3c1d1 --- /dev/null +++ b/docs/_sources/examples/README.rst.txt @@ -0,0 +1,3 @@ +######## +Examples +######## \ No newline at end of file diff --git a/docs/_sources/examples/Statistics/README.rst.txt b/docs/_sources/examples/Statistics/README.rst.txt new file mode 100644 index 00000000..5f81bd2e --- /dev/null +++ b/docs/_sources/examples/Statistics/README.rst.txt @@ -0,0 +1,2 @@ +Statistics +========== \ No newline at end of file diff --git a/docs/_sources/examples/Statistics/index.rst.txt b/docs/_sources/examples/Statistics/index.rst.txt new file mode 100644 index 00000000..751be611 --- /dev/null +++ b/docs/_sources/examples/Statistics/index.rst.txt @@ -0,0 +1,95 @@ + + +.. _sphx_glr_examples_Statistics: + +========== +Statistics +========== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_1d.py` + +.. raw:: html + +
Histogram 1D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_2d.py` + +.. raw:: html + +
Histogram 2D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_3d.py` + +.. raw:: html + +
Histogram 3D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_StatArray_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_StatArray.py` + +.. raw:: html + +
StatArray Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Statistics/plot_histogram_1d + /examples/Statistics/plot_histogram_2d + /examples/Statistics/plot_histogram_3d + /examples/Statistics/plot_StatArray + diff --git a/docs/_sources/examples/Statistics/plot_StatArray.rst.txt b/docs/_sources/examples/Statistics/plot_StatArray.rst.txt new file mode 100644 index 00000000..03792897 --- /dev/null +++ b/docs/_sources/examples/Statistics/plot_StatArray.rst.txt @@ -0,0 +1,1892 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Statistics/plot_StatArray.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Statistics_plot_StatArray.py: + + +StatArray Class +---------------- + +Extends the numpy ndarray class to add extra attributes such as names, and +units, and allows us to attach statistical descriptors of the array. +The direct extension to numpy maintains speed and functionality of numpy arrays. + +.. GENERATED FROM PYTHON SOURCE LINES 11-21 + +.. code-block:: Python + + from geobipy import StatArray + from geobipy import Histogram + from geobipy import Distribution + from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D + import numpy as np + import matplotlib.pyplot as plt + import h5py + + # plt.style.use('seaborn-pastel') + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 22-25 + +Instantiating a new StatArray class ++++++++++++++++++++++++++++++++++++ + + +.. GENERATED FROM PYTHON SOURCE LINES 25-51 + +.. code-block:: Python + + + # Integer + test = StatArray(1, name='1') + print(test.summary) + test = StatArray(10, name='10') + print(test.summary) + # tuple/Shape + test = StatArray((2, 10), name='(2, 10)') + print(test.summary) + + # float + test = StatArray(45.454, name='45.454') + print(test.summary) + test = StatArray(np.float64(45.454), name='45.454') + print(test.summary) + + # complex + # test = StatArray(np.complex(0.0, 1.0), name='complex(0, 1)') + + # array + Density = StatArray(np.random.randn(1), name="Density", units="$\frac{g}{cc}$") + print(Density.summary) + + # The StatArray can take any numpy function that returns an array as an input. + # The name and units of the variable can be assigned to the StatArray. + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Name: 1 0x7fbf40481ac0 + Shape: (1,) + Values: [0.] + Min: 0.0 + Max: 0.0 + has_posterior: False + + Name: 10 0x7fbf52997540 + Shape: (10,) + Values: [0. 0. 0. ... 0. 0. 0.] + Min: 0.0 + Max: 0.0 + has_posterior: False + + Name: (2, 10) 0x7fbf40481ac0 + Shape: (2, 10) + Values: [[0. 0. 0. ... 0. 0. 0.] + [0. 0. 0. ... 0. 0. 0.]] + Min: 0.0 + Max: 0.0 + has_posterior: False + + Name: 45.454 0x7fbf52997540 + Shape: (1,) + Values: [45.454] + Min: 45.454 + Max: 45.454 + has_posterior: False + + Name: 45.454 0x7fbf40481ac0 + Shape: (1,) + Values: [45.454] + Min: 45.454 + Max: 45.454 + has_posterior: False + + Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40 + Shape: (1,) + Values: [-0.57912126] + Min: -0.5791212563194518 + Max: -0.5791212563194518 + has_posterior: False + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 52-72 + +Attaching Prior and Proposal Distributions to a StatArray ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +The StatArray class has been built so that we may easily +attach not only names and units, but statistical distributions too. +We won't go into too much detail about the different distribution +classes here so check out the :ref:`Distribution Class` for a better description. + +Two types of distributions can be attached to the StatArray. + +* Prior Distribution + The prior represents how the user believes the variable should + behave from a statistical standpoint. + The values of the variable can be evaluated against the attached prior, + to determine how likely they are to have occured https://en.wikipedia.org/wiki/Prior_probability + +* Proposal Distribution + The proposal describes a probability distribution from which to + sample when we wish to perturb the variable + https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm + +.. GENERATED FROM PYTHON SOURCE LINES 72-82 + +.. code-block:: Python + + + # Obtain an instantiation of a random number generator. + # This is optional, but is an important consideration for parallel programming. + from numpy.random import Generator + from numpy.random import PCG64DXSM + generator = PCG64DXSM(seed=0) + prng = Generator(generator) + + Density.prior = Distribution('Uniform', -2.0, 2.0, prng=prng) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 83-84 + +We can also attach a proposal distribution + +.. GENERATED FROM PYTHON SOURCE LINES 84-90 + +.. code-block:: Python + + Density.proposal = Distribution('Normal', 0.0, 1.0, prng=prng) + print(Density.summary) + print("Class type of the prior: ",type(Density.prior)) + print("Class type of the proposal: ",type(Density.proposal)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40 + Shape: (1,) + Values: [-0.57912126] + Min: -0.5791212563194518 + Max: -0.5791212563194518 + Prior: + | Uniform Distribution: + | Min: -2.0 + | Max: 2.0 + Proposal: + | Normal + | Mean:0.0 + | Variance:1.0 + has_posterior: False + + Class type of the prior: + Class type of the proposal: + + + + +.. GENERATED FROM PYTHON SOURCE LINES 91-94 + +The values in the variable can be evaluated against the prior. +In this case, we have 3 elements in the variable, and a univariate Normal for the prior. +Therefore each element is evaluated to get 3 probabilities, one for each element. + +.. GENERATED FROM PYTHON SOURCE LINES 94-96 + +.. code-block:: Python + + print(Density.probability(log=False)) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 0.25 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 97-98 + +The univariate proposal distribution can generate random samples from itself. + +.. GENERATED FROM PYTHON SOURCE LINES 98-100 + +.. code-block:: Python + + print(Density.propose()) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 1.1375024404290368 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 101-103 + +From a sampling stand point we can either sample using only the proposal +Or we can only generate samples that simultaneously satisfy the prior. + +.. GENERATED FROM PYTHON SOURCE LINES 103-105 + +.. code-block:: Python + + print(Density.propose(relative=True)) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [-0.04095499] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 106-107 + +We can perturb the variable by drawing from the attached proposal distribution. + +.. GENERATED FROM PYTHON SOURCE LINES 107-111 + +.. code-block:: Python + + + Density.perturb() + print(Density.summary) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40 + Shape: (1,) + Values: [0.38188467] + Min: 0.38188466718060166 + Max: 0.38188466718060166 + Prior: + | Uniform Distribution: + | Min: -2.0 + | Max: 2.0 + Proposal: + | Normal + | Mean:0.0 + | Variance:1.0 + has_posterior: False + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 112-117 + +Attaching a Histogram to capture the posterior distribution ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +The StatArray can perturb itself, evaluate its current probability given its priors +and a histogram can be attached to capture its posterior distribution. +As an example, lets create a Histogram class with bins generated from the prior. + +.. GENERATED FROM PYTHON SOURCE LINES 117-118 + +.. code-block:: Python + + bins = Density.prior.bins() + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 119-120 + +Attach the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 120-122 + +.. code-block:: Python + + Density.posterior = Histogram(mesh = RectilinearMesh1D(edges=bins)) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 123-124 + +In an iterative sense, we can propose and evaluate new values, and update the posterior + +.. GENERATED FROM PYTHON SOURCE LINES 124-131 + +.. code-block:: Python + + for i in range(1000): + Density.perturb() + p = Density.probability(log=False) + + if p > 0.0: # This is a simple example! + Density.update_posterior() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 132-135 + +.. code-block:: Python + + plt.figure() + Density.summaryPlot() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_001.png + :alt: Prior, Proposal, Posterior + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 136-140 + +Attach a multivariate normal distribution as the prior and proposal ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Attach the multivariate prior + +.. GENERATED FROM PYTHON SOURCE LINES 140-146 + +.. code-block:: Python + + + mean = np.random.randn(Density.size) + variance = np.ones(Density.size) + Density.prior = Distribution('MvNormal', mean, variance, prng=prng) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 147-150 + +Since the prior is multivariate, the appropriate equations are used to +evaluate the probability for all elements in the StatArray. +This produces a single probability. + +.. GENERATED FROM PYTHON SOURCE LINES 150-153 + +.. code-block:: Python + + + print(Density.probability(log=False)) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 0.3912195449832787 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 154-155 + +Attach the multivariate proposal + +.. GENERATED FROM PYTHON SOURCE LINES 155-161 + +.. code-block:: Python + + + mean = np.random.randn(Density.size) + variance = np.ones(Density.size) + Density.proposal = Distribution('MvNormal', mean, variance, prng=prng) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 162-163 + +Perturb the variables using the multivariate proposal. + +.. GENERATED FROM PYTHON SOURCE LINES 163-178 + +.. code-block:: Python + + + Density.perturb() + Density.summary + + with h5py.File('statarray.h5', 'w') as f: + Density.createHdf(f, 'statarray', withPosterior=True, add_axis=3) + Density.writeHdf(f, 'statarray', withPosterior=True, index=0) + + with h5py.File('statarray.h5', 'r') as f: + tmp = StatArray.fromHdf(f, 'statarray', index=0, skip_posterior=False) + + with h5py.File('statarray.h5', 'r') as f: + tmp = StatArray.fromHdf(f, 'statarray', skip_posterior=False) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 179-190 + +Basic manipulation +++++++++++++++++++ + +The StatArray contains other functions to perform basic array manipulations + +These routines essentially wrap around numpy functions, +but the result will have the same name and units, +and if any prior or proposal are set, those will be carried through too. + +1D example +__________ + +.. GENERATED FROM PYTHON SOURCE LINES 190-194 + +.. code-block:: Python + + + x = StatArray(-np.cumsum(np.arange(10.0))) + print(x) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ -0. -1. -3. ... -28. -36. -45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 195-200 + +.. code-block:: Python + + + + print(x.insert(i=[0, 9], values=[999.0, 999.0])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [999. -0. -1. ... -36. 999. -45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 201-206 + +.. code-block:: Python + + + + print(x.prepend(999.0)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [999. -0. -1. ... -28. -36. -45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 207-212 + +.. code-block:: Python + + + + print(x.prepend([998.0, 999.0])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [998. 999. -0. ... -28. -36. -45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 213-218 + +.. code-block:: Python + + + + print(x.append([998.0, 999.0])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ -0. -1. -3. ... -45. 998. 999.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 219-224 + +.. code-block:: Python + + + + print(x.resize(14)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [-0. -1. -3. ... -1. -3. -6.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 225-230 + +.. code-block:: Python + + + + print(x.delete([5,8])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ -0. -1. -3. ... -21. -28. -45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 231-236 + +.. code-block:: Python + + + + print(x.edges()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ 0.5 -0.5 -2. ... -32. -40.5 -49.5] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 237-242 + +.. code-block:: Python + + + + print(x.internalEdges()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ -0.5 -2. -4.5 ... -24.5 -32. -40.5] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 243-248 + +.. code-block:: Python + + + + print(x.firstNonZero()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 1 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 249-254 + +.. code-block:: Python + + + + print(x.lastNonZero()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + 10 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 255-260 + +.. code-block:: Python + + + + print(x.abs()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ 0. 1. 3. ... 28. 36. 45.] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 261-263 + +2D example +__________ + +.. GENERATED FROM PYTHON SOURCE LINES 263-268 + +.. code-block:: Python + + + x = StatArray(np.asarray([[0, -2, 3],[3, 0, -1],[1, 2, 0]])) + print(x) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 3] + [ 3 0 -1] + [ 1 2 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 269-274 + +.. code-block:: Python + + + + print(x.insert(i=0, values=4)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 4 4 4] + [ 0 -2 3] + [ 3 0 -1] + [ 1 2 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 275-280 + +.. code-block:: Python + + + + print(x.insert(i=[2, 3], values=5, axis=1)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 5 3 5] + [ 3 0 5 -1 5] + [ 1 2 5 0 5]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 281-286 + +.. code-block:: Python + + + + print(x.insert(i=2, values=[10, 11, 12], axis=1)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 10 3] + [ 3 0 11 -1] + [ 1 2 12 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 287-292 + +.. code-block:: Python + + + + print(x.prepend(999)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[999 999 999] + [ 0 -2 3] + [ 3 0 -1] + [ 1 2 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 293-298 + +.. code-block:: Python + + + + print(x.prepend([999, 998, 997], axis=1)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[999 998 997 0 -2 3] + [999 998 997 3 0 -1] + [999 998 997 1 2 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 299-304 + +.. code-block:: Python + + + + print(x.append([[999, 998, 997]])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 3] + [ 3 0 -1] + [ 1 2 0] + [999 998 997]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 305-310 + +.. code-block:: Python + + + + print(x.resize([5,5])) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 3 3 0] + [-1 1 2 0 0] + [-2 3 3 0 -1] + [ 1 2 0 0 -2] + [ 3 3 0 -1 1]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 311-316 + +.. code-block:: Python + + + + print(x.delete(5)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [ 0 -2 3 ... 1 2 0] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 317-322 + +.. code-block:: Python + + + + print(x.delete(2, axis=0)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[ 0 -2 3] + [ 3 0 -1]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 323-328 + +.. code-block:: Python + + + + print(x.firstNonZero(axis=0)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [1 0 0] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 329-334 + +.. code-block:: Python + + + + print(x.lastNonZero(axis=0)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [3 3 2] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 335-340 + +.. code-block:: Python + + + + print(x.firstNonZero(axis=1)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [1 0 0] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 341-346 + +.. code-block:: Python + + + + print(x.lastNonZero(axis=1)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [3 3 2] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 347-352 + +.. code-block:: Python + + + + print(x.abs()) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + [[0 2 3] + [3 0 1] + [1 2 0]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 353-358 + +Plotting +++++++++ + +We can easily plot the StatArray with its built in plotting functions. +All plotting functions can take matplotlib keywords + +.. GENERATED FROM PYTHON SOURCE LINES 358-366 + +.. code-block:: Python + + + # The simplest is to just plot the array + + Density = StatArray(np.random.randn(100),name="Density",units="$\frac{g}{cc}$") + Time = StatArray(np.linspace(0, 100, Density.size), name='Time', units='s') + Depth = StatArray(np.random.exponential(size=Density.size), name='Depth', units='m') + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 367-372 + +.. code-block:: Python + + + + plt.figure() + _ = Density.plot(linewidth=0.5, marker='x', markersize=1.0) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_002.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 373-374 + +We can quickly plot a bar graph. + +.. GENERATED FROM PYTHON SOURCE LINES 374-379 + +.. code-block:: Python + + + plt.figure() + _ = Density.bar() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_003.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 380-381 + +We can scatter the contents of the StatArray if it is 1D + +.. GENERATED FROM PYTHON SOURCE LINES 381-386 + +.. code-block:: Python + + + plt.figure() + _ = Density.scatter(alpha=0.7) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_004.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 387-394 + +Histogram Equalization +______________________ + +A neat trick with colourmaps is histogram equalization. +This approach forces all colours in the images to have an equal weight. +This distorts the colour bar, but can really highlight the lower and higher +ends of whatever you are plotting. Just add the equalize keyword! + +.. GENERATED FROM PYTHON SOURCE LINES 394-399 + +.. code-block:: Python + + + plt.figure() + _ = Density.scatter(alpha=0.7, equalize=True) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_005.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 400-403 + +Take the log base(x) of the data + +We can also take the data to a log, log10, log2, or a custom number! + +.. GENERATED FROM PYTHON SOURCE LINES 403-407 + +.. code-block:: Python + + + plt.figure() + _ = Density.scatter(alpha=0.7,edgecolor='k',log='e') # could also use log='e', log=2, log=x) where x is the base you require + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_006.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 408-411 + +X and Y axes + +We can specify the x axis of the scatter plot. + +.. GENERATED FROM PYTHON SOURCE LINES 411-417 + +.. code-block:: Python + + + + plt.figure() + _ = Density.scatter(x=Time, alpha=0.7, edgecolor='k') + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_007.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_007.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 418-425 + +Notice that I never specified the y axis, so the y axis defaulted to the values in the StatArray. +In this case, any operations applied to the colours, are also applied to the y axis, e.g. log=10. +When I take the values of Density to log base 10, because I do not specify the y plotting locations, those locations are similarly affected. + +I can however force the y co-ordinates by specifying it as input. +In the second subplot I explicitly plot distance on the y axis. +In the first subplot, the y axis is the same as the colourbar. + +.. GENERATED FROM PYTHON SOURCE LINES 425-434 + +.. code-block:: Python + + + + plt.figure() + ax1 = plt.subplot(211) + Density.scatter(x=Time, alpha=0.7, edgecolor='k', log=10) + plt.subplot(212, sharex=ax1) + _ = Density.scatter(x=Time, y=Depth, alpha=0.7, edgecolor='k', log=10) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_008.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_008.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 435-438 + +Point sizes + +Since the plotting functions take matplotlib keywords, I can also specify the size of each points. + +.. GENERATED FROM PYTHON SOURCE LINES 440-455 + +.. code-block:: Python + + + + s = np.ceil(100*(np.abs(np.random.randn(Density.size)))) + plt.figure() + plt.tight_layout() + ax1 = plt.subplot(211) + Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=2) + plt.subplot(212, sharex=ax1) + #Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', sizeLegend=[1.0, 100, 200, 300]) + v = np.abs(Density)+1.0 + _ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=[1.0, 100, 200, 300], log=10) + + + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_009.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_009.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 456-457 + +Of course we can still take the log, or equalize the colour histogram + +.. GENERATED FROM PYTHON SOURCE LINES 457-462 + +.. code-block:: Python + + + plt.figure() + _ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k',equalize=True,log=10) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_010.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_010.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 463-464 + +Typically pcolor only works with 2D arrays. The StatArray has a pcolor method that will pcolor a 1D array + +.. GENERATED FROM PYTHON SOURCE LINES 464-476 + +.. code-block:: Python + + + plt.figure() + plt.subplot(221) + Density.pcolor() + plt.subplot(222) + Density.pcolor(y=Time) + plt.subplot(223) + Density.pcolor(y=Time, flip=True) + plt.subplot(224) + _ = Density.pcolor(y=Time, log=10, equalize=True) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_011.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_011.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 477-480 + +We can add grid lines, and add opacity to each element in the pcolor image + +This is useful if the colour values need to be scaled by another variable e.g. variance. + +.. GENERATED FROM PYTHON SOURCE LINES 480-490 + +.. code-block:: Python + + + + plt.figure() + plt.subplot(121) + Density.pcolor(grid=True, cmap='jet') + plt.subplot(122) + a = np.linspace(1.0, 0.0, Density.size) + _ = Density.pcolor(grid=True, alpha=a, cmap='jet') + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_012.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_012.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 491-492 + +We can plot a histogram of the StatArray + +.. GENERATED FROM PYTHON SOURCE LINES 492-497 + +.. code-block:: Python + + + plt.figure() + _ = Density.hist(100) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_013.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_013.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 498-499 + +We can write the StatArray to a HDF5 file. HDF5 files are binary files that can include compression. They allow quick and easy access to parts of the file, and can also be written to and read from in parallel! + +.. GENERATED FROM PYTHON SOURCE LINES 499-504 + +.. code-block:: Python + + + with h5py.File('1Dtest.h5','w') as f: + Density.toHdf(f,'test') + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 505-507 + +We can then read the StatArray from the file +Here x is a new variable, that is read in from the hdf5 file we just wrote. + +.. GENERATED FROM PYTHON SOURCE LINES 507-514 + +.. code-block:: Python + + + x = StatArray.fromHdf('1Dtest.h5', 'test') + print('x has the same values as Density? ',np.all(x == Density)) + x[2] = 5.0 # Change one of the values in x + print('x has its own memory allocated (not a reference/pointer)? ', id(x) != id(Density)) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + x has the same values as Density? True + x has its own memory allocated (not a reference/pointer)? True + + + + +.. GENERATED FROM PYTHON SOURCE LINES 515-516 + +We can also define a 2D array + +.. GENERATED FROM PYTHON SOURCE LINES 516-521 + +.. code-block:: Python + + + Density = StatArray(np.random.randn(50,100),"Density","$\frac{g}{cc}$") + Density.summary + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 'Name: Density ($\\frac{g}{cc}$) 0x7fbf53e697c0\nShape: (50, 100)\nValues: [[-0.09261046 -0.62871503 0.44062655 ... 0.85936645 -0.70901278\n 0.25472331]\n [ 1.26548023 -0.10173015 0.75511239 ... 0.10859768 -1.02367524\n 0.46045955]\n [-0.19867799 -0.05990528 0.25505206 ... -0.09695121 -1.36113261\n 0.77678945]\n ...\n [ 2.15214478 0.27318879 -0.40283027 ... -0.17158128 0.43057124\n -0.32814672]\n [ 0.61189822 1.6826707 0.77990983 ... 1.21618644 0.82026928\n -2.0003221 ]\n [ 0.65143168 1.01615216 -1.77440758 ... -0.92409722 -0.1278735\n 0.37382774]]\nMin: -3.701988729724111\nMax: 3.7179942041156253\nhas_posterior: False\n' + + + +.. GENERATED FROM PYTHON SOURCE LINES 522-525 + +The StatArray Class's functions work whether it is 1D or 2D + +We can still do a histogram + +.. GENERATED FROM PYTHON SOURCE LINES 525-530 + +.. code-block:: Python + + + plt.figure() + _ = Density.hist() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_014.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_014.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 531-532 + +And we can use pcolor to plot the 2D array + +.. GENERATED FROM PYTHON SOURCE LINES 532-537 + +.. code-block:: Python + + + plt.figure() + _ = Density.pcolor() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_015.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_015.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 538-541 + +The StatArray comes with extra plotting options + +Here we specify the x and y axes for the 2D array using two other 1D StatArrays + +.. GENERATED FROM PYTHON SOURCE LINES 541-548 + +.. code-block:: Python + + + plt.figure() + x = StatArray(np.arange(101),name='x Axis',units = 'mm') + y = StatArray(np.arange(51),name='y Axis',units = 'elephants') + _ = Density.pcolor(x=x, y=y) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_016.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_016.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 549-552 + +We can plot using a log10 scale, in this case, we have values that are less +than or equal to 0.0. Plotting with the log option will by default mask any +of those values, and will let you know that it has done so! + +.. GENERATED FROM PYTHON SOURCE LINES 552-557 + +.. code-block:: Python + + + plt.figure() + _ = Density.pcolor(x=x,y=y,log=2) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_017.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_017.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 558-562 + +A neat trick with colourmaps is histogram equalization. +This approach forces all colours in the image to have an equal amount. +This distorts the colours, but can really highlight the lower and higher +ends of whatever you are plotting + +.. GENERATED FROM PYTHON SOURCE LINES 562-567 + +.. code-block:: Python + + + plt.figure() + _ = Density.pcolor(x=x, y=y, equalize=True) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_018.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_018.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 568-569 + +We can equalize the log10 plot too :) + +.. GENERATED FROM PYTHON SOURCE LINES 569-574 + +.. code-block:: Python + + + plt.figure() + _ = Density.pcolor(x=x,y=y,equalize=True, log=10) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_019.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_019.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 575-576 + +We can add opacity to each pixel in the image + +.. GENERATED FROM PYTHON SOURCE LINES 576-580 + +.. code-block:: Python + + + a = StatArray(np.random.random(Density.shape), 'Opacity from 0.0 to 1.0') + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 581-592 + +.. code-block:: Python + + + + plt.figure() + ax1 = plt.subplot(131) + ax = Density.pcolor(x=x, y=y, flipY=True, linewidth=0.1, colorbar=False) + plt.subplot(132, sharex=ax1, sharey=ax1) + ax = Density.pcolor(x=x, y=y, alpha=a, flipY=True, linewidth=0.1, colorbar=False) + plt.subplot(133, sharex=ax1, sharey=ax1) + _ = a.pcolor(x=x, y=y, flipY=True) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_020.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_020.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 593-594 + +If the array potentially has a lot of white space around the edges, we can trim the image + +.. GENERATED FROM PYTHON SOURCE LINES 594-606 + +.. code-block:: Python + + + Density[:10, :] = 0.0 + Density[-10:, :] = 0.0 + Density[:, :10] = 0.0 + Density[:, -10:] = 0.0 + plt.figure() + plt.subplot(121) + Density.pcolor() + plt.subplot(122) + _ = Density.pcolor(trim=0.0) + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_021.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_021.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 607-608 + +Create a stacked area plot of a 2D StatArray + +.. GENERATED FROM PYTHON SOURCE LINES 608-618 + +.. code-block:: Python + + + A = StatArray(np.abs(np.random.randn(13,100)), name='Variable', units="units") + x = StatArray(np.arange(100),name='x Axis',units = 'mm') + plt.figure() + ax1 = plt.subplot(211) + A.stackedAreaPlot(x=x, axis=1) + plt.subplot(212, sharex=ax1) + _ = A.stackedAreaPlot(x=x, i=np.s_[[1,3,4],:], axis=1, labels=['a','b','c']) + + plt.show() + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_StatArray_022.png + :alt: plot StatArray + :srcset: /examples/Statistics/images/sphx_glr_plot_StatArray_022.png + :class: sphx-glr-single-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 3.186 seconds) + + +.. _sphx_glr_download_examples_Statistics_plot_StatArray.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_StatArray.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_StatArray.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Statistics/plot_histogram_1d.rst.txt b/docs/_sources/examples/Statistics/plot_histogram_1d.rst.txt new file mode 100644 index 00000000..d6a30a68 --- /dev/null +++ b/docs/_sources/examples/Statistics/plot_histogram_1d.rst.txt @@ -0,0 +1,505 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Statistics/plot_histogram_1d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Statistics_plot_histogram_1d.py: + + +Histogram 1D +------------ + +This histogram class allows efficient updating of histograms, plotting and +saving as HDF5 + +.. GENERATED FROM PYTHON SOURCE LINES 10-17 + +.. code-block:: Python + + from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D + import h5py + from geobipy import StatArray + from geobipy import Histogram + import numpy as np + import matplotlib.pyplot as plt + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 18-20 + +Histogram with regular bins ++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 20-24 + +.. code-block:: Python + + + # Create regularly spaced bins + mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm')) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 25-26 + +Set the histogram using the bins, and update + +.. GENERATED FROM PYTHON SOURCE LINES 26-28 + +.. code-block:: Python + + H = Histogram(mesh=mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 29-30 + +We can update the histogram with some new values + +.. GENERATED FROM PYTHON SOURCE LINES 30-43 + +.. code-block:: Python + + H.update(np.random.randn(1000), trim=True) + + # Plot the histogram + plt.figure() + plt.subplot(221) + _ = H.plot() + plt.subplot(222) + _ = H.pdf.bar() + plt.subplot(223) + H.pmf.bar() + plt.subplot(224) + H.cdf().bar() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_001.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 44-45 + +Get the median, and 95% confidence values + +.. GENERATED FROM PYTHON SOURCE LINES 45-53 + +.. code-block:: Python + + print(H.credible_intervals(percent=95.0)) + + plt.figure() + H.plot() + H.plotCredibleIntervals() + H.plotMean() + H.plotMedian() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_002.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + (-0.030000000000000027, -1.95, 1.9499999999999997) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 54-56 + +Histogram with irregular bins ++++++++++++++++++++++++++++++ + +.. GENERATED FROM PYTHON SOURCE LINES 56-61 + +.. code-block:: Python + + + # Create irregularly spaced bins + x = np.cumsum(np.arange(10, dtype=np.float64)) + irregularBins = np.hstack([-x[::-1], x[1:]]) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 62-63 + +Create a named StatArray + +.. GENERATED FROM PYTHON SOURCE LINES 63-66 + +.. code-block:: Python + + edges = StatArray(irregularBins, 'irregular bins') + mesh = RectilinearMesh1D(edges = edges) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 67-68 + +Instantiate the histogram with bin edges + +.. GENERATED FROM PYTHON SOURCE LINES 68-73 + +.. code-block:: Python + + H = Histogram(mesh=mesh) + + # Update the histogram + H.update((np.random.randn(10000)*20.0) - 10.0) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 74-75 + +Plot the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 75-87 + +.. code-block:: Python + + plt.figure() + plt.subplot(211) + _ = H.plot() + plt.subplot(212) + _ = H.plot(normalize=True) + + plt.figure() + H.plot() + H.plotCredibleIntervals() + H.plotMean() + H.plotMedian() + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_003.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_003.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_004.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_004.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 88-89 + +We can plot the histogram as a pcolor plot + +.. GENERATED FROM PYTHON SOURCE LINES 89-92 + +.. code-block:: Python + + plt.figure() + _ = H.pcolor(grid=True, transpose=True) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_005.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 93-96 + +Histogram with linear space entries that are logged internally +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Create some bins spaced logarithmically + +.. GENERATED FROM PYTHON SOURCE LINES 96-98 + +.. code-block:: Python + + mesh = RectilinearMesh1D(edges = StatArray(np.logspace(-5, 3), 'positive bins'), log=10) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 99-100 + +Instantiate the Histogram with log=10 + +.. GENERATED FROM PYTHON SOURCE LINES 100-102 + +.. code-block:: Python + + H = Histogram(mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 103-104 + +The update takes in the numbers in linear space and takes their log=10 + +.. GENERATED FROM PYTHON SOURCE LINES 104-106 + +.. code-block:: Python + + H.update(10.0**(np.random.randn(1000)*2.0), trim=True) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 107-122 + +.. code-block:: Python + + plt.figure() + plt.subplot(211) + _ = H.plot() + + import h5py + with h5py.File('h1d.h5', 'w') as f: + H.toHdf(f, 'h1d') + + with h5py.File('h1d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h1d']) + + plt.subplot(212) + _ = H1.plot() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_1d_006.png + :alt: plot histogram 1d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_1d_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 123-124 + +.. code-block:: Python + + mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm')) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 125-126 + +Set the histogram using the bins, and update + +.. GENERATED FROM PYTHON SOURCE LINES 126-128 + +.. code-block:: Python + + H = Histogram(mesh=mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 129-130 + +We can update the histogram with some new values + +.. GENERATED FROM PYTHON SOURCE LINES 130-156 + +.. code-block:: Python + + H.update(np.random.randn(1000), trim=True) + + import h5py + with h5py.File('h1d.h5', 'w') as f: + H.createHdf(f, 'h1d', add_axis=StatArray(np.arange(3.0), "Name", "Units")) + H.writeHdf(f, 'h1d', index=0) + H.update(np.random.randn(1000), trim=True) + H.writeHdf(f, 'h1d', index=1) + H.update(np.random.randn(1000), trim=True) + H.writeHdf(f, 'h1d', index=2) + + with h5py.File('h1d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h1d']) + H2 = Histogram.fromHdf(f['h1d'], index=0) + H3 = Histogram.fromHdf(f['h1d'], index=1) + H4 = Histogram.fromHdf(f['h1d'], index=2) + + + print(H4.summary) + + # plt.figure() + # plt.subplot(211) + # _ = H1.plot() + # plt.subplot(212) + # _ = H4.plot() + + plt.show() + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Histogram: + mesh: + | RectilinearMesh1D + | Number of Cells: + | | 100 + | Cell Centres: + | | Name: bins (m) 0x7fbfa200e340 + | | Shape: (100,) + | | Values: [-2.97 -2.91 -2.85 ... 2.85 2.91 2.97] + | | Min: -2.9699999999999998 + | | Max: 2.9699999999999998 + | | has_posterior: False + | + | Cell Edges: + | | Name: bins (m) 0x7fbfa200d6c0 + | | Shape: (101,) + | | Values: [-3. -2.94 -2.88 ... 2.88 2.94 3. ] + | | Min: -3.0 + | | Max: 3.0 + | | has_posterior: False + | + | log: + | | None + | relativeTo: + | | Name: 0x7fbfa1fb06c0 + | | Shape: (1,) + | | Values: [0.] + | | Min: 0.0 + | | Max: 0.0 + | | has_posterior: False + | + values: + | Name: Frequency 0x7fbfa200f2c0 + | Shape: (100,) + | Values: [3 2 3 ... 0 2 1] + | Min: 0 + | Max: 87 + | has_posterior: False + + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 1.293 seconds) + + +.. _sphx_glr_download_examples_Statistics_plot_histogram_1d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_histogram_1d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_histogram_1d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Statistics/plot_histogram_2d.rst.txt b/docs/_sources/examples/Statistics/plot_histogram_2d.rst.txt new file mode 100644 index 00000000..1b95a2ce --- /dev/null +++ b/docs/_sources/examples/Statistics/plot_histogram_2d.rst.txt @@ -0,0 +1,787 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Statistics/plot_histogram_2d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Statistics_plot_histogram_2d.py: + + +Histogram 2D +------------ + +This 2D histogram class allows efficient updating of histograms, plotting and +saving as HDF5. + +.. GENERATED FROM PYTHON SOURCE LINES 11-21 + +.. code-block:: Python + + import h5py + import geobipy + from geobipy import StatArray + from geobipy import Histogram + import matplotlib.pyplot as plt + import matplotlib.gridspec as gridspec + from geobipy import RectilinearMesh2D + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 22-23 + +Create some histogram bins in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 23-27 + +.. code-block:: Python + + x = StatArray(np.linspace(-4.0, 4.0, 100), 'Variable 1') + y = StatArray(np.linspace(-4.0, 4.0, 105), 'Variable 2') + + mesh = RectilinearMesh2D(x_edges=x, y_edges=y) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 28-29 + +Instantiate + +.. GENERATED FROM PYTHON SOURCE LINES 29-31 + +.. code-block:: Python + + H = Histogram(mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 32-33 + +Generate some random numbers + +.. GENERATED FROM PYTHON SOURCE LINES 33-36 + +.. code-block:: Python + + a = np.random.randn(1000000) + b = np.random.randn(1000000) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 37-38 + +Update the histogram counts + +.. GENERATED FROM PYTHON SOURCE LINES 38-40 + +.. code-block:: Python + + H.update(a, b) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-59 + +.. code-block:: Python + + plt.figure() + plt.subplot(131) + plt.title("2D Histogram") + _ = H.plot(cmap='gray_r') + plt.subplot(132) + H.pdf.plot(cmap='gray_r') + plt.subplot(133) + H.pmf.plot(cmap='gray_r') + + + plt.figure() + plt.subplot(131) + H.cdf(axis=0).plot() + plt.subplot(132) + H.cdf(axis=1).plot() + plt.subplot(133) + H.cdf().plot() + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_001.png + :alt: 2D Histogram + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_001.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_002.png + :alt: plot histogram 2d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_002.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 60-61 + +We can overlay the histogram with its credible intervals + +.. GENERATED FROM PYTHON SOURCE LINES 61-67 + +.. code-block:: Python + + plt.figure() + plt.title("90% credible intervals overlain") + H.pcolor(cmap='gray_r') + H.plotCredibleIntervals(axis=0, percent=95.0) + _ = H.plotCredibleIntervals(axis=1, percent=95.0) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_003.png + :alt: 90% credible intervals overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 68-69 + +Generate marginal histograms along an axis + +.. GENERATED FROM PYTHON SOURCE LINES 69-72 + +.. code-block:: Python + + h1 = H.marginalize(axis=0) + h2 = H.marginalize(axis=1) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 73-74 + +Note that the names of the variables are automatically displayed + +.. GENERATED FROM PYTHON SOURCE LINES 74-81 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Marginals along each axis") + plt.subplot(121) + h1.plot() + plt.subplot(122) + _ = h2.plot() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_004.png + :alt: Marginals along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 82-84 + +Create a combination plot with marginal histograms. +sphinx_gallery_thumbnail_number = 3 + +.. GENERATED FROM PYTHON SOURCE LINES 84-102 + +.. code-block:: Python + + plt.figure() + gs = gridspec.GridSpec(5, 5) + gs.update(wspace=0.3, hspace=0.3) + ax = [plt.subplot(gs[1:, :4])] + H.pcolor(colorbar = False) + + ax.append(plt.subplot(gs[:1, :4])) + h = H.marginalize(axis=0).plot() + plt.xlabel(''); plt.ylabel('') + plt.xticks([]); plt.yticks([]) + ax[-1].spines["left"].set_visible(False) + + ax.append(plt.subplot(gs[1:, 4:])) + h = H.marginalize(axis=1).plot(transpose=True) + plt.ylabel(''); plt.xlabel('') + plt.yticks([]); plt.xticks([]) + ax[-1].spines["bottom"].set_visible(False) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_005.png + :alt: plot histogram 2d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 103-104 + +Take the mean or median estimates from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 104-107 + +.. code-block:: Python + + mean = H.mean() + median = H.median() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 108-124 + +.. code-block:: Python + + plt.figure(figsize=(9.5, 5)) + plt.suptitle("Mean, median, and credible interval overlain") + ax = plt.subplot(121) + H.pcolor(cmap='gray_r', colorbar=False) + H.plotCredibleIntervals(axis=0) + H.plotMedian(axis=0, color='g') + H.plotMean(axis=0, color='y') + plt.legend() + + plt.subplot(122, sharex=ax, sharey=ax) + H.pcolor(cmap='gray_r', colorbar=False) + H.plotCredibleIntervals(axis=1) + H.plotMedian(axis=1, color='g') + H.plotMean(axis=1, color='y') + plt.legend() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_006.png + :alt: Mean, median, and credible interval overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_006.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 125-126 + +Get the range between credible intervals + +.. GENERATED FROM PYTHON SOURCE LINES 126-128 + +.. code-block:: Python + + H.credible_range(percent=95.0) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + StatArray([5.25252525, 4.04040404, 3.23232323, ..., 4.76767677, + 3.7979798 , 3.39393939]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 129-130 + +We can map the credible range to an opacity or transparency + +.. GENERATED FROM PYTHON SOURCE LINES 130-148 + +.. code-block:: Python + + H.opacity() + H.transparency() + + # H.animate(0, 'test.mp4') + + import h5py + with h5py.File('h2d.h5', 'w') as f: + H.toHdf(f, 'h2d') + + with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + + plt.close('all') + + x = StatArray(5.0 + np.linspace(-4.0, 4.0, 100), 'Variable 1') + y = StatArray(10.0 + np.linspace(-4.0, 4.0, 105), 'Variable 2') + + mesh = RectilinearMesh2D(x_edges=x, x_relative_to=5.0, y_edges=y, y_relative_to=10.0) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 149-150 + +Instantiate + +.. GENERATED FROM PYTHON SOURCE LINES 150-152 + +.. code-block:: Python + + H = Histogram(mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 153-154 + +Generate some random numbers + +.. GENERATED FROM PYTHON SOURCE LINES 154-157 + +.. code-block:: Python + + a = np.random.randn(1000000) + 5.0 + b = np.random.randn(1000000) + 10.0 + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 158-159 + +Update the histogram counts + +.. GENERATED FROM PYTHON SOURCE LINES 159-161 + +.. code-block:: Python + + H.update(a, b) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 162-179 + +.. code-block:: Python + + plt.figure() + plt.subplot(131) + plt.title("2D Histogram") + _ = H.plot(cmap='gray_r') + plt.subplot(132) + H.pdf.plot(cmap='gray_r') + plt.subplot(133) + H.pmf.plot(cmap='gray_r') + + plt.figure() + plt.subplot(131) + H.cdf(axis=0).plot() + plt.subplot(132) + H.cdf(axis=1).plot() + plt.subplot(133) + H.cdf().plot() + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_007.png + :alt: 2D Histogram + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_007.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_008.png + :alt: plot histogram 2d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_008.png + :class: sphx-glr-multi-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + (, , ) + + + +.. GENERATED FROM PYTHON SOURCE LINES 180-181 + +We can overlay the histogram with its credible intervals + +.. GENERATED FROM PYTHON SOURCE LINES 181-191 + +.. code-block:: Python + + plt.figure() + plt.title("90% credible intervals overlain") + H.pcolor(cmap='gray_r') + H.plotCredibleIntervals(axis=0, percent=95.0) + _ = H.plotCredibleIntervals(axis=1, percent=95.0) + + # Generate marginal histograms along an axis + h1 = H.marginalize(axis=0) + h2 = H.marginalize(axis=1) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_009.png + :alt: 90% credible intervals overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_009.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 192-193 + +Note that the names of the variables are automatically displayed + +.. GENERATED FROM PYTHON SOURCE LINES 193-200 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Marginals along each axis") + plt.subplot(121) + h1.plot() + plt.subplot(122) + _ = h2.plot() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_010.png + :alt: Marginals along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_010.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 201-203 + +Create a combination plot with marginal histograms. +sphinx_gallery_thumbnail_number = 3 + +.. GENERATED FROM PYTHON SOURCE LINES 203-221 + +.. code-block:: Python + + plt.figure() + gs = gridspec.GridSpec(5, 5) + gs.update(wspace=0.3, hspace=0.3) + ax = [plt.subplot(gs[1:, :4])] + H.pcolor(colorbar = False) + + ax.append(plt.subplot(gs[:1, :4])) + h = H.marginalize(axis=0).plot() + plt.xlabel(''); plt.ylabel('') + plt.xticks([]); plt.yticks([]) + ax[-1].spines["left"].set_visible(False) + + ax.append(plt.subplot(gs[1:, 4:])) + h = H.marginalize(axis=1).plot(transpose=True) + plt.ylabel(''); plt.xlabel('') + plt.yticks([]); plt.xticks([]) + ax[-1].spines["bottom"].set_visible(False) + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_011.png + :alt: plot histogram 2d + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_011.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 222-223 + +Take the mean or median estimates from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 223-226 + +.. code-block:: Python + + mean = H.mean() + median = H.median() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 227-243 + +.. code-block:: Python + + plt.figure(figsize=(9.5, 5)) + plt.suptitle("Mean, median, and credible interval overlain") + ax = plt.subplot(121) + H.pcolor(cmap='gray_r', colorbar=False) + H.plotCredibleIntervals(axis=0) + H.plotMedian(axis=0, color='g') + H.plotMean(axis=0, color='y') + plt.legend() + + plt.subplot(122, sharex=ax, sharey=ax) + H.pcolor(cmap='gray_r', colorbar=False) + H.plotCredibleIntervals(axis=1) + H.plotMedian(axis=1, color='g') + H.plotMean(axis=1, color='y') + plt.legend() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_012.png + :alt: Mean, median, and credible interval overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_012.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 244-245 + +Get the range between credible intervals + +.. GENERATED FROM PYTHON SOURCE LINES 245-247 + +.. code-block:: Python + + H.credible_range(percent=95.0) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + StatArray([3.39393939, 4.04040404, 3.31313131, ..., 3.95959596, + 3.23232323, 3.31313131]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 248-249 + +We can map the credible range to an opacity or transparency + +.. GENERATED FROM PYTHON SOURCE LINES 249-306 + +.. code-block:: Python + + H.opacity() + H.transparency() + + # # H.animate(0, 'test.mp4') + + with h5py.File('h2d.h5', 'w') as f: + H.toHdf(f, 'h2d') + + with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + + plt.figure(figsize=(9.5, 5)) + plt.suptitle("Mean, median, and credible interval overlain") + ax = plt.subplot(121) + H1.pcolor(cmap='gray_r', colorbar=False) + H1.plotCredibleIntervals(axis=0) + H1.plotMedian(axis=0, color='g') + H1.plotMean(axis=0, color='y') + plt.legend() + + plt.subplot(122, sharex=ax, sharey=ax) + H1.pcolor(cmap='gray_r', colorbar=False) + H1.plotCredibleIntervals(axis=1) + H1.plotMedian(axis=1, color='g') + H1.plotMean(axis=1, color='y') + plt.legend() + + with h5py.File('h2d.h5', 'w') as f: + H.createHdf(f, 'h2d', add_axis=StatArray(np.arange(3.0), name='Easting', units="m")) + for i in range(3): + H.writeHdf(f, 'h2d', index=i) + + with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d'], index=0) + + plt.figure(figsize=(9.5, 5)) + plt.suptitle("Mean, median, and credible interval overlain") + ax = plt.subplot(121) + H1.pcolor(cmap='gray_r', colorbar=False) + H1.plotCredibleIntervals(axis=0) + H1.plotMedian(axis=0, color='g') + H1.plotMean(axis=0, color='y') + plt.legend() + + plt.subplot(122, sharex=ax, sharey=ax) + H1.pcolor(cmap='gray_r', colorbar=False) + H1.plotCredibleIntervals(axis=1) + H1.plotMedian(axis=1, color='g') + H1.plotMean(axis=1, color='y') + plt.legend() + + with h5py.File('h2d.h5', 'r') as f: + H1 = Histogram.fromHdf(f['h2d']) + + H1.pyvista_mesh().save('h3d_read.vtk') + + plt.show() + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_013.png + :alt: Mean, median, and credible interval overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_013.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_2d_014.png + :alt: Mean, median, and credible interval overlain + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_2d_014.png + :class: sphx-glr-multi-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 14.930 seconds) + + +.. _sphx_glr_download_examples_Statistics_plot_histogram_2d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_histogram_2d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_histogram_2d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Statistics/plot_histogram_3d.rst.txt b/docs/_sources/examples/Statistics/plot_histogram_3d.rst.txt new file mode 100644 index 00000000..ca27a667 --- /dev/null +++ b/docs/_sources/examples/Statistics/plot_histogram_3d.rst.txt @@ -0,0 +1,463 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/Statistics/plot_histogram_3d.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_Statistics_plot_histogram_3d.py: + + +Histogram 3D +------------ + +This 3D histogram class allows efficient updating of histograms, plotting and +saving as HDF5. + +.. GENERATED FROM PYTHON SOURCE LINES 11-19 + +.. code-block:: Python + + import geobipy + from geobipy import StatArray + from geobipy import Histogram + import matplotlib.pyplot as plt + from geobipy import RectilinearMesh3D + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 20-21 + +Create some histogram bins in x and y + +.. GENERATED FROM PYTHON SOURCE LINES 21-27 + +.. code-block:: Python + + x = StatArray(np.linspace(-4.0, 4.0, 11), 'Variable 1') + y = StatArray(np.linspace(-4.0, 4.0, 21), 'Variable 2') + z = StatArray(np.linspace(-4.0, 4.0, 31), 'Variable 3') + + mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 28-29 + +Instantiate + +.. GENERATED FROM PYTHON SOURCE LINES 29-31 + +.. code-block:: Python + + H = Histogram(mesh=mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 32-33 + +Generate some random numbers + +.. GENERATED FROM PYTHON SOURCE LINES 33-39 + +.. code-block:: Python + + a = np.random.randn(100000) + b = np.random.randn(100000) + c = np.random.randn(100000) + # x = np.asarray([a, b, c]) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 40-41 + +Update the histogram counts + +.. GENERATED FROM PYTHON SOURCE LINES 41-43 + +.. code-block:: Python + + H.update(a, b, c) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 44-51 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Slice half way along each dimension") + for axis in range(3): + plt.subplot(1, 3, axis+1) + s = [5 if i == axis else np.s_[:] for i in range(3)] + _ = H[tuple(s)].pcolor(cmap='gray_r') + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_001.png + :alt: Slice half way along each dimension + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 52-53 + +Generate marginal histograms along an axis + +.. GENERATED FROM PYTHON SOURCE LINES 53-60 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Marginals along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.marginalize(axis=axis).plot() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_002.png + :alt: Marginals along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 61-62 + +Take the mean estimate from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 62-68 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Mean along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.mean(axis=axis).pcolor() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_003.png + :alt: Mean along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 69-70 + +Take the median estimate from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 70-100 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Median along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.median(axis=axis).pcolor() + + # #%% + # # We can map the credible range to an opacity or transparency + # H.opacity() + # H.transparency() + + H.animate(0, 'test.mp4') + + H.to_vtk('h3d.vtk') + + + + + # Create some histogram bins in x and y + xx, yy = np.meshgrid(mesh.z.centres, mesh.y.centres) + x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re") + + xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres) + y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re") + + xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres) + z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re") + + mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re) + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_004.png + :alt: Median along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_004.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_005.png + :alt: 3.60 + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_005.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 101-102 + +Instantiate + +.. GENERATED FROM PYTHON SOURCE LINES 102-104 + +.. code-block:: Python + + H = Histogram(mesh=mesh) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 105-106 + +Generate some random numbers + +.. GENERATED FROM PYTHON SOURCE LINES 106-111 + +.. code-block:: Python + + a = np.random.randn(100000) + b = np.random.randn(100000) + c = np.random.randn(100000) + # x = np.asarray([a, b, c]) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 112-113 + +Update the histogram counts + +.. GENERATED FROM PYTHON SOURCE LINES 113-115 + +.. code-block:: Python + + H.update(a, b, c) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 116-123 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Slice half way along each dimension") + for axis in range(3): + plt.subplot(1, 3, axis+1) + s = [5 if i == axis else np.s_[:] for i in range(3)] + _ = H[tuple(s)].pcolor(cmap='gray_r') + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_006.png + :alt: Slice half way along each dimension + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 124-125 + +Generate marginal histograms along an axis + +.. GENERATED FROM PYTHON SOURCE LINES 125-132 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Marginals along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.marginalize(axis=axis).plot() + + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_007.png + :alt: Marginals along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_007.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 133-134 + +Take the mean estimate from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 134-140 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Mean along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.mean(axis=axis).pcolor() + + + + +.. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_008.png + :alt: Mean along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_008.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 141-142 + +Take the median estimate from the histogram + +.. GENERATED FROM PYTHON SOURCE LINES 142-158 + +.. code-block:: Python + + plt.figure() + plt.suptitle("Median along each axis") + for axis in range(3): + plt.subplot(1, 3, axis+1) + _ = H.median(axis=axis).pcolor() + + # #%% + # # We can map the credible range to an opacity or transparency + # H.opacity() + # H.transparency() + + H.animate(0, 'test.mp4') + + plt.show() + + H.to_vtk('h3d.vtk') + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_009.png + :alt: Median along each axis + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_009.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/Statistics/images/sphx_glr_plot_histogram_3d_010.png + :alt: 3.60 + :srcset: /examples/Statistics/images/sphx_glr_plot_histogram_3d_010.png + :class: sphx-glr-multi-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 8.325 seconds) + + +.. _sphx_glr_download_examples_Statistics_plot_histogram_3d.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: plot_histogram_3d.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: plot_histogram_3d.py ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/Statistics/sg_execution_times.rst.txt b/docs/_sources/examples/Statistics/sg_execution_times.rst.txt new file mode 100644 index 00000000..8a3a3e5c --- /dev/null +++ b/docs/_sources/examples/Statistics/sg_execution_times.rst.txt @@ -0,0 +1,46 @@ + +:orphan: + +.. _sphx_glr_examples_Statistics_sg_execution_times: + + +Computation times +================= +**00:27.735** total execution time for 4 files **from examples/Statistics**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_2d.py` (``plot_histogram_2d.py``) + - 00:14.930 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_3d.py` (``plot_histogram_3d.py``) + - 00:08.325 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_StatArray.py` (``plot_StatArray.py``) + - 00:03.186 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_1d.py` (``plot_histogram_1d.py``) + - 00:01.293 + - 0.0 diff --git a/docs/_sources/examples/index.rst.txt b/docs/_sources/examples/index.rst.txt new file mode 100644 index 00000000..56d3408a --- /dev/null +++ b/docs/_sources/examples/index.rst.txt @@ -0,0 +1,580 @@ +:orphan: + +######## +Examples +######## + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +Distributions +============= + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Distributions/images/thumb/sphx_glr_plot_distributions_thumb.png + :alt: + + :ref:`sphx_glr_examples_Distributions_plot_distributions.py` + +.. raw:: html + +
Distribution Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Distributions/plot_distributions + +Statistics +========== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_1d.py` + +.. raw:: html + +
Histogram 1D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_2d.py` + +.. raw:: html + +
Histogram 2D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_histogram_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_histogram_3d.py` + +.. raw:: html + +
Histogram 3D
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Statistics/images/thumb/sphx_glr_plot_StatArray_thumb.png + :alt: + + :ref:`sphx_glr_examples_Statistics_plot_StatArray.py` + +.. raw:: html + +
StatArray Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Statistics/plot_histogram_1d + /examples/Statistics/plot_histogram_2d + /examples/Statistics/plot_histogram_3d + /examples/Statistics/plot_StatArray + +Meshes +====== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_1d.py` + +.. raw:: html + +
1D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_2d.py` + +.. raw:: html + +
2D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Meshes/images/thumb/sphx_glr_plot_rectilinear_mesh_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_3d.py` + +.. raw:: html + +
3D Rectilinear Mesh
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Meshes/plot_rectilinear_mesh_1d + /examples/Meshes/plot_rectilinear_mesh_2d + /examples/Meshes/plot_rectilinear_mesh_3d + +Models +====== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_1d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_1d.py` + +.. raw:: html + +
1D Model with an infinite halfspace
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_2d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_2d.py` + +.. raw:: html + +
2D Rectilinear Model
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Models/images/thumb/sphx_glr_plot_model_3d_thumb.png + :alt: + + :ref:`sphx_glr_examples_Models_plot_model_3d.py` + +.. raw:: html + +
3D Rectilinear Model
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Models/plot_model_1d + /examples/Models/plot_model_2d + /examples/Models/plot_model_3d + +Data +==== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +Datapoints +========== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_resolve_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_resolve_datapoint.py` + +.. raw:: html + +
Frequency domain datapoint
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_skytem_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_skytem_datapoint.py` + +.. raw:: html + +
Skytem Datapoint Class
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Datapoints/images/thumb/sphx_glr_plot_tempest_datapoint_thumb.png + :alt: + + :ref:`sphx_glr_examples_Datapoints_plot_tempest_datapoint.py` + +.. raw:: html + +
Tempest Datapoint Class
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Datapoints/plot_resolve_datapoint + /examples/Datapoints/plot_skytem_datapoint + /examples/Datapoints/plot_tempest_datapoint + +1D Inference +============ + +There are a couple of ways to run an inference using geobipy, the first is via command line using + +.. code-block:: bash + + geobipy skytem_options.py + +The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples) + + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_1D/images/thumb/sphx_glr_plot_inference_1d_resolve_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_resolve.py` + +.. raw:: html + +
Running GeoBIPy to invert Resolve data
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_1D/images/thumb/sphx_glr_plot_inference_1d_skytem_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_skytem.py` + +.. raw:: html + +
Running GeoBIPy to invert Skytem data
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_1D/images/thumb/sphx_glr_plot_inference_1d_tempest_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_tempest.py` + +.. raw:: html + +
Running GeoBIPy to invert Tempest data
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Inference_1D/plot_inference_1d_resolve + /examples/Inference_1D/plot_inference_1d_skytem + /examples/Inference_1D/plot_inference_1d_tempest + +Inference 2D +============ + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_2D/images/thumb/sphx_glr_plot_inference_2d_resolve_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_resolve.py` + +.. raw:: html + +
2D Posterior analysis of Resolve inference
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_2D/images/thumb/sphx_glr_plot_inference_2d_skytem_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_skytem.py` + +.. raw:: html + +
2D Posterior analysis of Skytem inference
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/Inference_2D/images/thumb/sphx_glr_plot_inference_2d_tempest_thumb.png + :alt: + + :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_tempest.py` + +.. raw:: html + +
2D Posterior analysis of Tempest inference
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/Inference_2D/plot_inference_2d_resolve + /examples/Inference_2D/plot_inference_2d_skytem + /examples/Inference_2D/plot_inference_2d_tempest + +HDF 5 +===== + + +.. raw:: html + +
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /examples/HDF5/images/thumb/sphx_glr_hdf5_thumb.png + :alt: + + :ref:`sphx_glr_examples_HDF5_hdf5.py` + +.. raw:: html + +
Using HDF5 within GeoBIPy
+
+ + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /examples/HDF5/hdf5 + + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-gallery + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download all examples in Python source code: examples_python.zip ` + + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download all examples in Jupyter notebooks: examples_jupyter.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ diff --git a/docs/_sources/examples/sg_execution_times.rst.txt b/docs/_sources/examples/sg_execution_times.rst.txt new file mode 100644 index 00000000..f7a0c03b --- /dev/null +++ b/docs/_sources/examples/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from examples**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt new file mode 100644 index 00000000..b8d482f4 --- /dev/null +++ b/docs/_sources/index.rst.txt @@ -0,0 +1,30 @@ +############################################################ +Welcome to GeoBIPy: Geophysical Bayesian Inference in Python +############################################################ + +This package uses a Bayesian formulation and Markov chain Monte Carlo sampling methods to +derive posterior distributions of subsurface and measured data properties. +The current implementation is applied to time and frequency domain electromagnetic data. +Application outside of these data types is in development. + +Currently there are two types of data that we have implemented; frequency domain electromagnetic data, +and time domain electromagnetic data. +The package comes with a frequency domain forward modeller, but it does not come with a time domain forward modeller. +See the section :ref:`Installing_time_domain_forward_modeller` for more information. + +Using GeoBIPy on Yeti +~~~~~~~~~~~~~~~~~~~~~ + +There is no need to install GeoBIPy on Yeti. +Simply type "module load python/geobipy" for the serial version of the code, mainly used for plotting results, +or "module load python/pGeobipy" for a parallel enabled version. + +`Codebase is here! `_ + +.. toctree:: + :maxdepth: 2 + + content/getting_started/getting_started + content/api/api + examples/index + diff --git a/docs/_sources/sg_execution_times.rst.txt b/docs/_sources/sg_execution_times.rst.txt new file mode 100644 index 00000000..fd49f5ef --- /dev/null +++ b/docs/_sources/sg_execution_times.rst.txt @@ -0,0 +1,97 @@ + +:orphan: + +.. _sphx_glr_sg_execution_times: + + +Computation times +================= +**03:16.574** total execution time for 21 files **from all galleries**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_tempest.py` (``examples/Inference_1D/plot_inference_1d_tempest.py``) + - 01:22.225 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_skytem.py` (``examples/Inference_1D/plot_inference_1d_skytem.py``) + - 01:06.343 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_resolve.py` (``examples/Inference_2D/plot_inference_2d_resolve.py``) + - 00:24.877 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_tempest.py` (``examples/Inference_2D/plot_inference_2d_tempest.py``) + - 00:12.999 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_2D_plot_inference_2d_skytem.py` (``examples/Inference_2D/plot_inference_2d_skytem.py``) + - 00:10.130 + - 0.0 + * - :ref:`sphx_glr_examples_Datapoints_plot_resolve_datapoint.py` (``examples/Datapoints/plot_resolve_datapoint.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Datapoints_plot_skytem_datapoint.py` (``examples/Datapoints/plot_skytem_datapoint.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Datapoints_plot_tempest_datapoint.py` (``examples/Datapoints/plot_tempest_datapoint.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Distributions_plot_distributions.py` (``examples/Distributions/plot_distributions.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_HDF5_hdf5.py` (``examples/HDF5/hdf5.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Inference_1D_plot_inference_1d_resolve.py` (``examples/Inference_1D/plot_inference_1d_resolve.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_1d.py` (``examples/Meshes/plot_rectilinear_mesh_1d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_2d.py` (``examples/Meshes/plot_rectilinear_mesh_2d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Meshes_plot_rectilinear_mesh_3d.py` (``examples/Meshes/plot_rectilinear_mesh_3d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Models_plot_model_1d.py` (``examples/Models/plot_model_1d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Models_plot_model_2d.py` (``examples/Models/plot_model_2d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Models_plot_model_3d.py` (``examples/Models/plot_model_3d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_StatArray.py` (``examples/Statistics/plot_StatArray.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_1d.py` (``examples/Statistics/plot_histogram_1d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_2d.py` (``examples/Statistics/plot_histogram_2d.py``) + - 00:00.000 + - 0.0 + * - :ref:`sphx_glr_examples_Statistics_plot_histogram_3d.py` (``examples/Statistics/plot_histogram_3d.py``) + - 00:00.000 + - 0.0 diff --git a/docs/_static/_sphinx_javascript_frameworks_compat.js b/docs/_static/_sphinx_javascript_frameworks_compat.js new file mode 100644 index 00000000..81415803 --- /dev/null +++ b/docs/_static/_sphinx_javascript_frameworks_compat.js @@ -0,0 +1,123 @@ +/* Compatability shim for jQuery and underscores.js. + * + * Copyright Sphinx contributors + * Released under the two clause BSD licence + */ + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} diff --git a/docs/_static/basic.css b/docs/_static/basic.css new file mode 100644 index 00000000..30fee9d0 --- /dev/null +++ b/docs/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/docs/_static/binder_badge_logo.svg b/docs/_static/binder_badge_logo.svg new file mode 100644 index 00000000..327f6b63 --- /dev/null +++ b/docs/_static/binder_badge_logo.svg @@ -0,0 +1 @@ + launchlaunchbinderbinder \ No newline at end of file diff --git a/docs/_static/broken_example.png b/docs/_static/broken_example.png new file mode 100644 index 00000000..4fea24e7 Binary files /dev/null and b/docs/_static/broken_example.png differ diff --git a/docs/_static/css/badge_only.css b/docs/_static/css/badge_only.css new file mode 100644 index 00000000..c718cee4 --- /dev/null +++ b/docs/_static/css/badge_only.css @@ -0,0 +1 @@ +.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/docs/_static/css/fonts/Roboto-Slab-Bold.woff b/docs/_static/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 00000000..6cb60000 Binary files /dev/null and b/docs/_static/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 b/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 00000000..7059e231 Binary files /dev/null and b/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Regular.woff b/docs/_static/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 00000000..f815f63f Binary files /dev/null and b/docs/_static/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 b/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 00000000..f2c76e5b Binary files /dev/null and b/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.eot b/docs/_static/css/fonts/fontawesome-webfont.eot new file mode 100644 index 00000000..e9f60ca9 Binary files /dev/null and b/docs/_static/css/fonts/fontawesome-webfont.eot differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.svg b/docs/_static/css/fonts/fontawesome-webfont.svg new file mode 100644 index 00000000..855c845e --- /dev/null +++ b/docs/_static/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/css/fonts/fontawesome-webfont.ttf b/docs/_static/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 00000000..35acda2f Binary files /dev/null and b/docs/_static/css/fonts/fontawesome-webfont.ttf differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.woff b/docs/_static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 00000000..400014a4 Binary files /dev/null and b/docs/_static/css/fonts/fontawesome-webfont.woff differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.woff2 b/docs/_static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 00000000..4d13fc60 Binary files /dev/null and b/docs/_static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/docs/_static/css/fonts/lato-bold-italic.woff b/docs/_static/css/fonts/lato-bold-italic.woff new file mode 100644 index 00000000..88ad05b9 Binary files /dev/null and b/docs/_static/css/fonts/lato-bold-italic.woff differ diff --git a/docs/_static/css/fonts/lato-bold-italic.woff2 b/docs/_static/css/fonts/lato-bold-italic.woff2 new file mode 100644 index 00000000..c4e3d804 Binary files /dev/null and b/docs/_static/css/fonts/lato-bold-italic.woff2 differ diff --git a/docs/_static/css/fonts/lato-bold.woff b/docs/_static/css/fonts/lato-bold.woff new file mode 100644 index 00000000..c6dff51f Binary files /dev/null and b/docs/_static/css/fonts/lato-bold.woff differ diff --git a/docs/_static/css/fonts/lato-bold.woff2 b/docs/_static/css/fonts/lato-bold.woff2 new file mode 100644 index 00000000..bb195043 Binary files /dev/null and b/docs/_static/css/fonts/lato-bold.woff2 differ diff --git a/docs/_static/css/fonts/lato-normal-italic.woff b/docs/_static/css/fonts/lato-normal-italic.woff new file mode 100644 index 00000000..76114bc0 Binary files /dev/null and b/docs/_static/css/fonts/lato-normal-italic.woff differ diff --git a/docs/_static/css/fonts/lato-normal-italic.woff2 b/docs/_static/css/fonts/lato-normal-italic.woff2 new file mode 100644 index 00000000..3404f37e Binary files /dev/null and b/docs/_static/css/fonts/lato-normal-italic.woff2 differ diff --git a/docs/_static/css/fonts/lato-normal.woff b/docs/_static/css/fonts/lato-normal.woff new file mode 100644 index 00000000..ae1307ff Binary files /dev/null and b/docs/_static/css/fonts/lato-normal.woff differ diff --git a/docs/_static/css/fonts/lato-normal.woff2 b/docs/_static/css/fonts/lato-normal.woff2 new file mode 100644 index 00000000..3bf98433 Binary files /dev/null and b/docs/_static/css/fonts/lato-normal.woff2 differ diff --git a/docs/_static/css/theme.css b/docs/_static/css/theme.css new file mode 100644 index 00000000..19a446a0 --- /dev/null +++ b/docs/_static/css/theme.css @@ -0,0 +1,4 @@ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js new file mode 100644 index 00000000..d06a71d7 --- /dev/null +++ b/docs/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js new file mode 100644 index 00000000..89435bb4 --- /dev/null +++ b/docs/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '1.0.0', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/_static/file.png b/docs/_static/file.png new file mode 100644 index 00000000..a858a410 Binary files /dev/null and b/docs/_static/file.png differ diff --git a/docs/_static/graphviz.css b/docs/_static/graphviz.css new file mode 100644 index 00000000..8d81c02e --- /dev/null +++ b/docs/_static/graphviz.css @@ -0,0 +1,19 @@ +/* + * graphviz.css + * ~~~~~~~~~~~~ + * + * Sphinx stylesheet -- graphviz extension. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +img.graphviz { + border: 0; + max-width: 100%; +} + +object.graphviz { + max-width: 100%; +} diff --git a/docs/_static/jquery.js b/docs/_static/jquery.js new file mode 100644 index 00000000..c4c6022f --- /dev/null +++ b/docs/_static/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/docs/_static/js/html5shiv.min.js b/docs/_static/js/html5shiv.min.js new file mode 100644 index 00000000..cd1c674f --- /dev/null +++ b/docs/_static/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/docs/_static/js/theme.js b/docs/_static/js/theme.js new file mode 100644 index 00000000..1fddb6ee --- /dev/null +++ b/docs/_static/js/theme.js @@ -0,0 +1 @@ +!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t + +launchlaunchlitelite \ No newline at end of file diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js new file mode 100644 index 00000000..250f5665 --- /dev/null +++ b/docs/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, is available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/docs/_static/minus.png b/docs/_static/minus.png new file mode 100644 index 00000000..d96755fd Binary files /dev/null and b/docs/_static/minus.png differ diff --git a/docs/_static/no_image.png b/docs/_static/no_image.png new file mode 100644 index 00000000..8c2d48d5 Binary files /dev/null and b/docs/_static/no_image.png differ diff --git a/docs/_static/plus.png b/docs/_static/plus.png new file mode 100644 index 00000000..7107cec9 Binary files /dev/null and b/docs/_static/plus.png differ diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css new file mode 100644 index 00000000..691aeb82 --- /dev/null +++ b/docs/_static/pygments.css @@ -0,0 +1,74 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333333 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js new file mode 100644 index 00000000..7918c3fa --- /dev/null +++ b/docs/_static/searchtools.js @@ -0,0 +1,574 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/docs/_static/sg_gallery-binder.css b/docs/_static/sg_gallery-binder.css new file mode 100644 index 00000000..420005d2 --- /dev/null +++ b/docs/_static/sg_gallery-binder.css @@ -0,0 +1,11 @@ +/* CSS for binder integration */ + +div.binder-badge { + margin: 1em auto; + vertical-align: middle; +} + +div.lite-badge { + margin: 1em auto; + vertical-align: middle; +} diff --git a/docs/_static/sg_gallery-dataframe.css b/docs/_static/sg_gallery-dataframe.css new file mode 100644 index 00000000..fac74c43 --- /dev/null +++ b/docs/_static/sg_gallery-dataframe.css @@ -0,0 +1,47 @@ +/* Pandas dataframe css */ +/* Taken from: https://github.com/spatialaudio/nbsphinx/blob/fb3ba670fc1ba5f54d4c487573dbc1b4ecf7e9ff/src/nbsphinx.py#L587-L619 */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-tr-odd-color: #f5f5f5; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-tr-odd-color: #373737; + --sg-tr-hover-color: rgba(30, 81, 122, 0.2); +} + +table.dataframe { + border: none !important; + border-collapse: collapse; + border-spacing: 0; + border-color: transparent; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; + width: auto; +} +table.dataframe thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +table.dataframe tr, +table.dataframe th, +table.dataframe td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +table.dataframe th { + font-weight: bold; +} +table.dataframe tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +table.dataframe tbody tr:hover { + background: var(--sg-tr-hover-color); +} diff --git a/docs/_static/sg_gallery-rendered-html.css b/docs/_static/sg_gallery-rendered-html.css new file mode 100644 index 00000000..93dc2ffb --- /dev/null +++ b/docs/_static/sg_gallery-rendered-html.css @@ -0,0 +1,224 @@ +/* Adapted from notebook/static/style/style.min.css */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-background-color: #ffffff; + --sg-code-background-color: #eff0f1; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #f5f5f5; +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-background-color: #121212; + --sg-code-background-color: #2f2f30; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #1f1f1f; +} + +.rendered_html { + color: var(--sg-text-color); + /* any extras will just be numbers: */ +} +.rendered_html em { + font-style: italic; +} +.rendered_html strong { + font-weight: bold; +} +.rendered_html u { + text-decoration: underline; +} +.rendered_html :link { + text-decoration: underline; +} +.rendered_html :visited { + text-decoration: underline; +} +.rendered_html h1 { + font-size: 185.7%; + margin: 1.08em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h2 { + font-size: 157.1%; + margin: 1.27em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h3 { + font-size: 128.6%; + margin: 1.55em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h4 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h5 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h6 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h1:first-child { + margin-top: 0.538em; +} +.rendered_html h2:first-child { + margin-top: 0.636em; +} +.rendered_html h3:first-child { + margin-top: 0.777em; +} +.rendered_html h4:first-child { + margin-top: 1em; +} +.rendered_html h5:first-child { + margin-top: 1em; +} +.rendered_html h6:first-child { + margin-top: 1em; +} +.rendered_html ul:not(.list-inline), +.rendered_html ol:not(.list-inline) { + padding-left: 2em; +} +.rendered_html ul { + list-style: disc; +} +.rendered_html ul ul { + list-style: square; + margin-top: 0; +} +.rendered_html ul ul ul { + list-style: circle; +} +.rendered_html ol { + list-style: decimal; +} +.rendered_html ol ol { + list-style: upper-alpha; + margin-top: 0; +} +.rendered_html ol ol ol { + list-style: lower-alpha; +} +.rendered_html ol ol ol ol { + list-style: lower-roman; +} +.rendered_html ol ol ol ol ol { + list-style: decimal; +} +.rendered_html * + ul { + margin-top: 1em; +} +.rendered_html * + ol { + margin-top: 1em; +} +.rendered_html hr { + color: var(--sg-text-color); + background-color: var(--sg-text-color); +} +.rendered_html pre { + margin: 1em 2em; + padding: 0px; + background-color: var(--sg-background-color); +} +.rendered_html code { + background-color: var(--sg-code-background-color); +} +.rendered_html p code { + padding: 1px 5px; +} +.rendered_html pre code { + background-color: var(--sg-background-color); +} +.rendered_html pre, +.rendered_html code { + border: 0; + color: var(--sg-text-color); + font-size: 100%; +} +.rendered_html blockquote { + margin: 1em 2em; +} +.rendered_html table { + margin-left: auto; + margin-right: auto; + border: none; + border-collapse: collapse; + border-spacing: 0; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; +} +.rendered_html thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +.rendered_html tr, +.rendered_html th, +.rendered_html td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +.rendered_html th { + font-weight: bold; +} +.rendered_html tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +.rendered_html tbody tr:hover { + color: var(--sg-text-color); + background: var(--sg-tr-hover-color); +} +.rendered_html * + table { + margin-top: 1em; +} +.rendered_html p { + text-align: left; +} +.rendered_html * + p { + margin-top: 1em; +} +.rendered_html img { + display: block; + margin-left: auto; + margin-right: auto; +} +.rendered_html * + img { + margin-top: 1em; +} +.rendered_html img, +.rendered_html svg { + max-width: 100%; + height: auto; +} +.rendered_html img.unconfined, +.rendered_html svg.unconfined { + max-width: none; +} +.rendered_html .alert { + margin-bottom: initial; +} +.rendered_html * + .alert { + margin-top: 1em; +} +[dir="rtl"] .rendered_html p { + text-align: right; +} diff --git a/docs/_static/sg_gallery.css b/docs/_static/sg_gallery.css new file mode 100644 index 00000000..72227837 --- /dev/null +++ b/docs/_static/sg_gallery.css @@ -0,0 +1,342 @@ +/* +Sphinx-Gallery has compatible CSS to fix default sphinx themes +Tested for Sphinx 1.3.1 for all themes: default, alabaster, sphinxdoc, +scrolls, agogo, traditional, nature, haiku, pyramid +Tested for Read the Docs theme 0.1.7 */ + +/* Define light colors */ +:root, html[data-theme="light"], body[data-theme="light"]{ + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); +} +@media(prefers-color-scheme: light) { + :root[data-theme="auto"], html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); + } +} + +html[data-theme="dark"], body[data-theme="dark"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); +} +@media(prefers-color-scheme: dark){ + html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); + } +} + +.sphx-glr-thumbnails { + width: 100%; + margin: 0px 0px 20px 0px; + + /* align thumbnails on a grid */ + justify-content: space-between; + display: grid; + /* each grid column should be at least 160px (this will determine + the actual number of columns) and then take as much of the + remaining width as possible */ + grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); + gap: 15px; +} +.sphx-glr-thumbnails .toctree-wrapper { + /* hide empty toctree divs added to the DOM + by sphinx even though the toctree is hidden + (they would fill grid places with empty divs) */ + display: none; +} +.sphx-glr-thumbcontainer { + background: transparent; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + box-shadow: 0 0 10px var(--sg-thumb-box-shadow-color); + + /* useful to absolutely position link in div */ + position: relative; + + /* thumbnail width should include padding and borders + and take all available space */ + box-sizing: border-box; + width: 100%; + padding: 10px; + border: 1px solid transparent; + + /* align content in thumbnail */ + display: flex; + flex-direction: column; + align-items: center; + gap: 7px; +} +.sphx-glr-thumbcontainer p { + position: absolute; + top: 0; + left: 0; +} +.sphx-glr-thumbcontainer p, +.sphx-glr-thumbcontainer p a { + /* link should cover the whole thumbnail div */ + width: 100%; + height: 100%; +} +.sphx-glr-thumbcontainer p a span { + /* text within link should be masked + (we are just interested in the href) */ + display: none; +} +.sphx-glr-thumbcontainer:hover { + border: 1px solid; + border-color: var(--sg-thumb-hover-border); + cursor: pointer; +} +.sphx-glr-thumbcontainer a.internal { + bottom: 0; + display: block; + left: 0; + box-sizing: border-box; + padding: 150px 10px 0; + position: absolute; + right: 0; + top: 0; +} +/* Next one is to avoid Sphinx traditional theme to cover all the +thumbnail with its default link Background color */ +.sphx-glr-thumbcontainer a.internal:hover { + background-color: transparent; +} + +.sphx-glr-thumbcontainer p { + margin: 0 0 0.1em 0; +} +.sphx-glr-thumbcontainer .figure { + margin: 10px; + width: 160px; +} +.sphx-glr-thumbcontainer img { + display: inline; + max-height: 112px; + max-width: 160px; +} +.sphx-glr-thumbcontainer[tooltip]:hover:after { + background: var(--sg-tooltip-background); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: var(--sg-tooltip-foreground); + content: attr(tooltip); + padding: 10px; + z-index: 98; + width: 100%; + height: 100%; + position: absolute; + pointer-events: none; + top: 0; + box-sizing: border-box; + overflow: hidden; + backdrop-filter: blur(3px); +} + +.sphx-glr-script-out { + color: var(--sg-script-out); + display: flex; + gap: 0.5em; +} +.sphx-glr-script-out::before { + content: "Out:"; + /* These numbers come from the pre style in the pydata sphinx theme. This + * turns out to match perfectly on the rtd theme, but be a bit too low for + * the pydata sphinx theme. As I could not find a dimension to use that was + * scaled the same way, I just picked one option that worked pretty close for + * both. */ + line-height: 1.4; + padding-top: 10px; +} +.sphx-glr-script-out .highlight { + background-color: transparent; + /* These options make the div expand... */ + flex-grow: 1; + /* ... but also keep it from overflowing its flex container. */ + overflow: auto; +} +.sphx-glr-script-out .highlight pre { + background-color: var(--sg-script-pre); + border: 0; + max-height: 30em; + overflow: auto; + padding-left: 1ex; + /* This margin is necessary in the pydata sphinx theme because pre has a box + * shadow which would be clipped by the overflow:auto in the parent div + * above. */ + margin: 2px; + word-break: break-word; +} +.sphx-glr-script-out + p { + margin-top: 1.8em; +} +blockquote.sphx-glr-script-out { + margin-left: 0pt; +} +.sphx-glr-script-out.highlight-pytb .highlight pre { + color: var(--sg-pytb-foreground); + background-color: var(--sg-pytb-background); + border: 1px solid var(--sg-pytb-border-color); + margin-top: 10px; + padding: 7px; +} + +div.sphx-glr-footer { + text-align: center; +} + +div.sphx-glr-download { + margin: 1em auto; + vertical-align: middle; +} + +div.sphx-glr-download a { + background-color: var(--sg-download-a-background-color); + background-image: var(--sg-download-a-background-image); + border-radius: 4px; + border: 1px solid var(--sg-download-a-border-color); + color: var(--sg-download-a-color); + display: inline-block; + font-weight: bold; + padding: 1ex; + text-align: center; +} + +div.sphx-glr-download code.download { + display: inline-block; + white-space: normal; + word-break: normal; + overflow-wrap: break-word; + /* border and background are given by the enclosing 'a' */ + border: none; + background: none; +} + +div.sphx-glr-download a:hover { + box-shadow: inset 0 1px 0 var(--sg-download-a-hover-box-shadow-1), 0 1px 5px var(--sg-download-a-hover-box-shadow-2); + text-decoration: none; + background-image: none; + background-color: var(--sg-download-a-hover-background-color); +} + +.sphx-glr-example-title:target::before { + display: block; + content: ""; + margin-top: -50px; + height: 50px; + visibility: hidden; +} + +ul.sphx-glr-horizontal { + list-style: none; + padding: 0; +} +ul.sphx-glr-horizontal li { + display: inline; +} +ul.sphx-glr-horizontal img { + height: auto !important; +} + +.sphx-glr-single-img { + margin: auto; + display: block; + max-width: 100%; +} + +.sphx-glr-multi-img { + max-width: 42%; + height: auto; +} + +div.sphx-glr-animation { + margin: auto; + display: block; + max-width: 100%; +} +div.sphx-glr-animation .animation { + display: block; +} + +p.sphx-glr-signature a.reference.external { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 3px; + font-size: 75%; + text-align: right; + margin-left: auto; + display: table; +} + +.sphx-glr-clear { + clear: both; +} + +a.sphx-glr-backref-instance { + text-decoration: none; +} diff --git a/docs/_static/sphinx_highlight.js b/docs/_static/sphinx_highlight.js new file mode 100644 index 00000000..8a96c69a --- /dev/null +++ b/docs/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/content/api/api.html b/docs/content/api/api.html new file mode 100644 index 00000000..fc9c9c2b --- /dev/null +++ b/docs/content/api/api.html @@ -0,0 +1,131 @@ + + + + + + + API — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

API

+

The source code is split into two types of files. Those that contain a set of python functions, and those that contain classes.

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/HDF.html b/docs/content/api/base/HDF.html new file mode 100644 index 00000000..c98e0b4b --- /dev/null +++ b/docs/content/api/base/HDF.html @@ -0,0 +1,287 @@ + + + + + + + Heirarchical Data Format (HDF) — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Heirarchical Data Format (HDF)

+
+
+geobipy.src.base.HDF.hdfRead.find(filename, tag)
+

Find the locations of all groups with ‘tag’ in their path.

+
+
Parameters:
+
    +
  • filename (str) – HDF5 file name

  • +
  • tag (str) – Sub string that appears in the group name.

  • +
+
+
Returns:
+

out – List of paths into the HDF5 file.

+
+
Return type:
+

list

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfRead.readKeyFromFile(h5obj, fName, groupName, key, index=None, **kwargs)
+

Reads in the keys from a file

+

Iterates over group names and keys and reads them from a HDF5 file

+
+
Parameters:
+
    +
  • h5obj (h5py._hl.files.File or h5py._hl.group.Group) – An opened hdf5 handle or a h5py group object

  • +
  • fName (str) – The path and/or file name to the file that was opened

  • +
  • groupName (str or list of str) – The group(s) path within the hdf5 file to read from. i.e. ‘/group1/group1a’

  • +
  • key (str or list of str) – The key(s) in the group to read

  • +
  • index (slice, optional) – Specifies the index’th entry of the data to return. If the group was created using a createHDF procedure in parallel with the nRepeats option, index specifies the index’th entry from which to read the data.

  • +
  • necessary. (Any other parameters in **kwargs are optional but may be necessary if an object's .fromHDF() procedure requires extra arguments. Refer to the object you wish to read in to determine whether extra arguments are) –

  • +
+
+
Returns:
+

out – Returns the read in entries as a list if there are multiple or as a single object if there is only one.

+
+
Return type:
+

object or list

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfRead.readKeyFromFiles(fNames, groupName, key, index=None, **kwargs)
+

Reads in the keys from multiple files

+

Iterates over filenames, group names, and keys and reads them from a HDF5 file

+
+
Parameters:
+
    +
  • fNames (str or list of str) – The path(s) and/or file name(s)

  • +
  • groupName (str or list of str) – The group(s) path within the hdf5 file(s) to read from. i.e. ‘/group1/group1a’

  • +
  • key (str or list of str) – The key(s) in the group to read

  • +
  • index (slice, optional) – Specifies the index’th entry of the data to return. If the group was created using a createHDF procedure in parallel with the nRepeats option, index specifies the index’th entry from which to read the data.

  • +
  • necessary. (Any other parameters in **kwargs are optional but may be necessary if an object's .fromHDF() procedure requires extra arguments. Refer to the object you wish to read in to determine whether extra arguments are) –

  • +
+
+
Returns:
+

out – Returns the read in entries as a list if there are multiple or as a single object if there is only one.

+
+
Return type:
+

object or list

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfRead.read_all(fName)
+

Reads all the entries written to a HDF file

+

Iterates through the highest set of keys in the hdf5 file, and reads each one to a list. If each entry has an attached .readHdf procedure, that will be used to read in an object (Those objects imported at the top of this file can be successfully read in using this attached procedure.) If an entry is a numpy array, that will be the return type. This function will read in the entire file! Use this with caution if you are using large files.

+
+
Parameters:
+

fName (str) – A path and/or file name.

+
+
Returns:
+

out – A list of the read in items from the hdf5 file.

+
+
Return type:
+

list

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfRead.read_groups_with_tag(filename, tag, index=None, **kwargs)
+

Reads all groups with ‘tag’ in their path into memory.

+
+
Parameters:
+
    +
  • filename (str) – HDF5 file name

  • +
  • tag (str) – Sub string that appears in the group name.

  • +
+
+
Returns:
+

out – List of geobipy classes.

+
+
Return type:
+

list

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfRead.read_item(h5obj, index=None, **kwargs)
+

Read an object from a HDF file

+

This function provides a flexible way to read in either a numpy hdf5 entry, or an object in this package. The objects in this package may have an attached .createHdf and writeHdf procedure. If so, this function will read in those objects and return that object. If the entry is instead a numpy array, a numpy array will be returned.

+
+
Parameters:
+
    +
  • hObj (h5py._hl.dataset.Dataset or h5py._hl.group.Group) – A h5py object from which to read entries.

  • +
  • index (slice, optional) – Specifies the index’th entry of the data to return. If the group was created using a createHDF procedure in parallel with the nRepeats option, index specifies the index’th entry from which to read the data.

  • +
  • necessary. (Any other parameters in **kwargs are optional but may be necessary if an object's .fromHDF() procedure requires extra arguments. Refer to the object you wish to read in to determine whether extra arguments are) –

  • +
+
+
Returns:
+

out – An object that has a .fromHdf() procedure or a numpy array of the returned variable.

+
+
Return type:
+

object or numpy.ndarray

+
+
+
+ +
+
+geobipy.src.base.HDF.hdfWrite.write_nd(arr, h5obj, myName, index=None)
+

Writes a numpy array to a preallocated dataset in a h5py group object

+
+
Parameters:
+
    +
  • h5obj (h5py._hl.files.File or h5py._hl.group.Group) – A HDF file or group object to write the contents to. The dataset must have already been allocated in the file.

  • +
  • myName (str) – The name of the h5py dataset key inside the h5py object. e.g. ‘/group1/group1a/dataset’

  • +
  • index (slice, optional) – Specifies the index’th entry of the data to return. If the group was created using a createHDF procedure in parallel with the nRepeats option, index specifies the index’th entry from which to read the data.

  • +
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/MPI.html b/docs/content/api/base/MPI.html new file mode 100644 index 00000000..b84ee687 --- /dev/null +++ b/docs/content/api/base/MPI.html @@ -0,0 +1,597 @@ + + + + + + + MPI wrapper functions — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

MPI wrapper functions

+

Module containing custom MPI functions

+
+
+geobipy.src.base.MPI.Bcast(self, world, root=0, dtype=None, ndim=None, shape=None)
+

Broadcast a string or a numpy array

+

Broadcast a string or a numpy array from a root rank to all ranks in an MPI communicator. Must be called collectively. +In order to call this function collectively, the variable ‘self’ must be instantiated on every rank. See the example section for more details.

+
+
Parameters:
+
    +
  • self (str or numpy.ndarray) – A string or numpy array to broadcast from root.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The broadcast object on every rank.

+
+
Return type:
+

same type as self

+
+
Raises:
+

TypeError – If self is a list, tell the user to use the specific Bcast_list function. While it has less code and seems like it might be faster, MPI actually pickles the list, broadcasts that binary stream, and unpickles on the other side. For a large number of lists, this can take a long time. This way, the user is made aware of the time benefits of using numpy arrays.

+
+
+

Examples

+

Given a numpy array instantiated on the master rank 0, in order to broadcast it, I must also instantiate a variable with the same name on all other ranks.

+
>>> import numpy as np
+>>> from mpi4py import MPI
+>>> from geobipy.src.base import MPI as myMPI
+>>> world = MPI.COMM_WORLD
+>>> if world.rank == 0:
+>>>     x=StatArray(arange(10))
+>>> # Instantiate on all other ranks before broadcasting
+>>> else:
+>>>     x=None
+>>> y = myMPI.Bcast(x, world)
+>>>
+>>> # A string example
+>>> if (world.rank == 0):
+>>>     s = 'some string'  # This may have been read in through an input file for production code
+>>> else:
+>>>     s = ''
+>>> s = myMPI.Bcast(s,world)
+
+
+
+ +
+
+geobipy.src.base.MPI.Bcast_1int(self, world, root=0)
+

Broadcast a single integer

+

In order to broadcast scalar values using the faster numpy approach, the value must cast into a 1D ndarray. Must be called collectively.

+
+
Parameters:
+
    +
  • self (int) – The integer to broadcast.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The broadcast integer.

+
+
Return type:
+

int

+
+
+

Examples

+

Given an integer instantiated on the master rank 0, in order to broadcast it, I must also instantiate a variable with the same name on all other ranks.

+
>>> import numpy as np
+>>> from mpi4py import MPI
+>>> from geobipy.src.base import MPI as myMPI
+>>> world = MPI.COMM_WORLD
+>>> if world.rank == 0:
+>>>     i = 5
+>>> # Instantiate on all other ranks before broadcasting
+>>> else:
+>>>     i=None
+>>> i = myMPI.Bcast(i, world)
+
+
+
+ +
+
+geobipy.src.base.MPI.Bcast_list(self, world, root=0)
+

Broadcast a list by pickling, sending, and unpickling. This is slower than using numpy arrays and uppercase (Bcast) mpi4py routines. Must be called collectively.

+
+
Parameters:
+
    +
  • self (list) – A list to broadcast.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The broadcast list on every MPI rank.

+
+
Return type:
+

list

+
+
+
+ +
+
+geobipy.src.base.MPI.Irecv(source, world, dtype=None, ndim=None, shape=None)
+

Irecv a numpy array. Auto determines data type and shape. Must be accompanied by Isend on the source rank.

+
+ +
+
+geobipy.src.base.MPI.IrecvFromLeft(world, wrap=True)
+

Irecv an array from the rank left of world.rank.

+
+ +
+
+geobipy.src.base.MPI.IrecvFromRight(world, wrap=True)
+

IRecv an array from the rank right of world.rank.

+
+ +
+
+geobipy.src.base.MPI.Irecv_1int(source, world)
+

Recv a single integer. Must be accompanied by Isend_1int on the source rank.

+
+
Parameters:
+
    +
  • self (int) – Integer to Recv

  • +
  • source (int) – Receive from this rank.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
+
+
Returns:
+

out – The received integer.

+
+
Return type:
+

int

+
+
+
+ +
+
+geobipy.src.base.MPI.Isend(self, dest, world, dtype=None, ndim=None, shape=None)
+

Isend a numpy array. Auto determines data type and shape. Must be accompanied by Irecv on the dest rank.

+
+ +
+
+geobipy.src.base.MPI.IsendToLeft(self, world, wrap=True)
+

ISend an array to the rank left of world.rank.

+
+ +
+
+geobipy.src.base.MPI.IsendToRight(self, world, wrap=True)
+

ISend an array to the rank left of world.rank.

+
+ +
+
+geobipy.src.base.MPI.Isend_1int(self, dest, world)
+

Send a single integer. Must be accompanied by Irecv_1int on the dest rank.

+
+
Parameters:
+
    +
  • self (int) – The integer to Send.

  • +
  • dest (int) – Rank to receive

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
+
+
Returns:
+

out – The sent integer.

+
+
Return type:
+

int

+
+
+
+ +
+
+geobipy.src.base.MPI.Scatterv(self, starts, chunks, world, axis=0, root=0)
+

ScatterV an array to all ranks in an MPI communicator.

+

Each rank gets a chunk defined by a starting index and chunk size. Must be called collectively. The ‘starts’ and ‘chunks’ must be available on every MPI rank. Must be called collectively. See the example for more details.

+
+
Parameters:
+
    +
  • self (numpy.ndarray) – A numpy array to broadcast from root.

  • +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • axis (int, optional) – Axis along which to Scatterv to the ranks if self is a 2D numpy array. Default is 0

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – A chunk of self on each MPI rank with size chunk[world.rank].

+
+
Return type:
+

numpy.ndarray

+
+
+

Examples

+
>>> import numpy as np
+>>> from mpi4py import MPI
+>>> from geobipy.src.base import MPI as myMPI
+>>> world = MPI.COMM_WORLD
+>>> # Globally define a size N
+>>> N = 1000
+>>> # On each rank, compute the starting indices and chunk size for the given world.
+>>> starts,chunks=loadBalance_shrinkingArrays(N, world.size)
+>>> # Create an array on the master rank
+>>> if (world.rank == 0):
+>>>     x = arange(N)
+>>> else:
+>>>     x = None
+>>> # Scatter the array x among ranks.
+>>> myChunk = myMPI.Scatterv(x, starts, chunks, world, root=0)
+
+
+
+ +
+
+geobipy.src.base.MPI.Scatterv_list(self, starts, chunks, world, root=0)
+

Scatterv a list by pickling, sending, receiving, and unpickling. This is slower than using numpy arrays and uppercase (Scatterv) mpi4py routines. Must be called collectively.

+
+
Parameters:
+
    +
  • self (list) – A list to scatterv.

  • +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – A chunk of self on each MPI rank with size chunk[world.rank].

+
+
Return type:
+

list

+
+
+
+ +
+
+geobipy.src.base.MPI.Scatterv_numpy(self, starts, chunks, dtype, world, axis=0, root=0)
+

ScatterV a numpy array to all ranks in an MPI communicator.

+

Each rank gets a chunk defined by a starting index and chunk size. Must be called collectively. The ‘starts’ and ‘chunks’ must be available on every MPI rank. See the example for more details. Must be called collectively.

+
+
Parameters:
+
    +
  • self (numpy.ndarray) – A numpy array to broadcast from root.

  • +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • dtype (type) – The type of the numpy array being scattered. Must exist on all ranks.

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • axis (int, optional) – Axis along which to Scatterv to the ranks if self is a 2D numpy array. Default is 0

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – A chunk of self on each MPI rank with size chunk[world.rank].

+
+
Return type:
+

numpy.ndarray

+
+
+
+ +
+
+geobipy.src.base.MPI.banner(world, aStr=None, end='\n', rank=0)
+

Prints a String with Separators above and below

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • aStr (str) – A string to print.

  • +
  • end (str) – string appended after the last value, default is a newline.

  • +
  • rank (int) – The rank to print from, default is the master rank, 0.

  • +
+
+
+
+ +
+
+geobipy.src.base.MPI.bcastType(self, world, root=0)
+

Gets the type of an object and broadcasts it to every rank in an MPI communicator.

+

Adaptively broadcasts the type of an object. Must be called collectively.

+
+
Parameters:
+
    +
  • self (object) – For numpy arrays and numpy scalars, a numpy data type will be broadcast. +For arbitrary objects, the attached __class__.__name__ will be broadcast. +For lists, the data type will be list

  • +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The data type broadcast to every rank including the rank broadcast from.

+
+
Return type:
+

object

+
+
+
+ +
+
+geobipy.src.base.MPI.get_prng(generator=<class 'randomgen.xoshiro256.Xoshiro256'>, seed=None, jump=None, world=None)
+

Generate an independent prng.

+
+
Returns:
+

    +
  • seed (int or file, optional) – The seed of the bit generator.

  • +
  • jump (int, optional) – Jump the bit generator by this amount

  • +
  • world (mpi4py.MPI.COMM_WORLD, optional) – MPI communicator, will jump each bit generator by world.rank

  • +
+

+
+
+
+ +
+
+geobipy.src.base.MPI.helloWorld(world)
+

Print hello from every rank in an MPI communicator

+
+
Parameters:
+

world (mpi4py.MPI.Comm) – MPI parallel communicator.

+
+
+
+ +
+
+geobipy.src.base.MPI.loadBalance1D_shrinkingArrays(N, nChunks)
+

Splits the length of an array into a number of chunks. Load balances the chunks in a shrinking arrays fashion.

+

Given a length N, split N up into nChunks and return the starting index and size of each chunk. +After being split equally among the chunks, the remainder is split so that the first remainder +chunks get +1 in size. e.g. N=10, nChunks=3 would return starts=[0,4,7] chunks=[4,3,3]

+
+
Parameters:
+
    +
  • N (int) – A size to split into chunks.

  • +
  • nChunks (int) – The number of chunks to split N into.

  • +
+
+
Returns:
+

    +
  • starts (ndarray of ints) – The starting indices of each chunk.

  • +
  • chunks (ndarray of ints) – The size of each chunk.

  • +
+

+
+
+
+ +
+
+geobipy.src.base.MPI.loadBalance3D_shrinkingArrays(shape, nChunks)
+

Splits three dimensions among nChunks.

+

The number of chunks honours the relative difference in the values of shape. e.g. if shape is [600, 600, 300], then the number of chunks will be larger for the +first two dimensions, and less for the third. +Once the chunks are obtained, the start indices and chunk sizes for each dimension are returned.

+
+
Parameters:
+
    +
  • N (array_like) – A 3D shape to split.

  • +
  • nChunks (int) – The number of chunks to split shape into.

  • +
+
+
Returns:
+

    +
  • starts (ndarray of ints) – The starting indices of each chunk.

  • +
  • chunks (ndarray of ints) – The size of each chunk.

  • +
+

+
+
+
+ +
+
+geobipy.src.base.MPI.ordered_print(world, this, title=None)
+

Prints numbers from each rank in order of rank

+

This routine will print an item from each rank in order of rank. +This routine is SLOW due to lots of communication, but is useful for illustration purposes, or debugging. +Do not use this in production code! The title is used in a banner

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • this (array_like) – Variable to print, must exist on every rank in the communicator.

  • +
  • title (str, optional) – Creates a banner to separate output with a clear indication of what is being written.

  • +
+
+
+
+ +
+
+geobipy.src.base.MPI.print(aStr='', end='\n', **kwargs)
+

Prints the str to sys.stdout and flushes the buffer so that printing is immediate

+
+
Parameters:
+
    +
  • aStr (str) – A string to print.

  • +
  • end (str) – string appended after the last value, default is a newline.

  • +
+
+
+
+ +
+
+geobipy.src.base.MPI.rankPrint(world, aStr='', end='\n', rank=0)
+

Prints only from the specified MPI rank

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.Comm) – MPI parallel communicator.

  • +
  • aStr (str) – A string to print.

  • +
  • end (str) – string appended after the last value, default is a newline.

  • +
  • rank (int) – The rank to print from, default is the master rank, 0.

  • +
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/base.html b/docs/content/api/base/base.html new file mode 100644 index 00000000..b9e30932 --- /dev/null +++ b/docs/content/api/base/base.html @@ -0,0 +1,143 @@ + + + + + + + Core routines needed for GeoBIPy — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Core routines needed for GeoBIPy

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/fileIO.html b/docs/content/api/base/fileIO.html new file mode 100644 index 00000000..3c9237a2 --- /dev/null +++ b/docs/content/api/base/fileIO.html @@ -0,0 +1,425 @@ + + + + + + + fileIO — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

fileIO

+

@fileIO +Module with custom file handling operations

+
+
+geobipy.src.base.fileIO.bytes2readable(nBytes)
+

Convert bytes to KB, MB, …, PB

+
+
Parameters:
+

nBytes (float) – The number of bytes

+
+
Returns:
+

out – The number of KB, MB, etc.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.fileIO.deleteFile(fname)
+

Deletes a file if it exists

+
+
Parameters:
+

fName (str) – A path and/or file name

+
+
+
+ +
+
+geobipy.src.base.fileIO.dirExists(dirPath)
+

Check if a directory exists on disk

+
+
Parameters:
+

dirPath (str) – A directory path

+
+
Returns:
+

out – Whether the directory path exists

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.fileIO.fileExists(fname)
+

Check if a single file exists on disk

+
+
Parameters:
+

fname (str) – A file name

+
+
Returns:
+

out – Whether the file exists or not

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.fileIO.filesExist(fNames)
+

Check if all files in fNames exist on disk

+
+
Parameters:
+

fNames (list of str) –

+
+
Returns:
+

out – Whether all files exist or not

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.fileIO.getFileExtension(fname)
+

Gets the extension of the filename

+
+
Parameters:
+

fname (str) – A path and/or file name

+
+
Returns:
+

out – The extension of the filename

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.fileIO.getFileSize(fName)
+

Get the size of a file on disk

+
+
Parameters:
+

fName (str) – A path and/or file name

+
+
Returns:
+

out – The file size in KB, MB, etc.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.fileIO.getNcolumns(fName, nHeaders=0)
+

Gets the number of columns in a file using the line after nHeaders

+
+
Parameters:
+
    +
  • fName (str) – A path and/or file name

  • +
  • nHeaders (int, optional) – Number of header lines to skip before obtaining the number of columns

  • +
+
+
Returns:
+

out – The number of columns

+
+
Return type:
+

int

+
+
+
+ +
+
+geobipy.src.base.fileIO.getNlines(fname, nHeaders=0)
+

Gets the number of lines in a file after taking into account the number of header lines

+
+
Parameters:
+
    +
  • fName (str) – A path and/or file name

  • +
  • nHeaders (int, optional) – Subtract the number of header lines from the total number of lines in the file

  • +
+
+
Returns:
+

out – Number of lines without the headers

+
+
Return type:
+

int, optional

+
+
+
+ +
+
+geobipy.src.base.fileIO.get_column_name(filename)
+

Read headers names from a line in a file

+
+
Parameters:
+
    +
  • fName (str) – A path and/or file name.

  • +
  • i (in or list of ints, optional) – The indices of the entries to read from the string. By default, all entries are read in.

  • +
  • nHeaders (int, optional) – The number of header lines to skip in the file.

  • +
+
+
Returns:
+

out – A list of the parsed header entries.

+
+
Return type:
+

list of str

+
+
+
+ +
+
+geobipy.src.base.fileIO.get_real_numbers_from_line(line, indices=None, delimiters=',')
+

Reads strictly the numbers from a string

+
+
Parameters:
+
    +
  • line (str) – A string, or a line from a file.

  • +
  • i (in or list of ints, optional) – The indices of the entries to read from the string. By default, all entries are read in.

  • +
  • delimiters (str) – Splits the line based on these delimiters.

  • +
+
+
Returns:
+

out – The values read in from the string.

+
+
Return type:
+

numpy.ndarray

+
+
+
+ +
+
+geobipy.src.base.fileIO.int2str(i, N)
+

Converts an integer to a string with leading zeros in order to maintain the correct order in the file system

+
+
Parameters:
+
    +
  • i (int) – The integer to convert to a string.

  • +
  • N (int) – The maximum number of digits you wish to have in the integer. e.g. int2str(3,4)=’0003’.

  • +
+
+
Returns:
+

out – The integer padded with zeroes on the front.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.fileIO.isFileExtension(fname, ext)
+

Check that the filename is of the given extension

+
+
Parameters:
+
    +
  • fname (str) – A path and/or file name

  • +
  • ext (str) – The extension you want to check the file name against

  • +
+
+
Returns:
+

out – Whether the extension of fname matches ext

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.fileIO.parseString(this, delimiters=',')
+

Parse a string into its entries

+
+
Parameters:
+
    +
  • this (str) – The string to parse.

  • +
  • delimiters (str) – Patterns to split against, e.g. ‘,’ splits at every comma.

  • +
+
+
Returns:
+

out – A list of the parsed entries

+
+
Return type:
+

list of str

+
+
+
+ +
+
+geobipy.src.base.fileIO.wccount(filename)
+

Count the number of lines in a file using a wc system call

+
+
Parameters:
+

fName (str) – A path and/or file name

+
+
Returns:
+

out – The number of lines in the file

+
+
Return type:
+

int

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/interpolation.html b/docs/content/api/base/interpolation.html new file mode 100644 index 00000000..02f36d6e --- /dev/null +++ b/docs/content/api/base/interpolation.html @@ -0,0 +1,134 @@ + + + + + + + Interpolation — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Interpolation

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/plotting.html b/docs/content/api/base/plotting.html new file mode 100644 index 00000000..812020e3 --- /dev/null +++ b/docs/content/api/base/plotting.html @@ -0,0 +1,642 @@ + + + + + + + plotting — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

plotting

+
+
+geobipy.src.base.plotting.bar(values, edges, line=None, **kwargs)
+

Plot a bar chart.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – Bar values

  • +
  • edges (array_like or StatArray) – edges of the bars

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.hist

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.clabel(cb, label, length=20, wrap=False, **kwargs)
+

Create a colourbar label with default fontsizes

+
+
Parameters:
+
    +
  • cb (matplotlib.colorbar.Colorbar) – A colourbar to label

  • +
  • label (str) – The colourbar label

  • +
+
+
+
+ +
+
+geobipy.src.base.plotting.generate_subplots(n, ax=None)
+

Generates subplots depending on whats given

+
+
Parameters:
+
    +
  • n (int) – number of subplots

  • +
  • ax (variable, optional) – List of subplots. +gridspec.GridSpec or gridspec.Subplotspec +list of gridspec.Subplotspec +Defaults to None.

  • +
+
+
+
+ +
+
+geobipy.src.base.plotting.hillshade(arr, azimuth=30, altitude=30)
+

Create hillshade from a numpy array containing elevation data.

+

Taken from https://github.com/royalosyin/Work-with-DEM-data-using-Python-from-Simple-to-Complicated/blob/master/ex07-Hillshade%20from%20a%20Digital%20Elevation%20Model%20(DEM).ipynb

+
+
Parameters:
+
    +
  • arr (numpy array of shape (rows, columns)) – Numpy array containing elevation values to be used to created hillshade.

  • +
  • azimuth (float (default=30)) – The desired azimuth for the hillshade.

  • +
  • altitude (float (default=30)) – The desired sun angle altitude for the hillshade.

  • +
+
+
Returns:
+

A numpy array containing hillshade values.

+
+
Return type:
+

numpy array

+
+
+
+ +
+
+geobipy.src.base.plotting.hlines(*args, **kwargs)
+

Plot y against x

+

If x and y are StatArrays, the axes are automatically labelled.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa

  • +
  • y (array_like or StatArray) – The ordinate, can be upto 2 dimensions.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • labels (bool, optional) – Plot the labels? Default is True.

  • +
+
+
Returns:
+

matplotlib.Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.plot

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.make_colourmap(seq, cname)
+

Generate a Linear Segmented colourmap

+

Generates a colourmap from the sequence given and registers the colourmap with matplotlib.

+
+
Parameters:
+
    +
  • seq (array of hex colours.) – e.g. [‘#000000’,’#00fcfd’,…]

  • +
  • cname (str) – Name of the colourmap.

  • +
+
+
Returns:
+

matplotlib.colors.LinearSegmentedColormap.

+
+
Return type:
+

out

+
+
+
+ +
+
+geobipy.src.base.plotting.pause(interval)
+

Custom pause command to override matplotlib.pyplot.pause +which keeps the figure on top of all others when using interactve mode.

+
+
Parameters:
+

interval (float) – Pause for interval seconds.

+
+
+
+ +
+
+geobipy.src.base.plotting.pcolor(values, x=None, y=None, **kwargs)
+

Create a pseudocolour plot of a 2D array, Actually uses pcolormesh for speed.

+

Create a colour plot of a 2D array. +If the arrays x, y, and values are geobipy.StatArray classes, the axes can be automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. cmap etc.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – A 2D array of colour values.

  • +
  • x (1D array_like or StatArray, optional) – Horizontal coordinates of the values edges.

  • +
  • y (1D array_like or StatArray, optional) – Vertical coordinates of the values edges.

  • +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • reciprocateX (bool, optional) – Take the reciprocal of the X axis before other transforms

  • +
  • reciprocateY (bool, optional) – Take the reciprocal of the Y axis before other transforms

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
  • classes (dict, optional) – A dictionary containing three entries. +classes[‘id’] : array_like of same shape as self containing the class id of each element in self. +classes[‘cmaps’] : list of matplotlib colourmaps. The number of colourmaps should equal the number of classes. +classes[‘labels’] : list of str. The length should equal the number of classes. +If classes is provided, alpha is ignored if provided.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.pcolor_1D(values, y=None, **kwargs)
+

Create a pseudocolour plot of an array, Actually uses pcolormesh for speed.

+

Create a colour plot of an array. +If the arrays x, y, and values are geobipy.StatArray classes, the axes can be automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. cmap etc.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – An array of colour values.

  • +
  • x (1D array_like or StatArray) – Horizontal coordinates of the values edges.

  • +
  • y (1D array_like or StatArray, optional) – Vertical coordinates of the values edges.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • clabel (str, optional) – colourbar label

  • +
  • grid (bool, optional) – Show the grid lines

  • +
  • transpose (bool, optional) – Transpose the image

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.pcolor_as_bar(X, Y, values, **kwargs)
+

Create a pseudocolour plot of a 2D array, Actually uses pcolormesh for speed.

+

Create a colour plot of a 2D array. +If the arrays x, y, and values are geobipy.StatArray classes, the axes can be automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. cmap etc.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – A 2D array of colour values.

  • +
  • X (1D array_like or StatArray, optional) – Horizontal coordinates of the values edges.

  • +
  • Y (1D array_like or StatArray, optional) – Vertical coordinates of the values edges.

  • +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • alphaColour ('trans' or length 3 array) – If ‘trans’, low alpha values are mapped to transparency +If 3 array, each entry is the RGB value of a colour to map to, e.g. white = [1, 1, 1].

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (array_like, optional) – Set the x and y limits to the first and last locations that don’t equal the values in trim.

  • +
  • classes (dict, optional) – A dictionary containing three entries. +classes[‘id’] : array_like of same shape as self containing the class id of each element in self. +classes[‘cmaps’] : list of matplotlib colourmaps. The number of colourmaps should equal the number of classes. +classes[‘labels’] : list of str. The length should equal the number of classes. +If classes is provided, alpha is ignored if provided.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.plot(x, y, **kwargs)
+

Plot y against x

+

If x and y are StatArrays, the axes are automatically labelled.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa

  • +
  • y (array_like or StatArray) – The ordinate, can be upto 2 dimensions.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • labels (bool, optional) – Plot the labels? Default is True.

  • +
+
+
Returns:
+

matplotlib.Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.plot

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.pretty(ax)
+

Make a plot with nice axes.

+

Removes fluff from the axes.

+
+
Parameters:
+

ax (matplotlib .Axes) – A .Axes class from for example ax = plt.subplot(111), or ax = plt.gca()

+
+
+
+ +
+
+geobipy.src.base.plotting.scatter2D(x, c, y=None, i=None, *args, **kwargs)
+

Create a 2D scatter plot.

+

Create a 2D scatter plot, if the y values are not given, the colours are used instead. +If the arrays x, y, and c are geobipy.StatArray classes, the axes can be automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. markersize etc.

+
+
Parameters:
+
    +
  • x (1D array_like or StatArray) – Horizontal locations of the points to plot

  • +
  • c (1D array_like or StatArray) – Colour values of the points

  • +
  • y (1D array_like or StatArray, optional) – Vertical locations of the points to plot, if y = None, then y = c.

  • +
  • i (sequence of ints or numpy.slice, optional) – Plot a geobipy_kwargs of x, y, c, using the indices in i.

  • +
  • log ('e' or float, optional) – Take the log of the colour to base ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.scatter

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.setAlphaPerPcolormeshPixel(pcmesh, alphaArray)
+

Set the opacity of each pixel in a pcolormesh

+
+
Parameters:
+
    +
  • pcmesh (matplotlib.collections.QuadMesh) – pcolormesh object

  • +
  • alphaArray (array_like) – Values per pixel each between 0 and 1.

  • +
+
+
+
+ +
+
+geobipy.src.base.plotting.sizeLegend(values, intervals=None, **kwargs)
+

Add a legend to a plot if the point sizes have been specified.

+

If values is an StatArray, labels are generated automatically.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – The array that was used as the size (s=) in a scatter function.

  • +
  • intervals (array_like, optional) – The legend will have items at each value in intervals.

  • +
  • **kwargs (dict) – kwargs are applied to plt.legend.

  • +
+
+
+
+ +
+
+geobipy.src.base.plotting.stackplot2D(x, y, labels=[], colors=['#000000', '#FFFF00', '#1CE6FF', '#FF34FF', '#FF4A46', '#008941', '#006FA6', '#A30059', '#FFDBE5', '#7A4900', '#0000A6', '#63FFAC', '#B79762', '#004D43', '#8FB0FF', '#997D87', '#5A0007', '#809693', '#FEFFE6', '#1B4400', '#4FC601', '#3B5DFF', '#4A3B53', '#FF2F80', '#61615A', '#BA0900', '#6B7900', '#00C2A0', '#FFAA92', '#FF90C9', '#B903AA', '#D16100', '#DDEFFF', '#000035', '#7B4F4B', '#A1C299', '#300018', '#0AA6D8', '#013349', '#00846F', '#372101', '#FFB500', '#C2FFED', '#A079BF', '#CC0744', '#C0B9B2', '#C2FF99', '#001E09', '#00489C', '#6F0062', '#0CBD66', '#EEC3FF', '#456D75', '#B77B68', '#7A87A1', '#788D66', '#885578', '#FAD09F', '#FF8A9A', '#D157A0', '#BEC459', '#456648', '#0086ED', '#886F4C', '#34362D', '#B4A8BD', '#00A6AA', '#452C2C', '#636375', '#A3C8C9', '#FF913F', '#938A81', '#575329', '#00FECF', '#B05B6F', '#8CD0FF', '#3B9700', '#04F757', '#C8A1A1', '#1E6E00', '#7900D7', '#A77500', '#6367A9', '#A05837', '#6B002C', '#772600', '#D790FF', '#9B9700', '#549E79', '#FFF69F', '#201625', '#72418F', '#BC23FF', '#99ADC0', '#3A2465', '#922329', '#5B4534', '#FDE8DC', '#404E55', '#0089A3', '#CB7E98', '#A4E804', '#324E72', '#6A3A4C'], **kwargs)
+

Plot a 2D array with column elements stacked on top of each other.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa.

  • +
  • y (array_like or StatArray, 2D) – The cumulative sum along the columns is taken and stacked on top of each other.

  • +
  • labels (list of str, optional) – The labels to assign to each column.

  • +
  • colors (matplotlib.colors.LinearSegmentedColormap or list of colours) – The colour used for each column.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.scatterplot

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+geobipy.src.base.plotting.step(x, y, **kwargs)
+

Plots y against x as a piecewise constant (step like) function.

+
+
Parameters:
+
    +
  • x (array_like) –

  • +
  • y (array_like) –

  • +
  • flipY (bool, optional) – Flip the y axis

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY – Flip the Y axis

  • +
  • noLabels (bool, optional) – Do not plot the labels

  • +
+
+
+
+ +
+
+geobipy.src.base.plotting.vlines(*args, **kwargs)
+

Plot y against x

+

If x and y are StatArrays, the axes are automatically labelled.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa

  • +
  • y (array_like or StatArray) – The ordinate, can be upto 2 dimensions.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • labels (bool, optional) – Plot the labels? Default is True.

  • +
+
+
Returns:
+

matplotlib.Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.plot

For additional keyword arguments you may use.

+
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/base/utilities.html b/docs/content/api/base/utilities.html new file mode 100644 index 00000000..66da36de --- /dev/null +++ b/docs/content/api/base/utilities.html @@ -0,0 +1,617 @@ + + + + + + + utilities — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

utilities

+
+
+geobipy.src.base.utilities.Ax(A, x)
+

Custom matrix vector multiplication for different representations of the matrix.

+
+
Parameters:
+
    +
  • A (float or ndarray of floats) – A scalar, 1D array, or 2D array. +If A is scalar, assume it represents a diagonal matrix with constant value. +If A is 1D, assume it represents a diagonal matrix and do an element wise multiply. +If A is 2D, take the dot product.

  • +
  • x (numpy.ndarray) – The 1D vector to multiply A with.

  • +
+
+
Returns:
+

out – Resultant matrix vector multiplication.

+
+
Return type:
+

ndarray of floats

+
+
+
+ +
+
+geobipy.src.base.utilities.Det(A, N=1.0)
+

Custom function to compute the determinant of a matrix.

+
+
Parameters:
+
    +
  • A (float or ndarray of floats) – If A is 2D: Use numpy.linalg.det obtain determinant. Uses LU factorization. +If A is 1D: Take the cumulative product of the numbers, assumes A represents a diagonal matrix. +If A is scalar: Take the number to power N, assumes A represents a diagonal matrix with constant value.

  • +
  • N (int, optional) – If A is a scalar, N is the number of elements in the constant valued diagonal.

  • +
+
+
Returns:
+

out – The determinant of the matrix.

+
+
Return type:
+

float

+
+
+
+ +
+
+geobipy.src.base.utilities.Inv(A)
+

Custom matrix inversion upto 2 dimensions.

+
+
Parameters:
+

A (float or ndarray of floats) – A scalar, 1D array, or 2D array. +If A is scalar, assume it represents a diagonal matrix with constant value and take the reciprocal. +If A is 1D, assume it is the diagonal of a matrix: take reciprocal of entries. +If A is 2D, invert using linalg.

+
+
Returns:
+

out – The inversion of A.

+
+
Return type:
+

float or ndarray of floats

+
+
+
+ +
+
+geobipy.src.base.utilities.LogDet(A, N=1.0)
+

Custom function to get the natural logarithm of the determinant.

+
+
Parameters:
+
    +
  • A (float or numpy.ndarray of floats) – If A is 2D: Use linalg.to obtain determinant. Uses LU factorization. +If A is 1D: Take the cumulative product of the numbers, assumes A represents a diagonal matrix. +If A is scalar: Take the number to power N, assumes A represents a diagonal matrix with constant value.

  • +
  • N (int, optional) – If A is a scalar, N is the number of elements in the constant valued diagonal.

  • +
+
+
Returns:
+

out – The logged determinant of the matrix.

+
+
Return type:
+

float

+
+
+
+ +
+
+geobipy.src.base.utilities.cosSin1(x, y, a, p)
+

Simple function for creating tests.

+
+ +
+
+geobipy.src.base.utilities.expReal(this)
+

Custom exponential of a number to allow a large negative exponent, overflow truncates without warning message.

+
+
Parameters:
+

this (float) – Real number to take exponential to.

+
+
Returns:
+

out – exp(this).

+
+
Return type:
+

float

+
+
+
+ +
+
+geobipy.src.base.utilities.findFirstLastNotValue(this, values, invalid_val=-1)
+

Find the indices to the first and last non zero values along each axis

+
+
Parameters:
+

this (array_like) – An array of numbers

+
+
Returns:
+

out – Indices of the first and last non zero values along each axisgg

+
+
Return type:
+

array_like

+
+
+
+ +
+
+geobipy.src.base.utilities.findFirstNonZeros(this, axis, invalid_val=-1)
+

Find the indices to the first non zero values

+
+
Parameters:
+
    +
  • this (array_like) – An array of numbers

  • +
  • axis (int) – Axis along which to find first non zeros

  • +
  • invalid_val (int) – If all values along that axis are zero, use this value

  • +
+
+
Returns:
+

out – Indices of the first non zero values.

+
+
Return type:
+

ints

+
+
+
+ +
+
+geobipy.src.base.utilities.findLastNonZeros(this, axis, invalid_val=-1)
+

Find the indices to the last non zero values

+
+
Parameters:
+
    +
  • this (array_like) – An array of numbers

  • +
  • axis (int) – Axis along which to find last non zeros

  • +
  • invalid_val (int) – If all values along that axis are zero, use this value

  • +
+
+
Returns:
+

out – Indices of the last non zero values.

+
+
Return type:
+

ints

+
+
+
+ +
+
+geobipy.src.base.utilities.findNans(this)
+

Find the indicies to NaN values.

+
+
Parameters:
+

this (array_like) – An array of numbers.

+
+
Returns:
+

out – Integer array to locations of nans.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+geobipy.src.base.utilities.findNotNans(this)
+

Find the indicies to non NaN values.

+
+
Parameters:
+

this (array_like) – An array of numbers.

+
+
Returns:
+

out – Integer array to locations of non nans.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+geobipy.src.base.utilities.getName(self, default='')
+

Tries to obtain an attached name to a variable.

+

If the variable is an object with a getName() procedure, that function will take precedence. +If the variable does not have that procedure, a variable called name will be sought. +If this fails, the specified default will be returned.

+
+
Parameters:
+

self (any type) – Any type of variable.

+
+
Returns:
+

out – A string containing the variable’s name or the default.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.utilities.getNameUnits(self, defaultName='', defaultUnits='')
+

Tries to obtain any attached name and units to a variable. Any units are surrounded by round brackets.

+
+
Parameters:
+

self (any type) – Any type of variable.

+
+
Returns:
+

out – A string containing the variable’s name and units or the defaults.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.utilities.getUnits(self, default='')
+

Tries to obtain an attached units to a variable.

+

If the variable is an object with a getUnits() procedure, that function will take precedence. +If the variable does not have that procedure, a variable called units will be sought. +If this fails, the specified default will be returned.

+
+
Parameters:
+

self (any type) – Any type of variable.

+
+
Returns:
+

out – A string containing the variable’s units or the default.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.utilities.histogramEqualize(values, nBins=256)
+

Equalize the histogram of the values so that all colours have an equal amount

+
+
Parameters:
+
    +
  • values (array_like) – Values to be equalized.

  • +
  • nBins (int) – Number of bins to use.

  • +
+
+
Returns:
+

    +
  • res (array_like) – Equalized values

  • +
  • cdf (array_like) – Cumulative Density Function.

  • +
+

+
+
+
+ +
+
+geobipy.src.base.utilities.interleave(a, b)
+

Interleave two arrays together like zip

+
+
Parameters:
+
    +
  • a (array_like) – Interleave in [0::2]

  • +
  • b (array_like) – Interleave in [1::2]

  • +
+
+
Returns:
+

out – Interleaved arrays

+
+
Return type:
+

array_like

+
+
+
+ +
+
+geobipy.src.base.utilities.isInt(this)
+

Check whether an entry is a subtype of an int

+
+
Parameters:
+

this (variable) – Variable to check whether an int or not

+
+
Returns:
+

out – Is or is not an int

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.utilities.isIntorSlice(this)
+

Check whether an entry is a subtype of an int or a slice

+
+
Parameters:
+

this (variable) – Variable to check whether an int/slice or not

+
+
Returns:
+

out – Is or is not an int/slice

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.utilities.isNumpy(x)
+

Test that the variable is a compatible numpy type with built ins like .ndim

+
+
Parameters:
+

x (anything) – A variable to check

+
+
Returns:
+

out – Whether the variable is a compatible numpy type

+
+
Return type:
+

bool

+
+
+
+ +
+
+geobipy.src.base.utilities.mergeComplex(this)
+

Merge a 1D array containing a vertical concatenation of N real then N imaginary components into an N/2 complex 1D array.

+
+
Parameters:
+

this (numpy.ndarray of float64) – 1D array containing the vertical concatentation of real then imaginary values.

+
+
Returns:
+

out – The combined real and imaginary components into a complex 1D array.

+
+
Return type:
+

numpy.ndarray of complex128

+
+
+
+ +
+
+geobipy.src.base.utilities.rosenbrock(x, y, a, b)
+

Generates values from the Rosenbrock function.

+
+ +
+
+geobipy.src.base.utilities.smooth(x, a)
+

Smooth x by an LTI gaussian filter, forwards and backwards pass.

+
+
Parameters:
+
    +
  • x (array_like) – signal to process

  • +
  • a (scalar between 0.0 and 1.0) – Weight

  • +
+
+
Returns:
+

out – Smoothed signal

+
+
Return type:
+

array_like

+
+
+
+ +
+
+geobipy.src.base.utilities.splitComplex(this)
+

Splits a vector of complex numbers into a vertical concatenation of the real and imaginary components.

+
+
Parameters:
+

this (numpy.ndarray of complex128) – 1D array of complex numbers.

+
+
Returns:
+

out – Vertically concatenated real then imaginary components of this.

+
+
Return type:
+

numpy.ndarray of float64

+
+
+
+ +
+
+geobipy.src.base.utilities.str_to_raw(s)
+

Helper function for latex

+
+
Parameters:
+

s (str) – String with special latex commands.

+
+
Returns:
+

out – String with latex special characters.

+
+
Return type:
+

str

+
+
+
+ +
+
+geobipy.src.base.utilities.tanh(this)
+

Custom hyperbolic tangent, return correct overflow.

+
+ +
+
+geobipy.src.base.utilities.trim_by_percentile(values, percent)
+

Trim an array by a given percentile from either end

+
+
Parameters:
+
    +
  • values (array_like) – Values to trim

  • +
  • percent (float) – Percent from 0.0 to 100.0

  • +
+
+
Returns:
+

out – Trimmed values

+
+
Return type:
+

array_like

+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/classes.html b/docs/content/api/classes/classes.html new file mode 100644 index 00000000..d31667c5 --- /dev/null +++ b/docs/content/api/classes/classes.html @@ -0,0 +1,145 @@ + + + + + + + Classes used in GeoBIPy — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/core/StatArray.html b/docs/content/api/classes/core/StatArray.html new file mode 100644 index 00000000..65e8c558 --- /dev/null +++ b/docs/content/api/classes/core/StatArray.html @@ -0,0 +1,1376 @@ + + + + + + + StatArray — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

StatArray

+
Inheritance diagram of geobipy.src.classes.core.StatArray.StatArray
+ + + +
+
+class geobipy.src.classes.core.StatArray.StatArray(shape=None, name=None, units=None, verbose=False, **kwargs)
+

Class extension to numpy.ndarray

+

This subclass to a numpy array contains extra attributes that can describe the parameters it represents. +One can also attach prior and proposal distributions so that it may be used in an MCMC algorithm easily. +Because this is a subclass to numpy, the StatArray contains all numpy array methods and when passed to an +in-place numpy function will return a StatArray. See the example section for more information.

+

StatArray(shape, name=None, units=None, **kwargs)

+
+
Parameters:
+
    +
  • shape (int or sequence of ints or array_like or StatArray) –

      +
    • If shape is int or sequence of ints : give the shape of the new StatArray e.g., 2 or (2, 3). All other arguments that can be passed to functions like numpy.zeros or numpy.arange can be used, see Other Parameters.

    • +
    • If shape is array_like : any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. e.g., StatArray(numpy.arange(10)) will cast the result into a StatArray and will maintain the properies passed through to that function. One could then attach the name, units, prior, and/or proposal through this interface too. e.g., x = StatArray(numpy.arange(10,dtype=numpy.int), name='aTest', units='someUnits')

    • +
    • If shape is StatArray : the returned object is a deepcopy of the input. If name and units are specified with this option they will replace those parameters in the copy. e.g., y = StatArray(x, name='anotherTest') will be a deepcopy copy of x, but with a different name.

    • +
    +

  • +
  • name (str, optional) – The name of the StatArray.

  • +
  • units (str, optional) – The units of the StatArray.

  • +
  • dtype (data-type, optional) – The desired data-type for the array. Default is +numpy.float64. Only used when shape is int or sequence of ints. +The data type could also be a class.

  • +
  • buffer (object exposing buffer interface, optional) – Used to fill the array with data. Only used when shape is int or sequence of ints.

  • +
  • offset (int, optional) – Offset of array data in buffer. Only used when shape is int or sequence of ints.

  • +
  • strides (tuple of ints, optional) – Strides of data in memory. Only used when shape is int or sequence of ints.

  • +
  • order ({'C', 'F', 'A'}, optional) – Specify the order of the array. If order is ‘C’, then the array +will be in C-contiguous order (rightmost-index varies the fastest). +If order is ‘F’, then the returned array will be in +Fortran-contiguous order (leftmost-index varies the fastest). +If order is ‘A’ (default), then the returned array may be in any order (either C-, Fortran-contiguous, or even discontiguous), +unless a copy is required, in which case it will be C-contiguous. Only used when shape is int or sequence of ints.

  • +
+
+
Returns:
+

out – Extension to numpy.ndarray with additional attributes attached.

+
+
Return type:
+

StatArray

+
+
Raises:
+
    +
  • TypeError – If name is not a str.

  • +
  • TypeError – If units is not a str.

  • +
+
+
+

Notes

+

When the StatArray is passed through a numpy function, the name and units are maintained in the new object. Any priors or proposals are not kept for two reasons. a) keep computational overheads low, b) assume that a possible change in size or meaning of a parameter warrants a change in any attached distributions.

+

Examples

+

Since the StatArray is an extension to numpy, all numpy attached methods can be used.

+
>>> from geobipy import StatArray
+>>> import numpy as np
+>>> x = StatArray(arange(10), name='test', units='units')
+>>> print(x.mean())
+4.5
+
+
+

If the StatArray is passed to a numpy function that does not return a new instantiation, a StatArray will be returned (as opposed to a numpy array)

+
>>> delete(x, 5)
+StatArray([0, 1, 2, 3, 4, 6, 7, 8, 9])
+
+
+

However, if you pass a StatArray to a numpy function that is not in-place, i.e. creates new memory, the return type will be a numpy array and NOT a StatArray subclass

+
>>> append(x,[3,4,5])
+array([0, 1, 2, ..., 3, 4, 5])
+
+
+
+

See also

+
+
geobipy.src.classes.statistics.Distribution

For possible prior and proposal distributions

+
+
+
+
+
+Bcast(world, root=0)
+

Broadcast the StatArray to every rank in the MPI communicator.

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.Comm) – The MPI communicator over which to broadcast.

  • +
  • root (int, optional) – The rank from which to broadcast. Default is 0 for the master rank.

  • +
+
+
Returns:
+

out – The broadcast StatArray on every rank in the MPI communicator.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+classmethod Irecv(source, world, ndim=None, shape=None, dtype=None)
+
+ +
+
+IrecvFromLeft(world, wrap=True)
+

Irecv an array from the rank left of world.rank.

+
+ +
+
+IrecvFromRight(world, wrap=True)
+

IRecv an array from the rank right of world.rank.

+
+ +
+
+Isend(dest, world, ndim=None, shape=None, dtype=None)
+
+ +
+
+IsendToLeft(world)
+

ISend an array to the rank left of world.rank.

+
+ +
+
+IsendToRight(world)
+

ISend an array to the rank right of world.rank.

+
+ +
+
+Scatterv(starts, chunks, world, axis=0, root=0)
+

Scatter variable lengths of the StatArray using MPI

+

Takes the StatArray and gives each core in the world a chunk of the array.

+
+
Parameters:
+
    +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • world (mpi4py.MPI.Comm) – The MPI communicator over which to Scatterv.

  • +
  • axis (int, optional) – This axis is distributed amongst ranks.

  • +
  • root (int, optional) – The MPI rank to ScatterV from. Default is 0.

  • +
+
+
Returns:
+

out – The StatArray distributed amongst ranks.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+abs()
+

Take the absolute value. In-place operation.

+
+
Returns:
+

out – Absolute value

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+property addressof
+
+ +
+
+append(values, axis=0)
+

Append to a StatArray

+

Appends values the end of a StatArray. Be careful with repeated calls to this method as it can be slow due to reallocating memory.

+
+
Parameters:
+

values (scalar or array_like) – Numbers to append

+
+
Returns:
+

out – Appended StatArray

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+argmax_multiple_to_nan(axis=0)
+

Perform the numpy argmax function on the StatArray but optionally mask multiple max values as NaN.

+
+
Parameters:
+

nan_multiple (bool) – If multiple locations contain the same max value, mask as nan.

+
+
Returns:
+

out – Array of indices into the array. It has the same shape as self.shape +with the dimension along axis removed.

+
+
Return type:
+

ndarray of floats

+
+
+
+ +
+
+bar(x=None, i=None, **kwargs)
+

Plot the StatArray as a bar chart.

+

The values in self are the heights of the bars. Auto labels it if x has type geobipy.StatArray

+
+
Parameters:
+
    +
  • x (array_like or StatArray, optional) – The horizontal locations of the bars

  • +
  • i (sequence of ints, optional) – Plot the ith indices of self, against the ith indices of x.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.bar

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+property bounds
+
+ +
+
+centred_grid_nodes(spacing)
+

Generates grid nodes centred over bounds

+
+
Parameters:
+
    +
  • bounds (array_like) – bounds of the dimension

  • +
  • spacing (float) – distance between nodes

  • +
+
+
+
+ +
+
+confidence_interval(interval)
+
+ +
+
+copy(order='C')
+

Return a copy of the array.

+
+
Parameters:
+

order ({'C', 'F', 'A', 'K'}, optional) – Controls the memory layout of the copy. ‘C’ means C-order, +‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, +‘C’ otherwise. ‘K’ means match the layout of a as closely +as possible. (Note that this function and numpy.copy() are very +similar but have different default values for their order= +arguments, and this function always passes sub-classes through.)

+
+
+
+

See also

+
+
numpy.copy

Similar function with different default behavior

+
+
+

numpy.copyto

+
+

Notes

+

This function is the preferred method for creating an array copy. The +function numpy.copy() is similar, but it defaults to using order ‘K’, +and will not pass sub-classes through by default.

+

Examples

+
>>> x = np.array([[1,2,3],[4,5,6]], order='F')
+
+
+
>>> y = x.copy()
+
+
+
>>> x.fill(0)
+
+
+
>>> x
+array([[0, 0, 0],
+       [0, 0, 0]])
+
+
+
>>> y
+array([[1, 2, 3],
+       [4, 5, 6]])
+
+
+
>>> y.flags['C_CONTIGUOUS']
+True
+
+
+
+ +
+
+copyStats(other)
+

Copy statistical properties from other to self

+

[extended_summary]

+
+
Parameters:
+

other ([type]) – [description]

+
+
+
+ +
+
+createHdf(h5obj, name, shape=None, withPosterior=True, add_axis=None, fillvalue=None, upcast=True)
+

Create the Metadata for a StatArray in a HDF file

+

Creates a new group in a HDF file under h5obj. +A nested heirarchy will be created e.g., myNamedata, myNameprior, and myNameproposal. +This method can be used in an MPI parallel environment, if so however, a) the hdf file must have been opened with the mpio driver, +and b) createHdf must be called collectively, i.e., called by every core in the MPI communicator that was used to open the file. +In order to create large amounts of empty space before writing to it in parallel, the nRepeats parameter will extend the memory +in the first dimension.

+
+
Parameters:
+
    +
  • h5obj (h5py.File or h5py.Group) – A HDF file or group object to create the contents in.

  • +
  • myName (str) – The name of the group to create.

  • +
  • withPosterior (bool, optional) – Include the creation of space for any attached posterior.

  • +
  • nRepeats (int, optional) – Inserts a first dimension into the shape of the StatArray of size nRepeats. This can be used to extend the available memory of +the StatArray so that multiple MPI ranks can write to their respective parts in the extended memory.

  • +
  • fillvalue (number, optional) – Initializes the memory in file with the fill value

  • +
+
+
+

Notes

+

This method can be used in serial and MPI. As an example in MPI. +Given 10 MPI ranks, each with a 10 length array, it is faster to create a 10x10 empty array, and have each rank write its row. +Rather than creating 10 separate length 10 arrays because the overhead when creating the file metadata can become very +cumbersome if done too many times.

+

Example

+
>>> from geobipy import StatArray
+>>> from mpi4py import MPI
+>>> import h5py
+
+
+
>>> world = MPI.COMM_WORLD
+
+
+
>>> x = StatArray(4, name='test', units='units')
+>>> x[:] = world.rank
+
+
+
>>> # This is a collective open of data in the file
+>>> f = h5py.File(fName,'w', driver='mpio',comm=world)
+>>> # Collective creation of space(padded by number of mpi ranks)
+>>> x.createHdf(f, 'x', nRepeats=world.size)
+
+
+
>>> world.barrier()
+
+
+
>>> # In a non collective region, we can write to different sections of x in the file
+>>> # Fake a non collective region
+>>> def noncollectivewrite(x, file, world):
+>>>     # Each rank carries out this code, but it's not collective.
+>>>     x.writeHdf(file, 'x', index=world.rank)
+>>> noncollectivewrite(x, f, world)
+
+
+
>>> world.barrier()
+>>> f.close()
+
+
+
+ +
+
+create_posterior_hdf(grp, add_axis, fillvalue, upcast)
+
+ +
+
+delete(i, axis=None)
+

Delete elements

+
+
Parameters:
+
    +
  • i (slice, int or array of ints) – Indicate which sub-arrays to remove.

  • +
  • axis (int, optional) – The axis along which to delete the subarray defined by obj. +If axis is None, obj is applied to the flattened array.

  • +
+
+
Returns:
+

out – Deepcopy of StatArray with deleted entry(ies).

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+diff(axis=-1)
+
+ +
+
+edges(min=None, max=None, axis=-1)
+

Get the midpoint values between elements in the StatArray

+

Returns an size(self) + 1 length StatArray of the midpoints between each element. +The first and last element are projected edges based on the difference between first two and last two elements in self. +edges[0] = self[0] - 0.5 * (self[1]-self[0]) +edges[-1] = self[-1] + 0.5 * (self[-1] - self[-2]) +If min and max are given, the edges are fixed and not calculated.

+
+
Parameters:
+
    +
  • min (float, optional) – Fix the leftmost edge to min.

  • +
  • max (float, optional) – Fix the rightmost edge to max.

  • +
  • axis (int, optional) – Compute edges along this dimension if > 1D.

  • +
+
+
Returns:
+

out – Edges of the StatArray

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+firstNonZero(axis=0, invalid_val=-1)
+

Find the indices of the first non zero values along the axis.

+
+
Parameters:
+
    +
  • axis (int, optional) – Axis along which to find first non zeros.

  • +
  • invalid_val (int, optional) – When zero is not available, return this index.

  • +
+
+
Returns:
+

out – Indices of the first non zero values.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+fit_mixture(mixture_type='gaussian', log=None, mean_bounds=None, variance_bounds=None, k=[1, 5], tolerance=0.05)
+

Uses Gaussian mixture models to fit the histogram.

+

Starts at the minimum number of clusters and adds clusters until the BIC decreases less than the tolerance.

+
+
Parameters:
+
    +
  • nSamples

  • +
  • log

  • +
  • mean_bounds

  • +
  • variance_bounds

  • +
  • k (ints) – Two ints with starting and ending # of clusters

  • +
  • tolerance

  • +
+
+
+
+ +
+
+classmethod fromHdf(grp, name=None, index=None, skip_posterior=False, posterior_index=None)
+

Read the StatArray from a HDF group

+

Given the HDF group object, read the contents into a StatArray.

+
+
Parameters:
+
    +
  • h5obj (h5py._hl.group.Group) – A HDF group object to write the contents to.

  • +
  • index (slice, optional) – If the group was created using the nRepeats option, index specifies the index’th entry from which to read the data.

  • +
+
+
+
+ +
+
+gaussianMixture(clusterID, trainPercent=75.0, covType=['spherical'], plot=True)
+

Use a Gaussian Mixing Model to classify the data. +clusterID is the initial assignment of the rows to their clusters

+
+ +
+
+getNameUnits()
+

Get the name and units

+

Gets the name and units attached to the StatArray. Units, if present are surrounded by parentheses

+
+
Returns:
+

out – String containing name(units).

+
+
Return type:
+

str

+
+
+
+ +
+
+hasLabels()
+
+ +
+
+property hasPosterior
+

Check that the StatArray has an attached posterior.

+
+
Returns:
+

out – Has an attached posterior.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property hasPrior
+

Check that the StatArray has an attached prior.

+
+
Returns:
+

out – Has an attached prior.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property hasProposal
+

Check that the StatArray has an attached proposal.

+
+
Returns:
+

out – Has an attached proposal.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property hdf_name
+

Create a string that describes class instantiation

+

Returns a string that should be used as an attr[‘repr’] in a HDF group. +This allows reading of the attribute from the hdf file, evaluating it to return an object, +and then reading the hdf contents via the object’s methods.

+
+
Returns:
+

str

+
+
Return type:
+

out

+
+
+
+ +
+
+hist(bins=10, range=None, normed=None, weights=None, density=None, **kwargs)
+

Plot a histogram of the StatArray

+

Plots a histogram, estimates the mean and standard deviation and overlays the PDF of a normal distribution with those values, if density=1.

+
+

See also

+
+
geobipy.plotting.hist

For geobipy additional arguments

+
+
matplotlib.pyplot.hist

For histogram related arguments

+
+
+
+

Example

+
>>> from geobipy import StatArray
+>>> import numpy as np
+>>> import matplotlib.pyplot as plt
+>>> x = StatArray(random.randn(1000), name='name', units='units')
+>>> plt.figure()
+>>> x.hist()
+>>> plt.show()
+
+
+
+ +
+
+index(values)
+

Find the index of values.

+

Assumes that self is monotonically increasing!

+
+
Parameters:
+

values (scalara or array_like) – Find the index of these values.

+
+
Returns:
+

out – Indicies into self.

+
+
Return type:
+

ints

+
+
+
+ +
+
+insert(i, values, axis=0)
+

Insert values

+
+
Parameters:
+
    +
  • i (int, slice or sequence of ints) – Object that defines the index or indices before which values is inserted.

  • +
  • values (array_like) – Values to insert into arr. If the type of values is different from that of arr, values is converted to the type of arr. values should be shaped so that arr[...,obj,...] = values is legal.

  • +
  • axis (int, optional) – Axis along which to insert values. If axis is None then arr is flattened first.

  • +
+
+
Returns:
+

out – StatArray after inserting a value.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+interleave(other)
+

Interleave two arrays together like zip

+
+
Parameters:
+

other (StatArray or array_like) – Must have same size

+
+
Returns:
+

out – Interleaved arrays

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+internalEdges(axis=-1)
+

Get the midpoint values between elements in the StatArray

+

Returns an size(self) + 1 length StatArray of the midpoints between each element

+
+
Returns:
+

out – Edges of the StatArray

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+isRegular(axis=-1)
+

Checks that the values change regularly

+
+
Returns:
+

out – Is regularly changing.

+
+
Return type:
+

bool

+
+
+
+ +
+
+kMeans(nClusters, standardize=False, nIterations=10, plot=False, **kwargs)
+

Perform K-Means clustering on the StatArray

+
+ +
+
+property label
+
+ +
+
+lastNonZero(axis=0, invalid_val=-1)
+

Find the indices of the first non zero values along the axis.

+
+
Parameters:
+

axis (int) – Axis along which to find first non zeros.

+
+
Returns:
+

out – Indices of the first non zero values.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+mahalanobis()
+
+ +
+
+property n_posteriors
+
+ +
+
+property name
+
+ +
+
+nanmax()
+
+ +
+
+nanmin()
+
+ +
+
+normalize(axis=None)
+

Normalize to range 0 - 1.

+
+ +
+
+pad(N)
+

Copies the properties of a StatArray including all priors or proposals, but pads everything to the given size

+
+
Parameters:
+

N (int) – Size to pad to.

+
+
Returns:
+

out – Padded StatArray

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+pcolor(x=None, y=None, **kwargs)
+

Create a pseudocolour plot of the StatArray array, Actually uses pcolormesh for speed.

+

If the arguments x and y are geobipy.StatArray classes, the axes can be automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. cmap etc.

+
+
Parameters:
+
    +
  • x (1D array_like or StatArray, optional) – Horizontal coordinates of the values edges.

  • +
  • y (1D array_like or StatArray, optional) – Vertical coordinates of the values edges.

  • +
  • alpha (scalar or arrya_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
  • classes (dict, optional) – A dictionary containing three entries. +classes[‘id’] : array_like of same shape as self containing the class id of each element in self. +classes[‘cmaps’] : list of matplotlib colourmaps. The number of colourmaps should equal the number of classes. +classes[‘labels’] : list of str. The length should equal the number of classes. +If classes is provided, alpha is ignored if provided.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+perturb(i=slice(None, None, None), relative=False, imposePrior=False, log=False)
+

Perturb the values of the StatArray using the attached proposal

+

The StatArray must have had a proposal set using StatArray.setProposal()

+
+
Parameters:
+
    +
  • i (slice or int or sequence of ints, optional) – Index or indices of self that should be perturbed.

  • +
  • relative (bool) – Update the StatArray relative to the current values or assign the new samples to the StatArray.

  • +
+
+
Raises:
+

TypeError – If the proposal has not been set

+
+
+
+ +
+
+plot(x=None, i=None, axis=0, **kwargs)
+

Plot self against x

+

If x and y are StatArrays, the axes are automatically labelled.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa

  • +
  • i (sequence of ints, optional) – Plot the ith indices of self, against the ith indices of x.

  • +
  • axis (int, optional) – If self is 2D, plot values along this axis.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • labels (bool, optional) – Plot the labels? Default is True.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.plot

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+plot_posteriors(**kwargs)
+

Plot the posteriors of the StatArray.

+
+
Parameters:
+

ax (matplotlib axis or list of ax, optional) – Must match the number of attached posteriors. +* If not specified, subplots are created vertically.

+
+
+
+ +
+
+property posterior
+

Returns the posterior if available.

+
+ +
+
+posteriors_from_hdf(grp, index)
+
+ +
+
+prepend(values, axis=0)
+

Prepend to a StatArray

+

Prepends numbers to a StatArray, Do not use this too often as it is quite slow

+
+
Parameters:
+

values (scalar or array_like) – A number to prepend.

+
+
Returns:
+

out – StatArray with prepended values.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+property prior
+

Returns the prior if available.

+
+ +
+
+priorDerivative(order, i=None)
+

Get the derivative of the prior.

+
+
Parameters:
+

order (int) – 1 or 2 for first or second order derivative

+
+
+
+ +
+
+probability(log, x=None, i=None, active=None)
+

Evaluate the probability of the values in self using the attached prior distribution

+
+
Parameters:
+
    +
  • arg1 (array_like, optional) – Will evaluate the probability of the numbers in the arg1 using the prior attached to self

  • +
  • i (slice or int or sequence of ints, optional) – Index or indices of self that should be evaluated.

  • +
+
+
Returns:
+

numpy.float

+
+
Return type:
+

out

+
+
Raises:
+

TypeError – If the prior has not been set

+
+
+
+ +
+
+property proposal
+

Returns the prior if available.

+
+ +
+
+proposal_derivative(order, i=None)
+

Get the derivative of the proposal.

+
+
Parameters:
+

order (int) – 1 or 2 for first or second order derivative

+
+
+
+ +
+
+propose(i=slice(None, None, None), relative=False, imposePrior=False, log=False)
+

Propose new values using the attached proposal distribution

+
+
Parameters:
+
    +
  • i (ints, optional) – Only propose values for these indices.

  • +
  • relative (bool, optional) – Use the proposal distribution as a relative change to the parameter values.

  • +
  • imposePrior (bool, optional) – Continue to propose new values until the prior probability is non-zero or -infinity.

  • +
  • log (bool, required if imposePrior is True.) – Use log probability when imposing the prior.

  • +
+
+
Returns:
+

out – Valuese generated from the proposal.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+property range
+
+ +
+
+rescale(a, b)
+

Rescale to the interval (a, b)

+
+
Parameters:
+
    +
  • a (float) – Lower limit

  • +
  • b (float) – Upper limit

  • +
+
+
Returns:
+

out – Rescaled Array

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+reset_posteriors()
+
+ +
+
+resize(new_shape)
+

Resize a StatArray

+

Resize a StatArray but copy over any attached attributes

+
+
Parameters:
+

new_shape (int or tuple of ints) – Shape of the resized array

+
+
Returns:
+

out – Resized array.

+
+
Return type:
+

StatArray

+
+
+
+

See also

+
+
numpy.resize

For more information.

+
+
+
+
+ +
+
+rolling(numpyFunction, window=1)
+
+ +
+
+scatter(x=None, y=None, i=None, **kwargs)
+

Create a 2D scatter plot.

+

Create a 2D scatter plot, if the y values are not given, the colours are used instead. +If the arrays x, y, and c are geobipy.StatArray classes, the axes are automatically labelled. +Can take any other matplotlib arguments and keyword arguments e.g. markersize etc.

+
+
Parameters:
+
    +
  • x (1D array_like or StatArray) – Horizontal locations of the points to plot

  • +
  • c (1D array_like or StatArray) – Colour values of the points

  • +
  • y (1D array_like or StatArray, optional) – Vertical locations of the points to plot, if y = None, then y = c.

  • +
  • i (sequence of ints, optional) – Plot a subset of x, y, c, using the indices in i.

  • +
+
+
+
+

See also

+
+
geobipy.plotting.Scatter2D

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+smooth(a)
+
+ +
+
+stackedAreaPlot(x=None, i=None, axis=0, labels=[], **kwargs)
+

Create stacked area plot where column elements are stacked on top of each other.

+
+
Parameters:
+
    +
  • x (array_like or StatArray) – The abcissa.

  • +
  • i (sequence of ints, optional) – Plot a subset of x, y, c, using the indices in i.

  • +
  • axis (int) – Plot along this axis, stack along the other axis.

  • +
  • labels (list of str, optional) – The labels to assign to each column.

  • +
  • colors (matplotlib.colors.LinearSegmentedColormap or list of colours) – The colour used for each column.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’.

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.scatterplot

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+standardize(axis=None)
+

Standardize by subtracting the mean and dividing by the standard deviation.

+
+ +
+
+strip_nan()
+
+ +
+
+property summary
+

Write a summary of the StatArray

+
+
Parameters:
+

out (bool) – Whether to return the summary or print to screen

+
+
Returns:
+

out – Summary of StatArray

+
+
Return type:
+

str, optional

+
+
+
+ +
+
+summaryPlot(**kwargs)
+

Creates a summary plot of the StatArray with any attached priors, proposal, or posteriors.

+
+ +
+
+property units
+
+ +
+
+update_posterior(**kwargs)
+

Adds the current values of the StatArray to the attached posterior.

+
+ +
+
+property values
+
+ +
+
+verbose()
+

Explicit print of every element

+
+ +
+
+writeHdf(h5obj, name, withPosterior=True, index=None)
+

Write the values of a StatArray to a HDF file

+

Writes the contents of the StatArray to an already created group in a HDF file under h5obj. +This method can be used in an MPI parallel environment, if so however, the hdf file must have been opened with the mpio driver. +Unlike createHdf, writeHdf does not have to be called collectively, each rank can call writeHdf independently, +so long as they do not try to write to the same index.

+
+
Parameters:
+
    +
  • h5obj (h5py._hl.files.File or h5py._hl.group.Group) – A HDF file or group object to write the contents to.

  • +
  • myName (str) – The name of the group to write to. The group must have been created previously.

  • +
  • withPosterior (bool, optional) – Include writing any attached posterior.

  • +
  • index (int, optional) – If the group was created using the nRepeats option, index specifies the index’th entry at which to write the data

  • +
+
+
+

Example

+
>>> from geobipy import StatArray
+>>> from mpi4py import MPI
+>>> import h5py
+
+
+
>>> world = MPI.COMM_WORLD
+
+
+
>>> x = StatArray(4, name='test', units='units')
+>>> x[:] = world.rank
+
+
+
>>> # This is a collective open of data in the file
+>>> f = h5py.File(fName,'w', driver='mpio',comm=world)
+>>> # Collective creation of space(padded by number of mpi ranks)
+>>> x.createHdf(f, 'x', nRepeats=world.size)
+
+
+
>>> world.barrier()
+
+
+
>>> # In a non collective region, we can write to different sections of x in the file
+>>> # Fake a non collective region
+>>> def noncollectivewrite(x, file, world):
+>>>     # Each rank carries out this code, but it's not collective.
+>>>     x.writeHdf(file, 'x', index=world.rank)
+>>> noncollectivewrite(x, f, world)
+
+
+
>>> world.barrier()
+>>> f.close()
+
+
+
+ +
+
+write_posterior_hdf(grp, index=None)
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/core/core.html b/docs/content/api/classes/core/core.html new file mode 100644 index 00000000..6f171132 --- /dev/null +++ b/docs/content/api/classes/core/core.html @@ -0,0 +1,145 @@ + + + + + + + Core classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Core classes

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/core/myObject.html b/docs/content/api/classes/core/myObject.html new file mode 100644 index 00000000..c0358cba --- /dev/null +++ b/docs/content/api/classes/core/myObject.html @@ -0,0 +1,166 @@ + + + + + + + Core object class — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Core object class

+

o

+
+
+class geobipy.src.classes.core.myObject.myObject
+
+
+getsizeof()
+

Get the size of the object in memory with nice output

+
+ +
+
+toHdf(h5obj, name, withPosterior=False)
+

Create and write to HDF.

+
+
Parameters:
+
    +
  • h5obj (h5py._hl.files.File or h5py._hl.group.Group) – A HDF file or group object to write the contents to.

  • +
  • myName (str) – The name of the group to write the StatArray to.

  • +
+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/data.html b/docs/content/api/classes/data/data.html new file mode 100644 index 00000000..ae6225a4 --- /dev/null +++ b/docs/content/api/classes/data/data.html @@ -0,0 +1,145 @@ + + + + + + + Data classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Data classes

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/EmDataPoint.html b/docs/content/api/classes/data/datapoint/EmDataPoint.html new file mode 100644 index 00000000..653babef --- /dev/null +++ b/docs/content/api/classes/data/datapoint/EmDataPoint.html @@ -0,0 +1,222 @@ + + + + + + + EmDataPoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

EmDataPoint

+
Inheritance diagram of geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint
+ + + + + +
+
+class geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint(x=0.0, y=0.0, z=0.0, elevation=None, components=None, channels_per_system=None, data=None, std=None, predictedData=None, channel_names=None, lineNumber=0.0, fiducial=0.0, **kwargs)
+

Abstract EmDataPoint Class

+

This is an abstract base class for TdemDataPoint and FdemDataPoint classes

+ +
+
+property active
+

Gets the indices to the observed data values that are not NaN

+
+
Returns:
+

out – Indices into the observed data that are not NaN

+
+
Return type:
+

array of ints

+
+
+
+ +
+
+find_best_halfspace(minConductivity=0.0001, maxConductivity=10000.0, nSamples=100)
+

Computes the best value of a half space that fits the data.

+

Carries out a brute force search of the halfspace conductivity that best fits the data. +The profile of data misfit vs halfspace conductivity is not quadratic, so a bisection will not work.

+
+
Parameters:
+
    +
  • minConductivity (float, optional) – The minimum conductivity to search over

  • +
  • maxConductivity (float, optional) – The maximum conductivity to search over

  • +
  • nSamples (int, optional) – The number of values between the min and max

  • +
+
+
Returns:
+

out – The best fitting log10 conductivity for the half space

+
+
Return type:
+

float64

+
+
+
+ +
+
+plotHalfSpaceResponses(minConductivity=-4.0, maxConductivity=2.0, nSamples=100, **kwargs)
+

Plots the reponses of different half space models.

+
+
Parameters:
+
    +
  • minConductivity (float, optional) – The minimum log10 conductivity to search over

  • +
  • maxConductivity (float, optional) – The maximum log10 conductivity to search over

  • +
  • nInc (int, optional) – The number of increments between the min and max

  • +
+
+
+
+ +
+
+property predictedData
+

The predicted data.

+
+ +
+
+update_posteriors()
+

Update any attached posteriors

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/FdemDataPoint.html b/docs/content/api/classes/data/datapoint/FdemDataPoint.html new file mode 100644 index 00000000..f2c91b1b --- /dev/null +++ b/docs/content/api/classes/data/datapoint/FdemDataPoint.html @@ -0,0 +1,326 @@ + + + + + + + FdemDataPoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

FdemDataPoint

+
Inheritance diagram of geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint
+ + + + + + +

@FdemDataPoint_Class +Module describing a frequency domain EMData Point that contains a single measurement.

+
+
+class geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint(x=0.0, y=0.0, z=0.0, elevation=0.0, data=None, std=None, predictedData=None, system=None, lineNumber=0.0, fiducial=0.0)
+

Class defines a Frequency domain electromagnetic data point.

+

Contains an easting, northing, height, elevation, observed and predicted data, and uncertainty estimates for the data.

+

FdemDataPoint(x, y, z, elevation, data, std, system, lineNumber, fiducial)

+
+
Parameters:
+
    +
  • x (float) – Easting co-ordinate of the data point

  • +
  • y (float) – Northing co-ordinate of the data point

  • +
  • z (float) – Height above ground of the data point

  • +
  • elevation (float, optional) – Elevation from sea level of the data point

  • +
  • data (geobipy.StatArray or array_like, optional) – Data values to assign the data of length 2*number of frequencies. +* If None, initialized with zeros.

  • +
  • std (geobipy.StatArray or array_like, optional) – Estimated uncertainty standard deviation of the data of length 2*number of frequencies. +* If None, initialized with ones if data is None, else 0.1*data values.

  • +
  • system (str or geobipy.FdemSystem, optional) – Describes the acquisition system with loop orientation and frequencies. +* If str should be the path to a system file to read in. +* If geobipy.FdemSystem, will be deepcopied.

  • +
  • lineNumber (float, optional) – The line number associated with the datapoint

  • +
  • fiducial (float, optional) – The fiducial associated with the datapoint

  • +
+
+
+
+
+calibrate(Predicted=True)
+

Apply calibration factors to the data point

+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+forward(mod)
+

Forward model the data from the given model

+
+ +
+
+frequencies(system=0)
+

Return the frequencies in an StatArray

+
+ +
+
+classmethod fromHdf(grp, index=None, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+getFrequency(channel, system=0)
+

Return the measurement frequency of the channel

+
+
Parameters:
+
    +
  • channel (int) – Channel number

  • +
  • system (int, optional) – System number

  • +
+
+
Returns:
+

out – The measurement frequency of the channel

+
+
Return type:
+

float

+
+
+
+ +
+
+getMeasurementType(channel, system=0)
+

Returns the measurement type of the channel

+
+
Parameters:
+
    +
  • channel (int) – Channel number

  • +
  • system (int, optional) – System number

  • +
+
+
Returns:
+

out – Either “In-Phase “ or “Quadrature “

+
+
Return type:
+

str

+
+
+
+ +
+
+plot(title='Frequency Domain EM Data', system=0, with_error_bars=True, **kwargs)
+

Plot the Inphase and Quadrature Data

+
+
Parameters:
+
    +
  • title (str) – Title of the plot

  • +
  • system (int) – If multiple system are present, select which one

  • +
  • with_error_bars (bool) – Plot vertical lines representing 1 standard deviation

  • +
+
+
+
+

See also

+
+
matplotlib.pyplot.errorbar

For more keyword arguements

+
+
+
+
+
Returns:
+

out – Figure axis

+
+
Return type:
+

matplotlib.pyplot.ax

+
+
+
+ +
+
+plot_predicted(title='Frequency Domain EM Data', system=0, **kwargs)
+

Plot the predicted Inphase and Quadrature Data

+
+
Parameters:
+
    +
  • title (str) – Title of the plot

  • +
  • system (int) – If multiple system are present, select which one

  • +
+
+
+
+

See also

+
+
matplotlib.pyplot.semilogx

For more keyword arguements

+
+
+
+
+
Returns:
+

out – Figure axis

+
+
Return type:
+

matplotlib.pyplot.ax

+
+
+
+ +
+
+sensitivity(mod, **kwargs)
+

Compute the sensitivty matrix for the given model

+
+ +
+
+updateSensitivity(model)
+

Compute an updated sensitivity matrix based on the one already containined in the FdemDataPoint object

+
+ +
+
+update_posteriors()
+

Update any attached posteriors

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/TdemDataPoint.html b/docs/content/api/classes/data/datapoint/TdemDataPoint.html new file mode 100644 index 00000000..ccfdfc51 --- /dev/null +++ b/docs/content/api/classes/data/datapoint/TdemDataPoint.html @@ -0,0 +1,398 @@ + + + + + + + TdemDataPoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

TdemDataPoint

+
Inheritance diagram of geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint
+ + + + + + +
+
+class geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint(x=0.0, y=0.0, z=0.0, elevation=0.0, primary_field=None, secondary_field=None, relative_error=None, additive_error=None, std=None, predicted_primary_field=None, predicted_secondary_field=None, system=None, transmitter_loop=None, receiver_loop=None, lineNumber=0.0, fiducial=0.0)
+

Initialize a Time domain EMData Point

+

TdemDataPoint(x, y, z, elevation, data, std, system, transmitter_loop, receiver_loop, lineNumber, fiducial)

+
+
Parameters:
+
    +
  • x (float64) – The easting co-ordinate of the data point

  • +
  • y (float64) – The northing co-ordinate of the data point

  • +
  • z (float64) – The height of the data point above ground

  • +
  • elevation (float64, optional) – The elevation of the data point, default is 0.0

  • +
  • data (list of arrays, optional) – A list of 1D arrays, where each array contains the data in each system. +The arrays are vertically concatenated inside the TdemDataPoint object

  • +
  • std (list of arrays, optional) – A list of 1D arrays, where each array contains the errors in each system. +The arrays are vertically concatenated inside the TdemDataPoint object

  • +
  • system (TdemSystem, optional) – Time domain system class

  • +
  • transmitter_loop (EmLoop, optional) – Transmitter loop class

  • +
  • receiver_loop (EmLoop, optional) – Receiver loop class

  • +
  • lineNumber (float, optional) – The line number associated with the datapoint

  • +
  • fiducial (float, optional) – The fiducial associated with the datapoint

  • +
+
+
Returns:
+

out – A time domain EM sounding

+
+
Return type:
+

TdemDataPoint

+
+
+

Notes

+

The data argument is a set of lists with length equal to the number of systems. +These data are unpacked and vertically concatenated in this class. +The parameter self._data will have length equal to the sum of the number of time gates in each system. +The same is true for the errors, and the predicted data vector.

+
+
+property addressof
+

Print a summary of the EMdataPoint

+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+dualMoment()
+

Returns True if the number of systems is > 1

+
+ +
+
+forward(model)
+

Forward model the data from the given model

+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+property iplotActive
+

Get the active data indices per system. Used for plotting.

+
+ +
+
+off_time(system=0)
+

Return the window times in an StatArray

+
+ +
+
+perturb()
+

Propose a new EM data point given the specified attached propsal distributions

+
+
Parameters:
+
    +
  • newHeight (bool) – Propose a new observation height.

  • +
  • newRelativeError (bool) – Propose a new relative error.

  • +
  • newAdditiveError (bool) – Propose a new additive error.

  • +
  • newCalibration (bool) – Propose new calibration parameters.

  • +
+
+
Returns:
+

out – The proposed data point

+
+
Return type:
+

subclass of EmDataPoint

+
+
+

Notes

+

For each boolean, the associated proposal must have been set.

+
+
Raises:
+

TypeError – If a proposal has not been set on a requested parameter

+
+
+
+ +
+
+plot(title='Time Domain EM Data', with_error_bars=True, **kwargs)
+

Plot the Inphase and Quadrature Data for an EM measurement

+
+ +
+
+property predictedData
+

The predicted data.

+
+ +
+
+property probability
+

Evaluate the probability for the EM data point given the specified attached priors

+
+
Parameters:
+
    +
  • rEerr (bool) – Include the relative error when evaluating the prior

  • +
  • aEerr (bool) – Include the additive error when evaluating the prior

  • +
  • height (bool) – Include the elevation when evaluating the prior

  • +
  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • +
  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

  • +
+
+
Returns:
+

out – The evaluation of the probability using all assigned priors

+
+
Return type:
+

float64

+
+
+

Notes

+

For each boolean, the associated prior must have been set.

+
+
Raises:
+

TypeError – If a prior has not been set on a requested parameter

+
+
+
+ +
+
+read(dataFileName)
+

Read in a time domain data point from a file.

+
+
Parameters:
+

dataFileName (str or list of str) – File names of the data point. Multiple can be given for multiple moments at the same location.

+
+
Returns:
+

out – Time domain data point

+
+
Return type:
+

geobipy.TdemDataPoint

+
+
+
+ +
+
+sensitivity(model, ix=None, model_changed=False)
+

Compute the sensitivty matrix for the given model

+
+ +
+
+set_posteriors(log=10)
+

Set the posteriors based on the attached priors

+
+
Parameters:
+

log

+
+
+
+ +
+
+set_proposals(relative_error_proposal=None, additive_error_proposal=None, **kwargs)
+

Set the proposals on the datapoint’s perturbable parameters

+
+
Parameters:
+
    +
  • heightProposal (geobipy.baseDistribution, optional) – The proposal to attach to the height. Must be univariate

  • +
  • relativeErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, relativeErrorProposal is univariate. +If there are more than one system, relativeErrorProposal is multivariate.

  • +
  • additiveErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, additiveErrorProposal is univariate. +If there are more than one system, additiveErrorProposal is multivariate.

  • +
+
+
+
+ +
+
+property std
+

Updates the data errors

+

Assumes a t^-0.5 behaviour e.g. logarithmic gate averaging +V0 is assumed to be ln(Error @ 1ms)

+
+
Parameters:
+
    +
  • relativeErr (list of scalars or list of array_like) – A fraction percentage that is multiplied by the observed data. The list should have length equal to the number of systems. The entries in each item can be scalar or array_like.

  • +
  • additiveErr (list of scalars or list of array_like) – An absolute value of additive error. The list should have length equal to the number of systems. The entries in each item can be scalar or array_like.

  • +
+
+
Raises:
+
    +
  • TypeError – If relativeErr or additiveErr is not a list

  • +
  • TypeError – If the length of relativeErr or additiveErr is not equal to the number of systems

  • +
  • TypeError – If any item in the relativeErr or additiveErr lists is not a scalar or array_like of length equal to the number of time channels

  • +
  • ValueError – If any relative or additive errors are <= 0.0

  • +
+
+
+
+ +
+
+property summary
+

Print a summary of the EMdataPoint

+
+ +
+
+update_posteriors()
+

Update any attached posteriors

+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/Tempest_dataPoint.html b/docs/content/api/classes/data/datapoint/Tempest_dataPoint.html new file mode 100644 index 00000000..f7b98513 --- /dev/null +++ b/docs/content/api/classes/data/datapoint/Tempest_dataPoint.html @@ -0,0 +1,318 @@ + + + + + + + Tempest_datapoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Tempest_datapoint

+
Inheritance diagram of geobipy.src.classes.data.datapoint.Tempest_datapoint
+ + + + + + + +
+
+class geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint(x=0.0, y=0.0, z=0.0, elevation=0.0, primary_field=None, secondary_field=None, relative_error=None, additive_error=None, std=None, predicted_primary_field=None, predicted_secondary_field=None, system=None, transmitter_loop=None, receiver_loop=None, lineNumber=0.0, fiducial=0.0)
+

Initialize a Tempest Time domain data point

+

TdemDataPoint(x, y, z, elevation, data, std, system, transmitter_loop, receiver_loop, lineNumber, fiducial)

+
+
Parameters:
+
    +
  • x (float64) – The easting co-ordinate of the data point

  • +
  • y (float64) – The northing co-ordinate of the data point

  • +
  • z (float64) – The height of the data point above ground

  • +
  • elevation (float64, optional) – The elevation of the data point, default is 0.0

  • +
  • data (list of arrays, optional) – A list of 1D arrays, where each array contains the data in each system. +The arrays are vertically concatenated inside the TdemDataPoint object

  • +
  • std (list of arrays, optional) – A list of 1D arrays, where each array contains the errors in each system. +The arrays are vertically concatenated inside the TdemDataPoint object

  • +
  • system (TdemSystem, optional) – Time domain system class

  • +
  • transmitter_loop (EmLoop, optional) – Transmitter loop class

  • +
  • receiver_loop (EmLoop, optional) – Receiver loop class

  • +
  • lineNumber (float, optional) – The line number associated with the datapoint

  • +
  • fiducial (float, optional) – The fiducial associated with the datapoint

  • +
+
+
Returns:
+

out – A time domain EM sounding

+
+
Return type:
+

TdemDataPoint

+
+
+

Notes

+

The data argument is a set of lists with length equal to the number of systems. +These data are unpacked and vertically concatenated in this class. +The parameter self._data will have length equal to the sum of the number of time gates in each system. +The same is true for the errors, and the predicted data vector.

+
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+perturb()
+

Propose a new EM data point given the specified attached propsal distributions

+
+
Parameters:
+
    +
  • newHeight (bool) – Propose a new observation height.

  • +
  • newRelativeError (bool) – Propose a new relative error.

  • +
  • newAdditiveError (bool) – Propose a new additive error.

  • +
  • newCalibration (bool) – Propose new calibration parameters.

  • +
+
+
Returns:
+

out – The proposed data point

+
+
Return type:
+

subclass of EmDataPoint

+
+
+

Notes

+

For each boolean, the associated proposal must have been set.

+
+
Raises:
+

TypeError – If a proposal has not been set on a requested parameter

+
+
+
+ +
+
+plot(**kwargs)
+

Plot the Inphase and Quadrature Data for an EM measurement

+
+ +
+
+property predictedData
+

The predicted data.

+
+ +
+
+property probability
+

Evaluate the probability for the EM data point given the specified attached priors

+
+
Parameters:
+
    +
  • rEerr (bool) – Include the relative error when evaluating the prior

  • +
  • aEerr (bool) – Include the additive error when evaluating the prior

  • +
  • height (bool) – Include the elevation when evaluating the prior

  • +
  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • +
  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

  • +
+
+
Returns:
+

out – The evaluation of the probability using all assigned priors

+
+
Return type:
+

float64

+
+
+

Notes

+

For each boolean, the associated prior must have been set.

+
+
Raises:
+

TypeError – If a prior has not been set on a requested parameter

+
+
+
+ +
+
+set_additive_error_posterior(log=None)
+
+ +
+
+set_posteriors(log=None)
+

Set the posteriors based on the attached priors

+
+
Parameters:
+

log

+
+
+
+ +
+
+set_proposals(relative_error_proposal=None, additive_error_proposal=None, **kwargs)
+

Set the proposals on the datapoint’s perturbable parameters

+
+
Parameters:
+
    +
  • heightProposal (geobipy.baseDistribution, optional) – The proposal to attach to the height. Must be univariate

  • +
  • relativeErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, relativeErrorProposal is univariate. +If there are more than one system, relativeErrorProposal is multivariate.

  • +
  • additiveErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, additiveErrorProposal is univariate. +If there are more than one system, additiveErrorProposal is multivariate.

  • +
+
+
+
+ +
+
+set_relative_error_posterior()
+
+ +
+
+property std
+

Updates the data errors

+

Assumes a t^-0.5 behaviour e.g. logarithmic gate averaging +V0 is assumed to be ln(Error @ 1ms)

+
+
Parameters:
+
    +
  • relativeErr (list of scalars or list of array_like) – A fraction percentage that is multiplied by the observed data. The list should have length equal to the number of systems. The entries in each item can be scalar or array_like.

  • +
  • additiveErr (list of scalars or list of array_like) – An absolute value of additive error. The list should have length equal to the number of systems. The entries in each item can be scalar or array_like.

  • +
+
+
Raises:
+
    +
  • TypeError – If relativeErr or additiveErr is not a list

  • +
  • TypeError – If the length of relativeErr or additiveErr is not equal to the number of systems

  • +
  • TypeError – If any item in the relativeErr or additiveErr lists is not a scalar or array_like of length equal to the number of time channels

  • +
  • ValueError – If any relative or additive errors are <= 0.0

  • +
+
+
+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/datapoint.html b/docs/content/api/classes/data/datapoint/datapoint.html new file mode 100644 index 00000000..6d2641b0 --- /dev/null +++ b/docs/content/api/classes/data/datapoint/datapoint.html @@ -0,0 +1,457 @@ + + + + + + + DataPoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

DataPoint

+
Inheritance diagram of geobipy.src.classes.data.datapoint.DataPoint.DataPoint
+ + + + +
+
+class geobipy.src.classes.data.datapoint.DataPoint.DataPoint(x=0.0, y=0.0, z=0.0, elevation=None, data=None, std=None, predictedData=None, units=None, channel_names=None, lineNumber=0.0, fiducial=0.0, **kwargs)
+

Class defines a data point.

+

Contains an easting, northing, height, elevation, observed and predicted data, and uncertainty estimates for the data.

+

DataPoint(x, y, z, elevation, nChannels, data, std, units)

+
+
Parameters:
+
    +
  • nChannelsPerSystem (int or array_like) – Number of data channels in the data +* If int, a single acquisition system is assumed. +* If array_like, each entry is the number of channels for each system.

  • +
  • x (float) – Easting co-ordinate of the data point

  • +
  • y (float) – Northing co-ordinate of the data point

  • +
  • z (float) – Height above ground of the data point

  • +
  • elevation (float, optional) – Elevation from sea level of the data point

  • +
  • data (geobipy.StatArray or array_like, optional) – Data values to assign the data of length sum(nChannelsPerSystem). +* If None, initialized with zeros.

  • +
  • std (geobipy.StatArray or array_like, optional) – Estimated uncertainty standard deviation of the data of length sum(nChannelsPerSystem). +* If None, initialized with ones if data is None, else 0.1*data values.

  • +
  • predictedData (geobipy.StatArray or array_like, optional) – Predicted data values to assign the data of length sum(nChannelsPerSystem). +* If None, initialized with zeros.

  • +
  • units (str, optional) – Units of the data. Default is “ppm”.

  • +
  • channel_names (list of str, optional) – Names of each channel of length sum(nChannelsPerSystem)

  • +
+
+
+
+
+active
+

Gets the indices to the observed data values that are not NaN

+
+
Returns:
+

out – Indices into the observed data that are not NaN

+
+
Return type:
+

array of ints

+
+
+
+ +
+
+property addressof
+

Print a summary of the EMdataPoint

+
+ +
+
+createHdf(parent, myName, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+data_misfit()
+

Compute the \(L_{2}\) norm squared misfit between the observed and predicted data

+
+\[\| \mathbf{W}_{d} (\mathbf{d}^{obs}-\mathbf{d}^{pre})\|_{2}^{2},\]
+

where \(\mathbf{W}_{d}\) are the reciprocal data errors.

+
+
Parameters:
+

squared (bool) – Return the squared misfit.

+
+
Returns:
+

out – The misfit value.

+
+
Return type:
+

float64

+
+
+
+ +
+
+property deltaD
+

Get the difference between the predicted and observed data,

+
+\[\delta \mathbf{d} = \mathbf{d}^{pre} - \mathbf{d}^{obs}.\]
+
+
Returns:
+

out – The residual between the active observed and predicted data +with size equal to the number of active channels.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+classmethod fromHdf(grp, index=None, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+likelihood(log)
+

Compute the likelihood of the current predicted data given the observed data and assigned errors

+
+
Returns:
+

out – Likelihood of the data point

+
+
Return type:
+

float64

+
+
+
+ +
+
+perturb()
+

Propose a new EM data point given the specified attached propsal distributions

+
+
Parameters:
+
    +
  • newHeight (bool) – Propose a new observation height.

  • +
  • newRelativeError (bool) – Propose a new relative error.

  • +
  • newAdditiveError (bool) – Propose a new additive error.

  • +
  • newCalibration (bool) – Propose new calibration parameters.

  • +
+
+
Returns:
+

out – The proposed data point

+
+
Return type:
+

subclass of EmDataPoint

+
+
+

Notes

+

For each boolean, the associated proposal must have been set.

+
+
Raises:
+

TypeError – If a proposal has not been set on a requested parameter

+
+
+
+ +
+
+property predictedData
+

The predicted data.

+
+ +
+
+property probability
+

Evaluate the probability for the EM data point given the specified attached priors

+
+
Parameters:
+
    +
  • rEerr (bool) – Include the relative error when evaluating the prior

  • +
  • aEerr (bool) – Include the additive error when evaluating the prior

  • +
  • height (bool) – Include the elevation when evaluating the prior

  • +
  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • +
  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

  • +
+
+
Returns:
+

out – The evaluation of the probability using all assigned priors

+
+
Return type:
+

float64

+
+
+

Notes

+

For each boolean, the associated prior must have been set.

+
+
Raises:
+

TypeError – If a prior has not been set on a requested parameter

+
+
+
+ +
+
+set_additive_error_posterior(log=10)
+
+ +
+
+set_posteriors(log=10)
+

Set the posteriors based on the attached priors

+
+
Parameters:
+

log

+
+
+
+ +
+
+set_proposals(relative_error_proposal=None, additive_error_proposal=None, **kwargs)
+

Set the proposals on the datapoint’s perturbable parameters

+
+
Parameters:
+
    +
  • heightProposal (geobipy.baseDistribution, optional) – The proposal to attach to the height. Must be univariate

  • +
  • relativeErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, relativeErrorProposal is univariate. +If there are more than one system, relativeErrorProposal is multivariate.

  • +
  • additiveErrorProposal (geobipy.baseDistribution, optional) – The proposal to attach to the relative error. +If the datapoint has only one system, additiveErrorProposal is univariate. +If there are more than one system, additiveErrorProposal is multivariate.

  • +
+
+
+
+ +
+
+set_relative_error_posterior()
+
+ +
+
+property std
+

Compute the data errors.

+
+ +
+
+property summary
+

Print a summary of the EMdataPoint

+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+
+geobipy.src.classes.data.datapoint.DataPoint.randn(d0, d1, ..., dn)
+

Return a sample (or samples) from the “standard normal” distribution.

+
+

Note

+

This is a convenience function for users porting code from Matlab, +and wraps standard_normal. That function takes a +tuple to specify the size of the output, which is consistent with +other NumPy functions like numpy.zeros and numpy.ones.

+
+
+

Note

+

New code should use the standard_normal method of a default_rng() +instance instead; please see the random-quick-start.

+
+

If positive int_like arguments are provided, randn generates an array +of shape (d0, d1, ..., dn), filled +with random floats sampled from a univariate “normal” (Gaussian) +distribution of mean 0 and variance 1. A single float randomly sampled +from the distribution is returned if no argument is provided.

+
+
Parameters:
+
    +
  • d0 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • d1 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • ... (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • dn (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
+
+
Returns:
+

Z – A (d0, d1, ..., dn)-shaped array of floating-point samples from +the standard normal distribution, or a single such float if +no parameters were supplied.

+
+
Return type:
+

ndarray or float

+
+
+
+

See also

+
+
standard_normal

Similar, but takes a tuple as its argument.

+
+
normal

Also accepts mu and sigma arguments.

+
+
random.Generator.standard_normal

which should be used for new code.

+
+
+
+

Notes

+

For random samples from \(N(\mu, \sigma^2)\), use:

+

sigma * np.random.randn(...) + mu

+

Examples

+
>>> np.random.randn()
+2.1923875335537315  # random
+
+
+

Two-by-four array of samples from N(3, 6.25):

+
>>> 3 + 2.5 * np.random.randn(2, 4)
+array([[-4.49401501,  4.00950034, -1.81814867,  7.29718677],   # random
+       [ 0.39924804,  4.68456316,  4.99394529,  4.84057254]])  # random
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/datapoint/datapointrst.html b/docs/content/api/classes/data/datapoint/datapointrst.html new file mode 100644 index 00000000..256fc975 --- /dev/null +++ b/docs/content/api/classes/data/datapoint/datapointrst.html @@ -0,0 +1,148 @@ + + + + + + + Datapoint classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Datapoint classes

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/dataset/Data.html b/docs/content/api/classes/data/dataset/Data.html new file mode 100644 index 00000000..f5923064 --- /dev/null +++ b/docs/content/api/classes/data/dataset/Data.html @@ -0,0 +1,595 @@ + + + + + + + Data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

Data

+
Inheritance diagram of geobipy.src.classes.data.dataset.Data.Data
+ + + + +

@Data_Class +Module describing a Data Set where values are associated with an xyz co-ordinate

+
+
+class geobipy.src.classes.data.dataset.Data.Data(components=None, channels_per_system=1, x=None, y=None, z=None, elevation=None, data=None, std=None, predictedData=None, fiducial=None, lineNumber=None, units=None, channel_names=None, **kwargs)
+

Class defining a set of Data.

+

Data(channels_per_system, x, y, z, data, std, predictedData, dataUnits, channel_names)

+
+
Parameters:
+
    +
  • nPoints (int) – Number of points in the data.

  • +
  • channels_per_system (int or array_like) – Number of data channels in the data +* If int, a single acquisition system is assumed. +* If array_like, each item describes the number of points per acquisition system.

  • +
  • x (geobipy.StatArray or array_like, optional) – The x co-ordinates. Default is zeros of size nPoints.

  • +
  • y (geobipy.StatArray or array_like, optional) – The y co-ordinates. Default is zeros of size nPoints.

  • +
  • z (geobipy.StatArrayor array_like, optional) – The z co-ordinates. Default is zeros of size nPoints.

  • +
  • data (geobipy.StatArrayor array_like, optional) – The values of the data. +* If None, zeroes are assigned

  • +
  • std (geobipy.StatArrayor array_like, optional) – The uncertainty estimates of the data. +* If None, ones are assigned if data is None, else 0.1*data

  • +
  • predictedData (geobipy.StatArrayor array_like, optional) – The predicted data. +* If None, zeros are assigned.

  • +
  • dataUnits (str) – Units of the data.

  • +
  • channel_names (list of str, optional) – Names of each channel of length sum(channels_per_system)

  • +
+
+
Returns:
+

out – Data class

+
+
Return type:
+

Data

+
+
+
+
+Bcast(world, root=0)
+

Broadcast a Data object using MPI

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.COMM_WORLD) – MPI communicator

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – Data broadcast to each core in the communicator

+
+
Return type:
+

geobipy.Data

+
+
+
+ +
+
+Scatterv(starts, chunks, world, root=0)
+

Scatterv a Data object using MPI

+
+
Parameters:
+
    +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • world (mpi4py.MPI.Comm) – The MPI communicator over which to Scatterv.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The Data distributed amongst ranks.

+
+
Return type:
+

geobipy.Data

+
+
+
+ +
+
+property active
+

Logical array whether the channel is active or not.

+

An inactive channel is one where channel values are NaN for all points.

+
+
Returns:
+

out – Indices of non-NaN columns.

+
+
Return type:
+

bools

+
+
+
+ +
+
+addToVTK(vtk, prop=['data', 'predicted', 'std'], system=None)
+

Adds a member to a VTK handle.

+
+
Parameters:
+
    +
  • vtk (pyvtk.VtkData) – vtk handle returned from self.vtkStructure()

  • +
  • prop (str or list of str, optional) – List of the member to add to a VTK handle, either “data”, “predicted”, or “std”.

  • +
  • system (int, optional) – The system for which to add the data

  • +
+
+
+
+ +
+
+property additive_error
+

The data.

+
+ +
+
+append(other)
+

Append pointclouds together

+
+
Parameters:
+

other (geobipy.PointCloud3D) – 3D pointcloud

+
+
+
+ +
+
+channel_index(channel, system)
+

Gets the data in the specified channel

+
+
Parameters:
+
    +
  • channel (int) – Index of the channel to return +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
+
+
Returns:
+

out – The index of the channel

+
+
Return type:
+

int

+
+
+
+ +
+
+createHdf(parent, myName, withPosterior=True, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+property data
+

The data.

+
+ +
+
+data_misfit(squared=False)
+

Compute the \(L_{2}\) norm squared misfit between the observed and predicted data

+
+\[\| \mathbf{W}_{d} (\mathbf{d}^{obs}-\mathbf{d}^{pre})\|_{2}^{2},\]
+

where \(\mathbf{W}_{d}\) are the reciprocal data errors.

+
+
Parameters:
+

squared (bool) – Return the squared misfit.

+
+
Returns:
+

out – The misfit value.

+
+
Return type:
+

float64

+
+
+
+ +
+
+datapoint(i)
+

Get the ith data point from the data set

+
+
Parameters:
+

i (int) – The data point to get

+
+
Returns:
+

out – The data point

+
+
Return type:
+

geobipy.DataPoint

+
+
+
+ +
+
+property deltaD
+

Get the difference between the predicted and observed data,

+
+\[\delta \mathbf{d} = \mathbf{d}^{pre} - \mathbf{d}^{obs}.\]
+
+
Returns:
+

out – The residual between the active observed and predicted data.

+
+
Return type:
+

StatArray

+
+
+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+line(line)
+

Get the data from the given line number

+
+ +
+
+mapData(channel, system=None, *args, **kwargs)
+

Interpolate the data channel between the x, y co-ordinates.

+
+
Parameters:
+
    +
  • channel (int) – Index of the channel to return +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
+
+
+
+ +
+
+mapPredictedData(channel, system=None, *args, **kwargs)
+

Interpolate the predicted data channel between the x, y co-ordinates.

+
+
Parameters:
+
    +
  • channel (int) – Index of the channel to return +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
+
+
+
+ +
+
+mapStd(channel, system=None, *args, **kwargs)
+

Interpolate the standard deviation channel between the x, y co-ordinates.

+
+
Parameters:
+
    +
  • channel (int) – Index of the channel to return +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
+
+
+
+ +
+
+nPointsPerLine()
+

Gets the number of points in each line.

+
+
Returns:
+

out – Number of points in each line

+
+
Return type:
+

ints

+
+
+
+ +
+
+plot_data(x='index', channels=None, system=None, **kwargs)
+

Plots the specifed channels as a line plot.

+

Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.

+
+
Parameters:
+
    +
  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

  • +
  • channels (ints, optional) – Indices of the channels to plot. All are plotted if None +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • values (arraylike, optional) – Specifies values to plot against the chosen axis. Takes precedence over channels.

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
  • legend (bool) – Attach a legend to the plot. Default is True.

  • +
+
+
Returns:
+

    +
  • ax (matplotlib.axes) – Plot axes handle

  • +
  • legend (matplotlib.legend.Legend) – The attached legend.

  • +
+

+
+
+
+

See also

+
+
geobipy.plotting.plot

For additional keyword arguments

+
+
+
+
+ +
+
+plot_predicted(xAxis='index', channels=None, system=None, **kwargs)
+

Plots the specifed predicted data channels as a line plot.

+

Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.

+
+
Parameters:
+
    +
  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

  • +
  • channels (ints, optional) – Indices of the channels to plot. All are plotted if None +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
  • noLegend (bool) – Do not attach a legend to the plot. Default is False, a legend is attached.

  • +
+
+
Returns:
+

    +
  • ax (matplotlib.axes) – Plot axes handle

  • +
  • legend (matplotlib.legend.Legend) – The attached legend.

  • +
+

+
+
+
+

See also

+
+
geobipy.plotting.plot

For additional keyword arguments

+
+
+
+
+ +
+
+property predictedData
+

The predicted data.

+
+ +
+
+classmethod read_csv(data_filename, **kwargs)
+

Reads the data and system parameters from file

+
+
Parameters:
+
    +
  • dataFilename (str or list of str) – Time domain data file names

  • +
  • systemFilename (str or list of str) – Time domain system file names

  • +
+
+
+

Notes

+

File Format

+

The data columns are read in according to the column names in the first line. The header line should contain at least the following column names. Extra columns may exist, but will be ignored. In this description, the column name or its alternatives are given followed by what the name represents. Optional columns are also described.

+

Required columns

+
+
line

Line number for the data point

+
+
id or fid

Id number of the data point, these be unique

+
+
x or northing or n

Northing co-ordinate of the data point

+
+
y or easting or e

Easting co-ordinate of the data point

+
+
z or dtm or dem_elev or dem_np or topo

Elevation of the ground at the data point

+
+
alt or laser or bheight

Altitude of the transmitter coil

+
+
Off[0] to Off[nWindows-1] (with the number and brackets)

The measurements for each time specified in the accompanying system file under Receiver Window Times

+
+
+

Optional columns

+

If any loop orientation columns are omitted the loop is assumed to be horizontal.

+
+
TxPitch

Pitch of the transmitter loop

+
+
TxRoll

Roll of the transmitter loop

+
+
TxYaw

Yaw of the transmitter loop

+
+
RxPitch

Pitch of the receiver loop

+
+
RxRoll

Roll of the receiver loop

+
+
RxYaw

Yaw of the receiver loop

+
+
OffErr[0] to ErrOff[nWindows-1]

Error estimates for the data

+
+
+
+

See also

+

INFORMATION

+
+
+ +
+
+property relative_error
+

The data.

+
+ +
+
+property std
+

The data.

+
+ +
+
+property summary
+

Display a summary of the Data

+
+ +
+
+writeHdf(parent, name, withPosterior=True)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/dataset/FdemData.html b/docs/content/api/classes/data/dataset/FdemData.html new file mode 100644 index 00000000..c7ee4ef0 --- /dev/null +++ b/docs/content/api/classes/data/dataset/FdemData.html @@ -0,0 +1,470 @@ + + + + + + + FdemData — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

FdemData

+
Inheritance diagram of geobipy.src.classes.data.dataset.FdemData
+ + + + + +

@FdemData_Class +Module describing an EMData Set where channels are associated with an xyz co-ordinate

+
+
+class geobipy.src.classes.data.dataset.FdemData.FdemData(system=None, **kwargs)
+

Class extension to geobipy.Data defining a Fourier domain electro magnetic data set

+

FdemData(nPoints, nFrequencies, system)

+
+
Parameters:
+
    +
  • nPoints (int, optional) – Number of observations in the data set

  • +
  • nFrequencies (int, optional) – Number of measurement frequencies

  • +
  • system (str or geobipy.FdemSystem, optional) –

      +
    • If str: Must be a file name from which to read FD system information.

    • +
    • If FdemSystem: A deepcopy is made.

    • +
    +

  • +
+
+
Returns:
+

out – Contains x, y, z, elevation, and data values for a frequency domain dataset.

+
+
Return type:
+

FdemData

+
+
+

Notes

+

FdemData.read() requires a data filename and a system class or system filename to be specified. +The data file is structured using columns with the first line containing header information. +The header should contain the following entries +Line [ID or FID] [X or N or northing] [Y or E or easting] [Z or DTM or dem_elev] [Alt or Laser or bheight] [I Q] … [I Q] +Do not include brackets [] +[I Q] are the in-phase and quadrature values for each measurement frequency.

+

If a system filename is given, it too is structured using columns with the first line containing header information +Each subsequent row contains the information for each measurement frequency

+

freq tor tmom tx ty tz ror rmom rx ry rz +378 z 1 0 0 0 z 1 7.93 0 0 +1776 z 1 0 0 0 z 1 7.91 0 0 +…

+

where tor and ror are the orientations of the transmitter/reciever loops [x or z]. +tmom and rmom are the moments of the loops. +t/rx,y,z are the loop offsets from the observation locations in the data file.

+
+
+Bcast(world, root=0)
+

Broadcast the FdemData using MPI

+
+
Parameters:
+

world (mpi4py.MPI.COMM_WORLD) – MPI communicator

+
+
Returns:
+

out – A copy of the data on each core

+
+
Return type:
+

geobipy.FdemData

+
+
+

Examples

+
>>> from mpi4py import MPI
+>>> from geobipy import FdemData
+
+
+
>>> world = MPI.COMM_WORLD
+
+
+
>>> rank = world.rank
+
+
+
>>> if (rank == 0): # Only the master reads in the data
+>>>     D = FdemData()
+>>>     D.read(dataFile, systemFile)
+>>> else:
+>>>     D = FdemData() # Must instantiate an empty object to Bcast
+
+
+
>>> D2 = D.Bcast(world)
+
+
+
+ +
+
+Scatterv(starts, chunks, world, root=0)
+

Distributes the FdemData between all cores using MPI

+
+
Parameters:
+
    +
  • starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.

  • +
  • chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.

  • +
  • world (mpi4py.MPI.COMM_WORLD) – The MPI communicator

  • +
+
+
Returns:
+

out – The data distributed amongst cores

+
+
Return type:
+

geobipy.FdemData

+
+
+

Examples

+
>>> from mpi4py import MPI
+>>> from geobipy import FdemData
+>>> import numpy as np
+
+
+
>>> world = MPI.COMM_WORLD
+
+
+
>>> rank = world.rank
+
+
+
>>> if (rank == 0): # Only the master reads in the data
+>>>     D = FdemData()
+>>>     D.read(dataFile, systemFile)
+>>> else:
+>>>     D = FdemData() # Must instantiate an empty object to Bcast
+
+
+
>>> # In this example, assume there are 10 data and 4 cores
+>>> start = asarray([0, 2, 4, 6])
+>>> chunks = asarray([2, 2, 2, 4])
+
+
+
>>> D2 = D.Scatterv(start, chunks, world)
+
+
+
+ +
+
+append(other)
+

Append pointclouds together

+
+
Parameters:
+

other (geobipy.PointCloud3D) – 3D pointcloud

+
+
+
+ +
+
+createHdf(parent, myName, withPosterior=True, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+datapoint(index=None, fiducial=None)
+

Get the ith data point from the data set

+
+
Parameters:
+
    +
  • index (int, optional) – Index of the data point to get.

  • +
  • fiducial (float, optional) – Fiducial of the data point to get.

  • +
+
+
Returns:
+

out – The data point.

+
+
Return type:
+

geobipy.FdemDataPoint

+
+
Raises:
+

Exception – If neither an index or fiducial are given.

+
+
+
+ +
+
+fileInformation()
+

Description of the data file.

+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+getFrequency(channel, system=0)
+

Return the measurement frequency of the channel

+
+
Parameters:
+
    +
  • channel (int) – Channel number

  • +
  • system (int, optional) – System number

  • +
+
+
Returns:
+

out – The measurement frequency of the channel

+
+
Return type:
+

float

+
+
+
+ +
+
+getMeasurementType(channel, system=0)
+

Returns the measurement type of the channel

+
+
Parameters:
+
    +
  • channel (int) – Channel number

  • +
  • system (int, optional) – System number

  • +
+
+
Returns:
+

out – Either “In-Phase “ or “Quadrature “

+
+
Return type:
+

str

+
+
+
+ +
+
+property nActiveData
+

Number of active data per data point.

+

For each data point, counts the number of channels that are NOT nan.

+
+
Returns:
+

out – Number of active data

+
+
Return type:
+

int

+
+
+
+ +
+
+plotLine(line, system=0, x='index', **kwargs)
+

Plot the specified line

+
+ +
+
+plot_data(x='index', channels=None, **kwargs)
+

Plots the specifed channels as a line plot.

+

Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.

+
+
Parameters:
+
    +
  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

  • +
  • channels (ints, optional) – The indices of the channels to plot. All are plotted if channels is None.

  • +
  • legend (bool) – Attach a legend to the plot. Default is True.

  • +
+
+
Returns:
+

    +
  • ax (matplotlib.axes) – Plot axes handle

  • +
  • legend (matplotlib.legend.Legend) – The attached legend.

  • +
+

+
+
+
+

See also

+
+
geobipy.plotting.plot

For additional keyword arguments

+
+
+
+
+ +
+
+readAarhusFile(dataFilename)
+

Read in frequency domain data from an Aarhus workbench file.

+
+
Parameters:
+

dataFilename (str) – The data file.

+
+
+
+ +
+
+classmethod read_csv(dataFilename, systemFilename)
+

Read in both the Fdem data and FDEM system files

+

The data file is structured using columns with the first line containing header information. +The header should contain the following entries +Line [ID or FID] [X or N or northing] [Y or E or easting] [Z or DTM or dem_elev] [Alt or Laser or bheight] [I Q] … [I Q] +Do not include brackets [] +[I Q] are the in-phase and quadrature values for each measurement frequency.

+

If a system filename is given, it too is structured using columns with the first line containing header information +Each subsequent row contains the information for each measurement frequency

+

freq tor tmom tx ty tz ror rmom rx ry rz +378 z 1 0 0 0 z 1 7.93 0 0 +1776 z 1 0 0 0 z 1 7.91 0 0 +…

+

where tor and ror are the orientations of the transmitter/reciever loops [x or z]. +tmom and rmom are the moments of the loops. +t/rx,y,z are the loop offsets from the observation locations in the data file.

+
+ +
+
+single
+

alias of FdemDataPoint

+
+ +
+
+property std
+

The data.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/dataset/TdemData.html b/docs/content/api/classes/data/dataset/TdemData.html new file mode 100644 index 00000000..16abf916 --- /dev/null +++ b/docs/content/api/classes/data/dataset/TdemData.html @@ -0,0 +1,445 @@ + + + + + + + TdemData — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

TdemData

+
Inheritance diagram of geobipy.src.classes.data.dataset.TdemData
+ + + + + +
+
+class geobipy.src.classes.data.dataset.TdemData.TdemData(system=None, **kwargs)
+

Time domain electro magnetic data set

+

A time domain data set with easting, northing, height, and elevation values. Each sounding in the data set can be given a receiver and transmitter loop.

+

TdemData(nPoints=1, nTimes=[1], nSystems=1)

+
+
Parameters:
+
    +
  • nPoints (int, optional) – Number of soundings in the data file

  • +
  • nTimes (array of ints, optional) – Array of size nSystemsx1 containing the number of time gates in each system

  • +
  • nSystem (int, optional) – Number of measurement systems

  • +
+
+
Returns:
+

out – Time domain data set

+
+
Return type:
+

TdemData

+
+
+
+

See also

+
+
read()

For information on file format

+
+
+
+
+
+Bcast(world, root=0, system=None)
+

Broadcast the TdemData using MPI

+
+ +
+
+Scatterv(starts, chunks, world, root=0, system=None)
+

Scatterv the TdemData using MPI

+
+ +
+
+append(other)
+

Append pointclouds together

+
+
Parameters:
+

other (geobipy.PointCloud3D) – 3D pointcloud

+
+
+
+ +
+
+createHdf(parent, myName, withPosterior=True, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+property data
+

The data.

+
+ +
+
+datapoint(index=None, fiducial=None)
+

Get the ith data point from the data set

+
+
Parameters:
+
    +
  • index (int, optional) – Index of the data point to get.

  • +
  • fiducial (float, optional) – Fiducial of the data point to get.

  • +
+
+
Returns:
+

out – The data point.

+
+
Return type:
+

geobipy.FdemDataPoint

+
+
Raises:
+

Exception – If neither an index or fiducial are given.

+
+
+
+ +
+
+estimateAdditiveError()
+

Uses the late times after 1ms to estimate the additive errors and error bounds in the data.

+
+ +
+
+static fileInformation()
+

Description of PointCloud3D file.

+
+
Returns:
+

out – File description.

+
+
Return type:
+

str

+
+
+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+mapChannel(channel, system=0, *args, **kwargs)
+

Create a map of the specified data channel

+
+ +
+
+property nPoints
+

Get the number of points

+
+ +
+
+off_time(system=0)
+

Obtain the times from the system file

+
+ +
+
+pcolor(component=0, system=0, yAxis='index', **kwargs)
+

Plot the data in the given system as a 2D array

+
+ +
+
+plot_data(*args, **kwargs)
+

Plots the data

+
+
Parameters:
+
    +
  • system (int) – System to plot

  • +
  • channels (sequence of ints) – Channels to plot

  • +
+
+
+
+ +
+
+plot_predicted(*args, **kwargs)
+

Plots the specifed predicted data channels as a line plot.

+

Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.

+
+
Parameters:
+
    +
  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

  • +
  • channels (ints, optional) – Indices of the channels to plot. All are plotted if None +* If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]

  • +
  • system (int, optional) – The system to obtain the channel from.

  • +
  • noLegend (bool) – Do not attach a legend to the plot. Default is False, a legend is attached.

  • +
+
+
Returns:
+

    +
  • ax (matplotlib.axes) – Plot axes handle

  • +
  • legend (matplotlib.legend.Legend) – The attached legend.

  • +
+

+
+
+
+

See also

+
+
geobipy.plotting.plot

For additional keyword arguments

+
+
+
+
+ +
+
+property predicted_primary_field
+

The data.

+
+ +
+
+property predicted_secondary_field
+

The data.

+
+ +
+
+property primary_field
+

The data.

+
+ +
+
+classmethod read_csv(data_filename, system_filename)
+

Reads the data and system parameters from file

+
+
Parameters:
+
    +
  • dataFilename (str or list of str) – Time domain data file names

  • +
  • systemFilename (str or list of str) – Time domain system file names

  • +
+
+
+

Notes

+

File Format

+

The data columns are read in according to the column names in the first line. The header line should contain at least the following column names. Extra columns may exist, but will be ignored. In this description, the column name or its alternatives are given followed by what the name represents. Optional columns are also described.

+

Required columns

+
+
line

Line number for the data point

+
+
id or fid

Id number of the data point, these be unique

+
+
x or northing or n

Northing co-ordinate of the data point

+
+
y or easting or e

Easting co-ordinate of the data point

+
+
z or dtm or dem_elev or dem_np or topo

Elevation of the ground at the data point

+
+
alt or laser or bheight

Altitude of the transmitter coil

+
+
Off[0] to Off[nWindows-1] (with the number and brackets)

The measurements for each time specified in the accompanying system file under Receiver Window Times

+
+
+

Optional columns

+

If any loop orientation columns are omitted the loop is assumed to be horizontal.

+
+
TxPitch

Pitch of the transmitter loop

+
+
TxRoll

Roll of the transmitter loop

+
+
TxYaw

Yaw of the transmitter loop

+
+
RxPitch

Pitch of the receiver loop

+
+
RxRoll

Roll of the receiver loop

+
+
RxYaw

Yaw of the receiver loop

+
+
OffErr[0] to ErrOff[nWindows-1]

Error estimates for the data

+
+
+
+

See also

+

INFORMATION

+
+
+ +
+
+property secondary_field
+

The data.

+
+ +
+
+single
+

alias of TdemDataPoint

+
+ +
+
+property std
+

The data.

+
+ +
+
+property summary
+

Display a summary of the Data

+
+ +
+
+writeHdf(parent, name, withPosterior=True)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/dataset/TempestData.html b/docs/content/api/classes/data/dataset/TempestData.html new file mode 100644 index 00000000..059ab3af --- /dev/null +++ b/docs/content/api/classes/data/dataset/TempestData.html @@ -0,0 +1,342 @@ + + + + + + + TempestData — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

TempestData

+
Inheritance diagram of geobipy.src.classes.data.dataset.TempestData
+ + + + + + +
+
+class geobipy.src.classes.data.dataset.TempestData.TempestData(*args, **kwargs)
+

Time domain electro magnetic data set

+

A time domain data set with easting, northing, height, and elevation values. Each sounding in the data set can be given a receiver and transmitter loop.

+

TdemData(nPoints=1, nTimes=[1], nSystems=1)

+
+
Parameters:
+
    +
  • nPoints (int, optional) – Number of soundings in the data file

  • +
  • nTimes (array of ints, optional) – Array of size nSystemsx1 containing the number of time gates in each system

  • +
  • nSystem (int, optional) – Number of measurement systems

  • +
+
+
Returns:
+

out – Time domain data set

+
+
Return type:
+

TdemData

+
+
+
+

See also

+
+
read()

For information on file format

+
+
+
+
+
+property additive_error
+

The data.

+
+ +
+
+classmethod fromHdf(grp, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+plot_data(system=0, channels=None, x='index', **kwargs)
+

Plots the data

+
+
Parameters:
+
    +
  • system (int) – System to plot

  • +
  • channels (sequence of ints) – Channels to plot

  • +
+
+
+
+ +
+
+plot_predicted(system=0, channels=None, xAxis='index', **kwargs)
+

Plots the data

+
+
Parameters:
+
    +
  • system (int) – System to plot

  • +
  • channels (sequence of ints) – Channels to plot

  • +
+
+
+
+ +
+
+classmethod read_csv(data_filename, system_filename)
+

Reads the data and system parameters from file

+
+
Parameters:
+
    +
  • dataFilename (str or list of str) – Time domain data file names

  • +
  • systemFilename (str or list of str) – Time domain system file names

  • +
+
+
+

Notes

+

File Format

+

The data columns are read in according to the column names in the first line. The header line should contain at least the following column names. Extra columns may exist, but will be ignored. In this description, the column name or its alternatives are given followed by what the name represents. Optional columns are also described.

+

Required columns

+
+
line

Line number for the data point

+
+
id or fid

Id number of the data point, these be unique

+
+
x or northing or n

Northing co-ordinate of the data point

+
+
y or easting or e

Easting co-ordinate of the data point

+
+
z or dtm or dem_elev or dem_np or topo

Elevation of the ground at the data point

+
+
alt or laser or bheight

Altitude of the transmitter coil

+
+
Off[0] to Off[nWindows-1] (with the number and brackets)

The measurements for each time specified in the accompanying system file under Receiver Window Times

+
+
+

Optional columns

+

If any loop orientation columns are omitted the loop is assumed to be horizontal.

+
+
TxPitch

Pitch of the transmitter loop

+
+
TxRoll

Roll of the transmitter loop

+
+
TxYaw

Yaw of the transmitter loop

+
+
RxPitch

Pitch of the receiver loop

+
+
RxRoll

Roll of the receiver loop

+
+
RxYaw

Yaw of the receiver loop

+
+
OffErr[0] to ErrOff[nWindows-1]

Error estimates for the data

+
+
+
+

See also

+

INFORMATION

+
+
+ +
+
+classmethod read_netcdf(dataFilename, systemFilename, indices=None)
+

Reads the data and system parameters from file

+
+
Parameters:
+
    +
  • dataFilename (str or list of str) – Time domain data file names

  • +
  • systemFilename (str or list of str) – Time domain system file names

  • +
+
+
+

Notes

+

File Format +The data columns are read in according to the column names in the first line. The header line should contain at least the following column names. Extra columns may exist, but will be ignored. In this description, the column name or its alternatives are given followed by what the name represents. Optional columns are also described.

+

Required columns

+
+
line

Line number for the data point

+
+
id or fid

Id number of the data point, these be unique

+
+
x or northing or n

Northing co-ordinate of the data point

+
+
y or easting or e

Easting co-ordinate of the data point

+
+
z or dtm or dem_elev or dem_np or topo

Elevation of the ground at the data point

+
+
alt or laser or bheight

Altitude of the transmitter coil

+
+
Off[0] to Off[nWindows-1] (with the number and brackets)

The measurements for each time specified in the accompanying system file under Receiver Window Times

+
+
+

Optional columns +If any loop orientation columns are omitted the loop is assumed to be horizontal.

+
+
TxPitch

Pitch of the transmitter loop

+
+
TxRoll

Roll of the transmitter loop

+
+
TxYaw

Yaw of the transmitter loop

+
+
RxPitch

Pitch of the receiver loop

+
+
RxRoll

Roll of the receiver loop

+
+
RxYaw

Yaw of the receiver loop

+
+
OffErr[0] to ErrOff[nWindows-1]

Error estimates for the data

+
+
+
+

See also

+

INFORMATION

+
+
+ +
+
+property relative_error
+

The data.

+
+ +
+
+single
+

alias of Tempest_datapoint

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/data/dataset/dataset.html b/docs/content/api/classes/data/dataset/dataset.html new file mode 100644 index 00000000..1f8cce62 --- /dev/null +++ b/docs/content/api/classes/data/dataset/dataset.html @@ -0,0 +1,148 @@ + + + + + + + Dataset classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Dataset classes

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/mesh/RectilinearMesh1D.html b/docs/content/api/classes/mesh/RectilinearMesh1D.html new file mode 100644 index 00000000..58869469 --- /dev/null +++ b/docs/content/api/classes/mesh/RectilinearMesh1D.html @@ -0,0 +1,573 @@ + + + + + + + RectilinearMesh1D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

RectilinearMesh1D

+
Inheritance diagram of geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D
+ + + +

@RectilinearMesh1D_Class +Module describing a 1D Rectilinear Mesh class

+
+
+class geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D(centres=None, edges=None, widths=None, log=None, relativeTo=None, dimension=0)
+

Class defining a 1D rectilinear mesh with cell centres and edges.

+

Contains a simple 1D mesh with cell edges, widths, and centre locations.

+

RectilinearMesh1D(centres, edges, edgesMin, edgesMax)

+
+
Parameters:
+
    +
  • centres (geobipy.StatArray, optional) – The locations of the centre of each cell. Only centres, edges, or widths can be given.

  • +
  • edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges. Only centres, edges, or widths can be given.

  • +
  • widths (geobipy.StatArray, optional) – The widths of the cells.

  • +
  • log ('e' or float, optional) – Entries are given in linear space, but internally cells are logged. +Plotting is in log space.

  • +
  • relativeTo (float, optional) – If a float is given, updates will be relative to this value.

  • +
+
+
Returns:
+

out – The 1D mesh.

+
+
Return type:
+

RectilinearMesh1D

+
+
Raises:
+
    +
  • Exception – If both centres and edges are given.

  • +
  • TypeError – centres must be a geobipy.StatArray.

  • +
  • TypeError – edges must be a geobipy.StatArray.

  • +
+
+
+
+
+cellIndex(values, clip=False, trim=False, **kwargs)
+

Get the index to the cell that each value in values falls in.

+
+
Parameters:
+
    +
  • values (array_like) – The values to find the cell indices for

  • +
  • clip (bool) – A negative index which would normally wrap will clip to 0 and self.bins.size instead.

  • +
  • trim (bool) – Do not include out of axis indices. Negates clip, since they wont be included in the output.

  • +
+
+
Returns:
+

out – The cell indices

+
+
Return type:
+

array_like

+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None, upcast=True)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+delete_edge(i, values=None)
+

Delete an edge from the mesh

+
+
Parameters:
+

i (int) – The edge to remove.

+
+
Returns:
+

out – Mesh with edge removed.

+
+
Return type:
+

RectilinearMesh1D

+
+
+
+ +
+
+classmethod fromHdf(grp, index=None, skip_posterior=False)
+

Reads in the object froma HDF file

+
+ +
+
+gradient(values)
+

Compute the gradient

+

Parameter gradient \(\nabla_{z}\sigma\) at the ith layer is computed via

+
+(1)\[\nabla_{z}^{i}\sigma = \frac{\sigma_{i+1} - \sigma_{i}}{h_{i} - h_{min}}\]
+

where \(\sigma_{i+1}\) and \(\sigma_{i}\) are the log-parameters on either side of an interface, \(h_{i}\) is the log-thickness of the ith layer, and \(h_{min}\) is the minimum log thickness defined by

+
+(2)\[h_{min} = \frac{z_{max} - z_{min}}{2 k_{max}}\]
+

where \(k_{max}\) is a maximum number of layers, set to be far greater than the expected final solution.

+
+ +
+
+hdfName()
+

Reprodicibility procedure

+
+ +
+
+in_bounds(values)
+

Return whether values are inside the cell edges

+
+
Parameters:
+

values (array_like) – Check if these are inside left <= values < right.

+
+
Returns:
+

out – Are the values inside.

+
+
Return type:
+

bools

+
+
+
+ +
+
+insert_edge(value, values=None)
+

Insert a new edge.

+
+
Parameters:
+

value (numpy.float64) – Location at which to insert a new edge

+
+
Returns:
+

out – Mesh with inserted edge.

+
+
Return type:
+

geobipy.RectilinearMesh1D

+
+
+
+ +
+
+map_to_pdf(distribution, pdf, log=False, axis=0)
+

Creates a Hitmap from the model given the variance of each layer.

+

For each depth, creates a normal distribution with a mean equal to the interpolated parameter +at that depth and variance specified with variance.

+
+
Parameters:
+
    +
  • variance (array_like) – The variance of each layer

  • +
  • Hitmap (geobipy.Hitmap) – Hitmap to convert the model to. +Must be instantiated before calling so that the model can be interpolated correctly

  • +
+
+
+
+ +
+
+mask_cells(distance, values=None)
+

Mask cells by a distance.

+

If the edges of the cell are further than distance away, extra cells are inserted such that +the cell’s new edges are at distance away from the centre.

+
+
Parameters:
+
    +
  • distance (float) – Distance to mask

  • +
  • values (array_like, optional) – If given, values will be remapped to the masked mesh.

  • +
+
+
Returns:
+

    +
  • out (RectilinearMesh1D) – Masked mesh

  • +
  • indices (ints) – Location of the original centres in the expanded mesh

  • +
  • out_values (array_like, optional) – If values is given, values will be remapped to the masked mesh.

  • +
+

+
+
+
+ +
+
+pad(size)
+

Copies the properties of a mesh including all priors or proposals, but pads memory to the given size

+
+
Parameters:
+

size (int) – Create memory upto this size.

+
+
Returns:
+

out – Padded mesg

+
+
Return type:
+

RectilinearMesh1D

+
+
+
+ +
+
+pcolor(values, **kwargs)
+

Create a pseudocolour plot.

+

Can take any other matplotlib arguments and keyword arguments e.g. cmap etc.

+
+
Parameters:
+
    +
  • values (array_like) – The value of each cell.

  • +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
+
+

See also

+
+
geobipy.plotting.pcolor

For non matplotlib keywords.

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+perturb(values=None)
+

Perturb the mesh

+

Generates a new mesh by perturbing the current mesh based on four probabilities. +The probabilities correspond to +* Birth, the insertion of a new interface +* Death, the deletion of an interface +* Change, change one the existing interfaces +* No change, do nothing and return the original

+

The methods.set_priors and setProposals must be used before calling self.perturb.

+

If an interface is created, or an interface perturbed, any resulting cell width must be greater than the minimum width \(h_{min}\). +If the new cell width test fails, the birth or perturbation tries again. If the cycle fails after 10 tries, the entire process begins again +such that a death, or no change is possible thus preventing any never-ending cycles.

+
+
Returns:
+

out – The perturbed mesh

+
+
Return type:
+

RectilinearMesh1D

+
+
+
+

See also

+
+
RectilinearMesh1D.set_priors

Must be used before calling self.perturb

+
+
RectilinearMesh1D.setProposals

Must be used before calling self.perturb

+
+
+
+
+ +
+
+piecewise_constant_interpolate(values, other, bound=False, axis=0)
+

Interpolate values of the cells to another RectilinearMesh in a piecewise constant manner.

+
+
Parameters:
+
    +
  • values (geobipy.StatArray) – The values to interpolate. Has size self.nCells

  • +
  • mesh (geobipy.RectilinearMeshND for N = 1, 2, 3.) – A mesh to interpolate to. +If 2D, axis must be given to specify which axis to interpolate against.

  • +
  • bound (bool, optional) – Interpolated values above the top of the model are nan.

  • +
  • axis (int, optional) – Axis to interpolate the value to.

  • +
+
+
Returns:
+

out – The interpolated values at the cell centres of the other mesh.

+
+
Return type:
+

array

+
+
+
+ +
+
+plot(values, **kwargs)
+

Plots values using the mesh as a line

+
+
Parameters:
+
    +
  • reciprocateX (bool, optional) – Take the reciprocal of the x axis

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • noLabels (bool, optional) – Do not plot the labels

  • +
+
+
+
+ +
+
+plotGrid(**kwargs)
+

Plot the grid lines of the mesh.

+
+

See also

+
+
geobipy.StatArray.pcolor

For additional plotting arguments

+
+
+
+
+ +
+
+property probability
+

Evaluate the prior probability for the mesh.

+

The following equation describes the components of the prior that correspond to the Model1D,

+
+\[p(k | I)p(\boldsymbol{e}| k, I),\]
+

where \(k, I, \boldsymbol{e}\) are the number of cells, prior information, edge location respectively.

+

The multiplication here can be turned into a summation by taking the log of the components.

+
+
Parameters:
+

components (bool, optional) – Return all components used in the final probability as well as the final probability

+
+
Returns:
+

    +
  • probability (numpy.float64) – The probability

  • +
  • components (array_like, optional) – Return the components of the probability, i.e. the individually evaluated priors as a second return argument if comonents=True on input.

  • +
+

+
+
+
+ +
+
+property range
+

Get the difference between end edges.

+
+ +
+
+set_priors(n_cells_prior=None, edges_prior=None, **kwargs)
+

Setup the priors of the mesh.

+

By default the following priors are set unless explictly specified.

+

Prior on the number of cells

+

Uninformative prior using a uniform distribution.

+
+(3)\[p(k | I) = +\begin{cases} +\frac{1}{k_{max} - 1} & \quad 1 \leq k \leq k_{max} \newline +0 & \quad otherwise +\end{cases}.\]
+

Prior on the cell edges

+

We use order statistics for the prior on cell edges.

+
+(4)\[p(\boldsymbol{e} | k, I) = \frac{(k -1)!}{\prod_{i=0}^{k-1} \Delta e_{i}},\]
+

where the numerator describes the number of ways that \((k - 1)\) interfaces can be ordered and +\(\Delta e_{i} = (e_{max} - e_{min}) - 2 i h_{min}\) describes the interval that is available to place an edge when there are already i edges in the model

+
+
Parameters:
+
    +
  • min_edge (float64) – Minimum edge possible

  • +
  • max_edge (float64) – Maximum edge possible

  • +
  • max_cells (int) – Maximum number of cells allowable

  • +
  • min_width (float64, optional) – Minimum width of any layer. If min_width = None, min_width is computed from min_edge, max_edge, and max_cells (recommended).

  • +
  • prng (numpy.random.RandomState(), optional) – Random number generator, if none is given, will use numpy’s global generator.

  • +
  • n_cells_prior (geobipy.Distribution, optional) – Distribution describing the prior on the number of cells. Overrides the default.

  • +
  • edge_prior (geobipy.Distribution, optional) – Distribution describing the prior on the cell edges. Overrides the default.

  • +
+
+
+
+

See also

+
+
RectilinearMesh1D.perturb

For a description of the perturbation cycle.

+
+
+
+
+ +
+
+set_proposals(probabilities, **kwargs)
+

Setup the proposal distibution.

+
+
Parameters:
+
    +
  • probabilities (array_like) – Probability of birth, death, perturb, and no change for the model +e.g. probabilities = [0.5, 0.25, 0.15, 0.1]

  • +
  • parameterProposal (geobipy.Distribution) – The proposal distribution for the parameter.

  • +
  • prng (numpy.random.RandomState(), optional) – Random number generator, if none is given, will use numpy’s global generator.

  • +
+
+
+
+

See also

+
+
geobipy.Model1D.perturb

For a description of the perturbation cycle.

+
+
+
+
+ +
+
+property summary
+

Summary of self

+
+ +
+
+unperturb()
+

After a mesh has had its structure perturbed, remap back its previous state. Used for the reversible jump McMC step.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/mesh/RectilinearMesh2D.html b/docs/content/api/classes/mesh/RectilinearMesh2D.html new file mode 100644 index 00000000..cb7b3ef4 --- /dev/null +++ b/docs/content/api/classes/mesh/RectilinearMesh2D.html @@ -0,0 +1,583 @@ + + + + + + + RectilinearMesh2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

RectilinearMesh2D

+
Inheritance diagram of geobipy.src.classes.mesh.RectilinearMesh2D
+ + + +

@RectilinearMesh2D_Class +Module describing a 2D Rectilinear Mesh class with x and y axes specified

+
+
+class geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D(x=None, y=None, **kwargs)
+

Class defining a 2D rectilinear mesh with cell centres and edges.

+

Contains a simple 2D mesh with cell edges, widths, and centre locations. +There are two ways of instantiating the RectilinearMesh2D. +The first is by specifying the x and y cell centres or edges. In this case, +the abscissa is the standard x axis, and y is the ordinate. The z co-ordinates are None. +The second is by specifyin the x, y, and z cell centres or edges. In this case, +The mesh is a 2D plane with the ordinate parallel to z, and the “horizontal” locations +have co-ordinates (x, y). +This allows you to, for example, create a vertical 2D mesh that is not parallel to either the +x or y axis, like a typical line of data. +If x, y, and z are specified, plots can be made against distance which calculated cumulatively between points.

+

RectilinearMesh2D([x_centres or x_edges], [y_centres or y_edges], [z_centres or z_edges])

+
+
Parameters:
+
    +
  • x (geobipy.RectilinearMesh1D, optional) – text

  • +
  • y (float, optional) – text

  • +
  • z (geobipy.RectilinearMesh1D, optional) – text

  • +
  • relativeTo (geobipy.RectilinearMesh1D, optional) – text

  • +
  • x_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “x” direction. Only x_centres or x_edges can be given.

  • +
  • x_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “x” direction. Only x_centres or x_edges can be given.

  • +
  • y_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “y” direction. Only y_centres or y_edges can be given.

  • +
  • y_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “y” direction. Only y_centres or y_edges can be given.

  • +
  • z_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “z” direction. Only z_centres or z_edges can be given.

  • +
  • z_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “z” direction. Only z_centres or z_edges can be given.

  • +
  • [x (float, optional) – See geobipy.RectilinearMesh1D for edgesMin description.

  • +
  • y – See geobipy.RectilinearMesh1D for edgesMin description.

  • +
  • z]edgesMin (float, optional) – See geobipy.RectilinearMesh1D for edgesMin description.

  • +
  • [x – See geobipy.RectilinearMesh1D for edgesMax description.

  • +
  • y – See geobipy.RectilinearMesh1D for edgesMax description.

  • +
  • z]edgesMax (float, optional) – See geobipy.RectilinearMesh1D for edgesMax description.

  • +
  • [x – See geobipy.RectilinearMesh1D for log description.

  • +
  • y – See geobipy.RectilinearMesh1D for log description.

  • +
  • z]log ('e' or float, optional) – See geobipy.RectilinearMesh1D for log description.

  • +
  • [x – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
  • y – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
  • z]relativeTo (float, optional) – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
+
+
Returns:
+

out – The 2D mesh.

+
+
Return type:
+

RectilinearMesh2D

+
+
+
+
+cellIndex(values, axis, clip=False, trim=False)
+

Return the cell indices of values along axis.

+
+
Parameters:
+
    +
  • values (scalar or array_like) – Locations to obtain the cell index for

  • +
  • axis (int) – Axis along which to obtain indices

  • +
  • clip (bool) – A negative index which would normally wrap will clip to 0 instead.

  • +
  • trim (bool) – Do not include out of axis indices. Negates clip, since they wont be included in the output.

  • +
+
+
Returns:
+

out – indices for the locations along the axis

+
+
Return type:
+

ints

+
+
+
+ +
+
+cellIndices(x, y=None, clip=False, trim=False)
+

Return the cell indices in x and z for two floats.

+
+
Parameters:
+
    +
  • x (scalar or array_like) – x location

  • +
  • y (scalar or array_like) – y location (or z location if instantiated with 3 co-ordinates)

  • +
  • clip (bool) – A negative index which would normally wrap will clip to 0 instead.

  • +
  • trim (bool) – Do not include out of axis indices. Negates clip, since they wont be included in the output.

  • +
+
+
Returns:
+

out – indices for the locations along [axis0, axis1]

+
+
Return type:
+

ints

+
+
+
+ +
+
+centres(axis=0)
+

Ravelled cell centres

+
+
Returns:
+

out – ravelled cell centre locations.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None, upcast=True)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+property distance
+

The distance along the top of the mesh using the x and y co-ordinates.

+
+ +
+
+edges(axis)
+

Gets the cell edges in the given dimension

+
+ +
+
+hasSameSize(other)
+

Determines if the meshes have the same dimension sizes

+
+ +
+
+in_bounds(x, y)
+

Return whether values are inside the cell edges

+
+
Parameters:
+

values (array_like) – Check if these are inside left <= values < right.

+
+
Returns:
+

out – Are the values inside.

+
+
Return type:
+

bools

+
+
+
+ +
+
+intervalStatistic(arr, intervals, axis=0, statistic='mean')
+

Compute a statistic of the array between the intervals given along dimension dim.

+
+
Parameters:
+
    +
  • arr (array_like) – 2D array to take the mean over the given intervals

  • +
  • intervals (array_like) – A new set of mesh edges. The mean is computed between each two edges in the array.

  • +
  • axis (int, optional) – Which axis to take the mean

  • +
  • statistic (string or callable, optional) –

    +
    The statistic to compute (default is ‘mean’).

    The following statistics are available:

    +
    +
    +
      +
    • ’mean’ : compute the mean of values for points within each bin. +Empty bins will be represented by NaN.

    • +
    • ’median’ : compute the median of values for points within each +bin. Empty bins will be represented by NaN.

    • +
    • ’count’ : compute the count of points within each bin. This is +identical to an unweighted histogram. values array is not +referenced.

    • +
    • ’sum’ : compute the sum of values for points within each bin. +This is identical to a weighted histogram.

    • +
    • ’min’ : compute the minimum of values for points within each bin. +Empty bins will be represented by NaN.

    • +
    • ’max’ : compute the maximum of values for point within each bin. +Empty bins will be represented by NaN.

    • +
    • function : a user-defined function which takes a 1D array of +values, and outputs a single numerical statistic. This function +will be called on the values in each bin. Empty bins will be +represented by function([]), or NaN if this returns an error.

    • +
    +

  • +
+
+
+
+

See also

+
+
scipy.stats.binned_statistic

for more information

+
+
+
+
+ +
+
+mask_cells(axis=None, x_distance=None, y_distance=None, values=None)
+

Mask cells by a distance.

+

If the edges of the cell are further than distance away, extra cells are inserted such that +the cell’s new edges are at distance away from the centre.

+
+
Parameters:
+
    +
  • xAxis (array_like) – Alternative axis to use for masking. Must have size self.x.nEdges

  • +
  • x_distance (float, optional) – Mask along the x axis using this distance. +Defaults to None.

  • +
  • y_distance (float, optional) – Mask along the y axis using this distance. +Defaults to None.

  • +
  • values (array_like, optional.) – If given, values will be remapped to the masked mesh. +Has shape (y.nCells, x.nCells)

  • +
+
+
Returns:
+

    +
  • out (RectilinearMesh2D) – Masked mesh

  • +
  • x_indices (ints, optional) – Location of the original centres in the expanded mesh along the x axis.

  • +
  • y_indices (ints, optional) – Location of the original centres in the expanded mesh along the y axis.

  • +
  • out_values (array_like, optional) – If values is given, values will be remapped to the masked mesh.

  • +
+

+
+
+
+ +
+
+property nCells
+

The number of cells in the mesh.

+
+
Returns:
+

out – Number of cells

+
+
Return type:
+

int

+
+
+
+ +
+
+property nNodes
+

The number of nodes in the mesh.

+
+
Returns:
+

out – Number of nodes

+
+
Return type:
+

int

+
+
+
+ +
+
+property nodes
+

Ravelled cell nodes

+
+
Returns:
+

out – ravelled cell node locations.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+pcolor(values, axis=None, yAxis='absolute', **kwargs)
+

Create a pseudocolour plot of a 2D array using the mesh.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – A 2D array of colour values.

  • +
  • xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line

  • +
  • zAxis (str) – If zAxis is ‘absolute’ the vertical axis is the relativeTo plus z. +If zAxis is ‘relative’ the vertical axis is z.

  • +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+plotGrid(**kwargs)
+

Plot the mesh grid lines.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal axis uses self.x +If xAxis is ‘y’, the horizontal axis uses self.y +If xAxis is ‘r’, the horizontal axis uses sqrt(self.x^2 + self.y^2)

+
+
+
+ +
+
+plot_relative_to(axis=0, **kwargs)
+

Plot the relativeTo of the mesh as a line.

+
+ +
+
+ravelIndices(ixy, order='C')
+

Return a global index into a 1D array given the two cell indices in x and z.

+
+
Parameters:
+

ixy (tuple of array_like) – A tuple of integer arrays, one array for each dimension.

+
+
Returns:
+

out – Global index.

+
+
Return type:
+

int

+
+
+
+ +
+
+property shape
+

The dimensions of the mesh

+
+
Returns:
+

out – Array of integers

+
+
Return type:
+

array_like

+
+
+
+ +
+
+property summary
+

Display a summary of the 3D Point Cloud

+
+ +
+
+unravelIndex(indices, order='C')
+

Return a global index into a 1D array given the two cell indices in x and z.

+
+
Parameters:
+

indices (array_like) – An integer array whose elements are indices into the flattened +version of an array.

+
+
Returns:
+

unraveled_coords – Each array in the tuple has the same shape as the self.shape.

+
+
Return type:
+

tuple of ndarray

+
+
+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+
+property x_centres
+

Creates an array suitable for plt.pcolormesh for the abscissa.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.

+
+
+
+ +
+
+property x_edges
+

Creates an array suitable for plt.pcolormesh for the ordinate

+
+ +
+
+property y_centres
+

Creates an array suitable for plt.pcolormesh for the abscissa.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.

+
+
+
+ +
+
+property y_edges
+

Creates an array suitable for plt.pcolormesh for the ordinate

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/mesh/RectilinearMesh2D_stitched.html b/docs/content/api/classes/mesh/RectilinearMesh2D_stitched.html new file mode 100644 index 00000000..5827f67f --- /dev/null +++ b/docs/content/api/classes/mesh/RectilinearMesh2D_stitched.html @@ -0,0 +1,253 @@ + + + + + + + RectilinearMesh2D_stitched — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

RectilinearMesh2D_stitched

+
Inheritance diagram of geobipy.src.classes.mesh.RectilinearMesh2D_stitched
+ + + + +

@RectilinearMesh2D_Class +Module describing a 2D Rectilinear Mesh class with x and y axes specified

+
+
+class geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched(max_cells, x=None, relativeTo=None, nCells=None, **kwargs)
+

Class defining stitched 1D rectilinear meshes.

+
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None, upcast=False)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+classmethod fromHdf(grp, index=None, skip_posterior=False)
+

Reads in the object from a HDF file

+
+ +
+
+property nCells
+

The number of cells in the mesh.

+
+
Returns:
+

out – Number of cells

+
+
Return type:
+

int

+
+
+
+ +
+
+pcolor(values, **kwargs)
+

Create a pseudocolour plot of a 2D array using the mesh.

+
+
Parameters:
+
    +
  • values (array_like or StatArray) – A 2D array of colour values.

  • +
  • xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line

  • +
  • zAxis (str) – If zAxis is ‘absolute’ the vertical axis is the relativeTo plus z. +If zAxis is ‘relative’ the vertical axis is z.

  • +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
Returns:
+

matplotlib .Axes

+
+
Return type:
+

ax

+
+
+
+

See also

+
+
matplotlib.pyplot.pcolormesh

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+property shape
+

The dimensions of the mesh

+
+
Returns:
+

out – Array of integers

+
+
Return type:
+

array_like

+
+
+
+ +
+
+property summary
+

Display a summary of the 3D Point Cloud

+
+ +
+
+property y_edges
+

Creates an array suitable for plt.pcolormesh for the ordinate

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/mesh/RectilinearMesh3D.html b/docs/content/api/classes/mesh/RectilinearMesh3D.html new file mode 100644 index 00000000..37a5f2a0 --- /dev/null +++ b/docs/content/api/classes/mesh/RectilinearMesh3D.html @@ -0,0 +1,428 @@ + + + + + + + RectilinearMesh3D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

RectilinearMesh3D

+
Inheritance diagram of geobipy.src.classes.mesh.RectilinearMesh3D
+ + + + +

@RectilinearMesh2D_Class +Module describing a 2D Rectilinear Mesh class with x and y axes specified

+
+
+class geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D(x=None, y=None, z=None, **kwargs)
+

Class defining a 3D rectilinear mesh with cell centres and edges.

+

Contains a simple mesh with cell edges, widths, and centre locations. +There are two ways of instantiating the RectilinearMesh2D. +The first is by specifying the x and y cell centres or edges. In this case, +the abscissa is the standard x axis, and y is the ordinate. The z co-ordinates are None. +The second is by specifyin the x, y, and z cell centres or edges. In this case, +The mesh is a 2D plane with the ordinate parallel to z, and the “horizontal” locations +have co-ordinates (x, y). +This allows you to, for example, create a vertical 2D mesh that is not parallel to either the +x or y axis, like a typical line of data. +If x, y, and z are specified, plots can be made against distance which calculated cumulatively between points.

+

RectilinearMesh2D([x_centres or x_edges], [y_centres or y_edges], [z_centres or z_edges])

+
+
Parameters:
+
    +
  • x_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “x” direction. Only x_centres or x_edges can be given.

  • +
  • x_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “x” direction. Only x_centres or x_edges can be given.

  • +
  • y_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “y” direction. Only y_centres or y_edges can be given.

  • +
  • y_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “y” direction. Only y_centres or y_edges can be given.

  • +
  • z_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “z” direction. Only z_centres or z_edges can be given.

  • +
  • z_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “z” direction. Only z_centres or z_edges can be given.

  • +
  • relativeToCentres (geobipy.StatArray, optional) – The relativeTo of each point at the x, y locations. Only relativeToCentres or relativeToEdges can be given, not both. +Has shape (y.nCells, x.nCells).

  • +
  • relativeToEdges (geobipy.StatArray, optional) – The relativeTo of each point at the x, y locations of the edges of each cell, including the outermost edges. Only relativeToCentres or relativeToEdges can be given, not both. +Has shape (y.nEdges, x.nEdges).

  • +
  • [x (float, optional) – See geobipy.RectilinearMesh1D for log description.

  • +
  • y (float, optional) – See geobipy.RectilinearMesh1D for log description.

  • +
  • z]log ('e' or float, optional) – See geobipy.RectilinearMesh1D for log description.

  • +
  • [x – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
  • y – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
  • z]relativeTo (float, optional) – See geobipy.RectilinearMesh1D for relativeTo description.

  • +
+
+
Returns:
+

out – The 2D mesh.

+
+
Return type:
+

RectilinearMesh2D

+
+
+
+
+cellIndices(x, y, z, clip=False, trim=False)
+

Return the cell indices in x and z for two floats.

+
+
Parameters:
+
    +
  • x (scalar or array_like) – x location

  • +
  • y (scalar or array_like) – y location (or z location if instantiated with 3 co-ordinates)

  • +
  • clip (bool) – A negative index which would normally wrap will clip to 0 instead.

  • +
  • trim (bool) – Do not include out of axis indices. Negates clip, since they wont be included in the output.

  • +
+
+
Returns:
+

out – indices for the locations along [axis0, axis1]

+
+
Return type:
+

ints

+
+
+
+ +
+
+centres(axis)
+

Ravelled cell centres

+
+
Returns:
+

out – ravelled cell centre locations.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None, upcast=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+edges(axis)
+

Gets the cell edges in the given dimension

+
+ +
+
+classmethod fromHdf(grp, index=None, skip_posterior=False)
+

Reads in the object from a HDF file

+
+ +
+
+property nCells
+

The number of cells in the mesh.

+
+
Returns:
+

out – Number of cells

+
+
Return type:
+

int

+
+
+
+ +
+
+property nNodes
+

The number of nodes in the mesh.

+
+
Returns:
+

out – Number of nodes

+
+
Return type:
+

int

+
+
+
+ +
+
+plotGrid()
+

Plot the mesh grid lines.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal axis uses self.x +If xAxis is ‘y’, the horizontal axis uses self.y +If xAxis is ‘r’, the horizontal axis uses sqrt(self.x^2 + self.y^2)

+
+
+
+ +
+
+pyvista_mesh(**kwargs)
+

Creates a pyvista plotting object linked to VTK.

+

Use mesh.plot(show_edges=True, show_grid=True) to plot the mesh.

+
+ +
+
+ravelIndices(indices, order='C')
+

Return a global index into a 1D array given the two cell indices in x and z.

+
+
Parameters:
+

indices (array_like) – A tuple of integer arrays, one array for each dimension.

+
+
Returns:
+

out – Global index.

+
+
Return type:
+

int

+
+
+
+ +
+
+property shape
+

The dimensions of the mesh

+
+
Returns:
+

out – Array of integers

+
+
Return type:
+

array_like

+
+
+
+ +
+
+property summary
+

Display a summary of the 3D Point Cloud

+
+ +
+
+unravelIndex(index, order='C')
+

Return local indices given a global one.

+
+
Parameters:
+

indices (array_like) – An integer array whose elements are indices into the flattened +version of an array.

+
+
Returns:
+

unraveled_coords – Each array in the tuple has the same shape as the self.shape.

+
+
Return type:
+

tuple of ndarray

+
+
+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+
+xRange()
+

Get the range of x

+
+
Returns:
+

out – The range of x

+
+
Return type:
+

numpy.float64

+
+
+
+ +
+
+property x_centres
+

Creates an array suitable for plt.pcolormesh for the abscissa.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.

+
+
+
+ +
+
+property x_edges
+

Creates an array suitable for plt.pcolormesh for the ordinate

+
+ +
+
+property y_centres
+

Creates an array suitable for plt.pcolormesh for the abscissa.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x +If xAxis is ‘y’, the horizontal xAxis uses self.y +If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.

+
+
+
+ +
+
+property y_edges
+

Creates an array suitable for plt.pcolormesh for the ordinate

+
+ +
+
+zRange()
+

Get the range of z

+
+
Returns:
+

out – The range of z

+
+
Return type:
+

numpy.float64

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/mesh/mesh.html b/docs/content/api/classes/mesh/mesh.html new file mode 100644 index 00000000..e7890ace --- /dev/null +++ b/docs/content/api/classes/mesh/mesh.html @@ -0,0 +1,149 @@ + + + + + + + Mesh classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/model/Model_.html b/docs/content/api/classes/model/Model_.html new file mode 100644 index 00000000..dc3257c2 --- /dev/null +++ b/docs/content/api/classes/model/Model_.html @@ -0,0 +1,432 @@ + + + + + + + Model — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

Model

+
Inheritance diagram of geobipy.src.classes.model.Model
+ + + +

@Model_Class +Module describing a Model

+
+
+class geobipy.src.classes.model.Model.Model(mesh=None, values=None)
+

Generic model class with an attached mesh.

+
+
+compute_local_inverse_hessian(observation=None)
+

Generate a localized Hessian matrix using +a dataPoint and the current realization of the Model1D.

+
+
Parameters:
+

observation (geobipy.DataPoint, geobipy.Dataset, optional) – The observed data to use when computing the local estimate of the variance.

+
+
Returns:
+

out – Hessian matrix

+
+
Return type:
+

array_like

+
+
+
+ +
+
+classmethod fromHdf(grp, index=None, skip_posterior=False)
+

Reads in the object from a HDF file

+
+ +
+
+property gradient
+

Compute the gradient

+

Parameter gradient \(\nabla_{z}\sigma\) at the ith layer is computed via

+
+ +
+
+gradient_probability(log=True)
+

Evaluate the prior for the gradient of the parameter with depth

+
+
Parameters:
+

hmin (float64) – The minimum thickness of any layer.

+
+
Returns:
+

out – The probability given the prior on the gradient of the parameters with depth.

+
+
Return type:
+

numpy.float64

+
+
+
+ +
+
+local_precision(observation=None)
+

Generate a localized inverse Hessian matrix using a dataPoint and the current realization of the Model1D.

+
+
Parameters:
+

datapoint (geobipy.DataPoint, optional) – The data point to use when computing the local estimate of the variance. +If None, only the prior derivative is used.

+
+
Returns:
+

out – Inverse Hessian matrix

+
+
Return type:
+

array_like

+
+
+
+ +
+
+local_variance(observation=None)
+

Generate a localized inverse Hessian matrix using a dataPoint and the current realization of the Model1D.

+
+
Parameters:
+

datapoint (geobipy.DataPoint, optional) – The data point to use when computing the local estimate of the variance. +If None, only the prior derivative is used.

+
+
Returns:
+

out – Inverse Hessian matrix

+
+
Return type:
+

array_like

+
+
+
+ +
+
+pad(shape)
+

Copies the properties of a model including all priors or proposals, but pads memory to the given size

+
+
Parameters:
+

size (int, tuple) – Create memory upto this size.

+
+
Returns:
+

out – Padded model

+
+
Return type:
+

geobipy.Model1D

+
+
+
+ +
+
+pcolor(**kwargs)
+

Plot like an image

+
+
Parameters:
+
    +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
+
+ +
+
+perturb(*args, **kwargs)
+

Perturb a model’s structure and parameter values.

+

Uses a stochastic newtown approach if a datapoint is provided. +Otherwise, uses the existing proposal distribution attached to +self.par to generate new values.

+
+
Parameters:
+

observation (geobipy.DataPoint, optional) – The datapoint to use to perturb using a stochastic Newton approach.

+
+
Returns:
+

    +
  • remappedModel (geobipy.Model) – The current model remapped onto the perturbed dimension.

  • +
  • perturbedModel (geobipy.Model) – The model with perturbed structure and parameter values.

  • +
+

+
+
+
+ +
+
+probability(solve_value, solve_gradient)
+

Evaluate the prior probability for the 1D Model.

+
+
Parameters:
+
    +
  • sPar (bool) – Evaluate the prior on the parameters in the final probability

  • +
  • sGradient (bool) – Evaluate the prior on the parameter gradient in the final probability

  • +
  • components (bool, optional) – Return all components used in the final probability as well as the final probability

  • +
+
+
Returns:
+

    +
  • probability (numpy.float64) – The probability

  • +
  • components (array_like, optional) – Return the components of the probability, i.e. the individually evaluated priors as a second return argument if comonents=True on input.

  • +
+

+
+
+
+ +
+
+proposal_probabilities(remapped_model, observation=None)
+

Return the forward and reverse proposal probabilities for the model

+

Returns the denominator and numerator for the model’s components of the proposal ratio.

+
+(1)\[q(k, \boldsymbol{z} | \boldsymbol{m}^{'})\]
+

and

+
+(2)\[q(k^{'}, \boldsymbol{z}^{'} | \boldsymbol{m})\]
+

Each component is dependent on the event that was chosen during perturbation.

+
+
Parameters:
+
    +
  • remappedModel (geobipy.Model1D) – The current model, remapped onto the dimension of self.

  • +
  • observation (geobipy.DataPoint) – The perturbed datapoint that was used to generate self.

  • +
+
+
Returns:
+

    +
  • forward (float) – The forward proposal probability

  • +
  • reverse (float) – The reverse proposal probability

  • +
+

+
+
+
+ +
+
+set_priors(values_prior=None, gradient_prior=None, **kwargs)
+

Setup the priors of a 1D model.

+
+
Parameters:
+
    +
  • halfSpaceValue (float) – Value of the parameter for the halfspace.

  • +
  • min_edge (float64) – Minimum depth possible for the model

  • +
  • max_edge (float64) – Maximum depth possible for the model

  • +
  • max_cells (int) – Maximum number of layers allowable in the model

  • +
  • parameterPrior (bool) – Sets a prior on the parameter values

  • +
  • gradientPrior (bool) – Sets a prior on the gradient of the parameter values

  • +
  • parameterLimits (array_like, optional) – Length 2 array with the bounds on the parameter values to impose.

  • +
  • min_width (float64, optional) – Minimum thickness of any layer. If min_width = None, min_width is computed from min_edge, max_edge, and max_cells (recommended).

  • +
  • factor (float, optional) – Tuning parameter used in the std of the parameter prior.

  • +
  • prng (numpy.random.RandomState(), optional) – Random number generator, if none is given, will use numpy’s global generator.

  • +
+
+
+
+

See also

+
+
geobipy.Model1D.perturb

For a description of the perturbation cycle.

+
+
+
+
+ +
+
+set_proposals(proposal=None, **kwargs)
+

Setup the proposals of a 1D model.

+
+
Parameters:
+
    +
  • halfSpaceValue (float) – Value of the parameter for the halfspace.

  • +
  • probabilities (array_like) – Probability of birth, death, perturb, and no change for the model +e.g. pWheel = [0.5, 0.25, 0.15, 0.1]

  • +
  • parameterProposal (geobipy.Distribution) – The proposal distribution for the parameter.

  • +
  • prng (numpy.random.RandomState(), optional) – Random number generator, if none is given, will use numpy’s global generator.

  • +
+
+
+
+

See also

+
+
geobipy.Model1D.perturb

For a description of the perturbation cycle.

+
+
+
+
+ +
+
+property summary
+

Summary of self

+
+ +
+
+update_parameter_posterior(axis=0)
+

Imposes a model’s parameters with depth onto a 2D Hitmap.

+

The cells that the parameter-depth profile passes through are accumulated by 1.

+
+
Parameters:
+

Hitmap (geobipy.Hitmap) – The hitmap to add to

+
+
+
+ +
+
+update_posteriors(ratio=0.5)
+

Update any attached posterior distributions.

+
+
Parameters:
+

minimumRatio (float) – Only update the depth posterior if the layer parameter ratio +is greater than this number.

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/model/model.html b/docs/content/api/classes/model/model.html new file mode 100644 index 00000000..062fb300 --- /dev/null +++ b/docs/content/api/classes/model/model.html @@ -0,0 +1,143 @@ + + + + + + + Model classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Model classes

+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/pointcloud/Point.html b/docs/content/api/classes/pointcloud/Point.html new file mode 100644 index 00000000..7abe6e44 --- /dev/null +++ b/docs/content/api/classes/pointcloud/Point.html @@ -0,0 +1,633 @@ + + + + + + + Point — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

Point

+
Inheritance diagram of geobipy.src.classes.pointcloud.Point
+ + + +
+
+class geobipy.src.classes.pointcloud.Point.Point(x=None, y=None, z=None, elevation=None, **kwargs)
+

3D Point Cloud with x,y,z co-ordinates

+

PointCloud3D(N, x, y, z)

+
+
Parameters:
+
    +
  • N (int) – Number of points

  • +
  • x (array_like or geobipy.StatArray, optional) – The x co-ordinates. Default is zeros of size N

  • +
  • y (array_like or geobipy.StatArray, optional) – The y co-ordinates. Default is zeros of size N

  • +
  • z (array_like or geobipy.StatArray, optional) – The z co-ordinates. Default is zeros of size N

  • +
  • units (str, optional) – The units of the co-ordinates. Default is “m”

  • +
+
+
Returns:
+

out – The 3D point cloud

+
+
Return type:
+

geobipy.PointCloud3D

+
+
+
+
+Bcast(world, root=0)
+

Broadcast a PointCloud3D using MPI

+
+
Parameters:
+
    +
  • world (mpi4py.MPI.COMM_WORLD) – MPI communicator

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – PointCloud3D broadcast to each rank

+
+
Return type:
+

geobipy.PointCloud3D

+
+
+
+ +
+
+Scatterv(starts, chunks, world, root=0)
+

ScatterV a PointCloud3D using MPI

+
+
Parameters:
+
    +
  • myStart (sequence of ints) – Indices into self that define the starting locations of the chunks to be sent to each rank.

  • +
  • myChunk (sequence of ints) – The size of each chunk that each rank will receive.

  • +
  • world (mpi4py.MPI.Comm) – The MPI communicator over which to Scatterv.

  • +
  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

  • +
+
+
Returns:
+

out – The PointCloud3D distributed amongst ranks.

+
+
Return type:
+

geobipy.PointCloud3D

+
+
+
+ +
+
+append(other)
+

Append pointclouds together

+
+
Parameters:
+

other (geobipy.PointCloud3D) – 3D pointcloud

+
+
+
+ +
+
+axis(axis='x')
+

Obtain the axis against which to plot values.

+
+
Parameters:
+

axis (str) – If axis is ‘index’, returns numpy.arange(self.nPoints) +If axis is ‘x’, returns self.x +If axis is ‘y’, returns self.y +If axis is ‘z’, returns self.z +If axis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If axis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

+
+
Returns:
+

out – The requested axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+block_indices(dx=None, dy=None, x_grid=None, y_grid=None)
+

Returns the indices of the points lying in blocks across the domain..

+

Performed before a block median filter by extracting the point location within blocks across the domain. +Idea taken from pygmt, however I extracted the indices and this was quite a bit faster.

+
+
Parameters:
+
    +
  • dx (float) – Grid spacing in x.

  • +
  • dy (float) – Grid spacing in y.

  • +
+
+
Returns:
+

ints

+
+
Return type:
+

Index into self whose points are the median location within blocks across the domain.

+
+
+
+ +
+
+block_median(dx=None, dy=None, x_grid=None, y_grid=None, values=None)
+

Median point within juxtaposed blocks across the domain.

+
+
Parameters:
+
    +
  • dx (float) – Increment in x.

  • +
  • dy (float) – Increment in y.

  • +
  • values (array_like, optional) – Used to compute the median in each block. +Defaults to None.

  • +
+
+
Returns:
+

geobipt.PointCloud3d

+
+
Return type:
+

Contains one point in each block.

+
+
+
+ +
+
+block_median_indices(dx=None, dy=None, x_grid=None, y_grid=None, values=None)
+

Index to the median point within juxtaposed blocks across the domain.

+
+
Parameters:
+
    +
  • dx (float) – Increment in x.

  • +
  • dy (float) – Increment in y.

  • +
  • values (array_like, optional) – Used to compute the median in each block. +Defaults to None.

  • +
+
+
Returns:
+

ints

+
+
Return type:
+

Index of the median point in each block.

+
+
+
+ +
+
+property bounds
+

Gets the bounding box of the data set

+
+ +
+
+centred_grid_nodes(bounds, spacing)
+

Generates grid nodes centred over bounds

+
+
Parameters:
+
    +
  • bounds (array_like) – bounds of the dimension

  • +
  • spacing (float) – distance between nodes

  • +
+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+distance(other, **kwargs)
+

Get the Lp norm distance between two points.

+
+ +
+
+fileInformation()
+

Description of PointCloud3D file.

+
+
Returns:
+

out – File description.

+
+
Return type:
+

str

+
+
+
+ +
+
+classmethod fromHdf(grp, index=None, **kwargs)
+

Reads the object from a HDF group

+
+ +
+
+getXAxis(xAxis='x')
+

Obtain the xAxis against which to plot values.

+
+
Parameters:
+

xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

+
+
Returns:
+

out – The requested xAxis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+interpCloughTocher(mesh, values, mask=False, clip=None, i=None, **kwargs)
+

Interpolate values at the points to a grid

+
+ +
+
+interpolate(dx=None, dy=None, mesh=None, values=None, method='mc', mask=False, clip=True, i=None, block=False, **kwargs)
+

Interpolate values to a grid.

+

The grid is automatically generated such that it is centred over the point cloud.

+
+
Parameters:
+
    +
  • dx (float) – Grid spacing in x.

  • +
  • dy (float) – Grid spacing in y.

  • +
  • values (array_like, optional) – Values to interpolate. Must have size self.nPoints. +Defaults to None.

  • +
  • method (str, optional) –

      +
    • ‘ct’ uses Clough Tocher interpolation. Default

    • +
    • ’mc’ uses Minimum curvature and requires pygmt to be installed.

    • +
    +

  • +
  • mask (float, optional) – Cells of distance mask away from points are NaN. +Defaults to False.

  • +
  • clip (bool, optional) – Clip any overshot grid values to the min/max of values. +Defaults to True.

  • +
  • i (ints, optional) – Use only the i locations during interpolation. +Defaults to None.

  • +
  • block (bool, optional) – Perform a block median filter before interpolation. Inherrently smooths the final grid, but alleviates aliasing. +Defaults to False.

  • +
+
+
Returns:
+

geobipy.Model

+
+
Return type:
+

Interpolated values.

+
+
+
+ +
+
+map(dx, dy, i=None, **kwargs)
+

Create a map of a parameter

+
+ +
+
+move(dx, dy, dz)
+

Move the point by [dx,dy,dz]

+
+ +
+
+property nPoints
+

Get the number of points

+
+ +
+
+nearest(x, k=1, eps=0, p=2, radius=inf)
+

Obtain the k nearest neighbours

+
+

See also

+

See

+
+
+ +
+
+perturb()
+

Propose a new point given the attached propsal distributions

+
+ +
+
+plot(values, x='index', **kwargs)
+

Line plot of values against a co-ordinate.

+
+
Parameters:
+
    +
  • values (array_like) – Values to plot against a co-ordinate

  • +
  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) +If xAxis is ‘x’, returns self.x +If xAxis is ‘y’, returns self.y +If xAxis is ‘z’, returns self.z +If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. +If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

  • +
+
+
Returns:
+

ax – Plot axes handle

+
+
Return type:
+

matplotlib.axes

+
+
+
+

See also

+
+
geobipy.plotting.plot

For additional keyword arguments

+
+
+
+
+ +
+
+property probability
+

Evaluate the probability for the EM data point given the specified attached priors

+
+
Parameters:
+
    +
  • rEerr (bool) – Include the relative error when evaluating the prior

  • +
  • aEerr (bool) – Include the additive error when evaluating the prior

  • +
  • height (bool) – Include the elevation when evaluating the prior

  • +
  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • +
  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

  • +
+
+
Returns:
+

out – The evaluation of the probability using all assigned priors

+
+
Return type:
+

float64

+
+
+

Notes

+

For each boolean, the associated prior must have been set.

+
+
Raises:
+

TypeError – If a prior has not been set on a requested parameter

+
+
+
+ +
+
+classmethod read_csv(filename, **kwargs)
+

Reads x y z co-ordinates from an ascii csv file.

+
+
Parameters:
+

filename (str) – Path to the file to read from.

+
+
+
+ +
+
+scatter2D(**kwargs)
+

Create a 2D scatter plot using the x, y coordinates of the point cloud.

+

Can take any other matplotlib arguments and keyword arguments e.g. markersize etc.

+
+
Parameters:
+
    +
  • c (1D array_like or StatArray, optional) – Colour values of the points, default is the height of the points

  • +
  • i (sequence of ints, optional) – Plot a subset of x, y, c, using the indices in i.

  • +
+
+
+
+

See also

+
+
geobipy.plotting.Scatter2D

For additional keyword arguments you may use.

+
+
+
+
+ +
+
+set_kdtree(ndim)
+

Creates a k-d tree of the point co-ordinates

+
+
Parameters:
+

nDims (int) – Either 2 or 3 to exclude or include the vertical co-ordinate

+
+
+
+ +
+
+set_x_posterior()
+
+ +
+
+set_y_posterior()
+
+ +
+
+set_z_posterior()
+
+ +
+
+property summary
+

Summary of self

+
+ +
+
+toVTK(fileName, pointData=None, format='binary')
+

Save the PointCloud3D to a VTK file.

+
+
Parameters:
+
    +
  • fileName (str) – Filename to save to.

  • +
  • pointData (geobipy.StatArray or list of geobipy.StatArray, optional) – Data at each point in the point cloud. Each entry is saved as a separate +vtk attribute.

  • +
  • format (str, optional) – “ascii” or “binary” format. Ascii is readable, binary is not but results in smaller files.

  • +
+
+
Raises:
+
    +
  • TypeError – If pointData is not a geobipy.StatArray or list of them.

  • +
  • ValueError – If any pointData entry does not have size equal to the number of points.

  • +
  • ValueError – If any StatArray does not have a name or units. This is needed for the vtk attribute.

  • +
+
+
+
+ +
+
+vtkStructure()
+

Generates a vtk mesh structure that can be used in a vtk file.

+
+
Returns:
+

out – Vtk data structure

+
+
Return type:
+

pyvtk.VtkData

+
+
+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/pointcloud/pointcloud.html b/docs/content/api/classes/pointcloud/pointcloud.html new file mode 100644 index 00000000..29044b1a --- /dev/null +++ b/docs/content/api/classes/pointcloud/pointcloud.html @@ -0,0 +1,143 @@ + + + + + + + Pointcloud classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Pointcloud classes

+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/Distribution.html b/docs/content/api/classes/statistics/Distribution.html new file mode 100644 index 00000000..16592473 --- /dev/null +++ b/docs/content/api/classes/statistics/Distribution.html @@ -0,0 +1,185 @@ + + + + + + + Distribution Wrapper — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Distribution Wrapper

+

@Distribution_Class +Module describing statistical distributions

+
+
+geobipy.src.classes.statistics.Distribution.Distribution(distributionType, *args, **kwargs)
+

Instantiate a statistical distribution

+
+
Parameters:
+

distributionType (str or subclass of baseDistribution) – If distributionType is str, choose between {Normal, MvNormal, Uniform, Gamma, Order, Categorical} +if distributionType is subclass of baseDistribution, a copy is made

+
+
Returns:
+

out – Subclass of baseDistribution

+
+
Return type:
+

The distribution requested

+
+
+

Example

+
>>> from geobipy import Distribution
+>>> import numpy as np
+>>> import matplotlib.pyplot as plt
+>>> D = Distribution('Normal', 0.0, 1.0)
+>>> x = np.linspace(-5.0,5.0,100)
+>>> y = D.probability(x)
+>>> plt.figure()
+>>> plt.plot(x,y)
+>>> plt.show()
+>>> # To create a Distribution using a specific pseudo random number generator
+>>> prng = np.random.RandomState()
+>>> D = Distribution('Normal', 0.0, 1.0, prng=prng)
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/GammaDistribution.html b/docs/content/api/classes/statistics/GammaDistribution.html new file mode 100644 index 00000000..42e7e37b --- /dev/null +++ b/docs/content/api/classes/statistics/GammaDistribution.html @@ -0,0 +1,163 @@ + + + + + + + Gamma Distribution — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Gamma Distribution

+
Inheritance diagram of geobipy.src.classes.statistics.GammaDistribution
+ + +

@GammaDistribution +Module defining a gamma distribution with statistical procedures

+
+
+class geobipy.src.classes.statistics.GammaDistribution.Gamma(*args)
+

Class defining a normal distribution

+
+
+pdf(x)
+

set the PDF, for a gamma distribution

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/Histogram.html b/docs/content/api/classes/statistics/Histogram.html new file mode 100644 index 00000000..78ac0fcd --- /dev/null +++ b/docs/content/api/classes/statistics/Histogram.html @@ -0,0 +1,470 @@ + + + + + + + Histogram — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

Histogram

+
Inheritance diagram of geobipy.src.classes.statistics.Histogram
+ + + + +
+
+class geobipy.src.classes.statistics.Histogram.Histogram(mesh=None, values=None)
+
+
+credible_intervals(percent=90.0, axis=0)
+

Gets the median and the credible intervals for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

    +
  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • +
  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • +
  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

  • +
+

+
+
+
+ +
+
+credible_range(percent=90.0, log=None, axis=0)
+

Get the range of credibility with depth

+
+
Parameters:
+
    +
  • percent (float) – Percent of the credible intervals

  • +
  • log ('e' or float, optional) – If None: The range is the difference in linear space of the credible intervals +If ‘e’ or float: The range is the difference in log space, or ratio in linear space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
+
+ +
+
+fit_mixture_to_pdf_1d(mixture, **kwargs)
+

Find peaks in the histogram along an axis.

+
+
Parameters:
+
    +
  • intervals (array_like, optional) – Accumulate the histogram between these invervals before finding peaks

  • +
  • axis (int, optional) – Axis along which to find peaks.

  • +
+
+
+
+ +
+
+classmethod fromHdf(grp, index=None)
+

Reads in the object from a HDF file

+
+ +
+
+marginalize(axis=0)
+

Get the marginal histogram along an axis

+
+
Parameters:
+
    +
  • intervals (array_like) – Array of size 2 containing lower and upper limits between which to count.

  • +
  • log ('e' or float, optional) – Entries are given in linear space, but internally bins and values are logged. +Plotting is in log space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
Returns:
+

out

+
+
Return type:
+

geobipy.Histogram1D

+
+
+
+ +
+
+mean(axis=0)
+

Gets the mean along the given axis.

+

This is not the true mean of the original samples. It is the best estimated mean using the binned counts multiplied by the axis bin centres.

+
+
Parameters:
+
    +
  • log ('e' or float, optional.) – Take the log of the mean to base “log”

  • +
  • axis (int) – Axis to take the mean along.

  • +
+
+
Returns:
+

out – The means along the axis.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+median(log=None, axis=0)
+

Gets the median for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the median.

  • +
+
+
Returns:
+

out – The medians along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+mode(log=None, axis=0)
+

Gets the median for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the median.

  • +
+
+
Returns:
+

out – The medians along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+opacity(percent=95.0, log=None, axis=0)
+

Return an opacity between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility map to less opaqueness.

+
+
Parameters:
+
    +
  • percent (float, optional.) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int, optional.) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Opacity along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+opacity_level(percent=95.0, log=None, axis=0)
+

Get the index along axis 1 from the bottom up that corresponds to the percent opacity

+
+ +
+
+pcolor(**kwargs)
+

Plot like an image

+
+
Parameters:
+
    +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
+
+ +
+
+percentile(percent, log=None, reciprocate=False, axis=0)
+

Gets the median and the credible intervals for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

    +
  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • +
  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • +
  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

  • +
+

+
+
+
+ +
+
+plot(overlay=None, **kwargs)
+

Plots the histogram

+
+ +
+
+sample(n_samples, log=None)
+

Generates samples from the histogram.

+

A uniform distribution is used for each bin to generate samples. +The number of samples generated per bin is scaled by the count for that bin using the requested number of samples.

+
+
Parameters:
+

nSamples (int) – Number of samples to generate.

+
+
Returns:
+

out – The samples.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+transparency(percent=95.0, log=None, axis=0)
+

Return a transparency value between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility are mapped to more transparency.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Transparency along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+ +
+
+geobipy.src.classes.statistics.Histogram.rand(d0, d1, ..., dn)
+

Random values in a given shape.

+
+

Note

+

This is a convenience function for users porting code from Matlab, +and wraps random_sample. That function takes a +tuple to specify the size of the output, which is consistent with +other NumPy functions like numpy.zeros and numpy.ones.

+
+

Create an array of the given shape and populate it with +random samples from a uniform distribution +over [0, 1).

+
+
Parameters:
+
    +
  • d0 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • d1 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • ... (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • dn (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
+
+
Returns:
+

out – Random values.

+
+
Return type:
+

ndarray, shape (d0, d1, ..., dn)

+
+
+
+

See also

+

random

+
+

Examples

+
>>> np.random.rand(3,2)
+array([[ 0.14022471,  0.96360618],  #random
+       [ 0.37601032,  0.25528411],  #random
+       [ 0.49313049,  0.94909878]]) #random
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/Histogram1D.html b/docs/content/api/classes/statistics/Histogram1D.html new file mode 100644 index 00000000..266742ff --- /dev/null +++ b/docs/content/api/classes/statistics/Histogram1D.html @@ -0,0 +1,439 @@ + + + + + + + Histogram — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Histogram

+
Inheritance diagram of geobipy.src.classes.statistics.Histogram
+ + + + +
+
+class geobipy.src.classes.statistics.Histogram.Histogram(mesh=None, values=None)
+
+
+credible_intervals(percent=90.0, axis=0)
+

Gets the median and the credible intervals for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

    +
  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • +
  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • +
  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

  • +
+

+
+
+
+ +
+
+credible_range(percent=90.0, log=None, axis=0)
+

Get the range of credibility with depth

+
+
Parameters:
+
    +
  • percent (float) – Percent of the credible intervals

  • +
  • log ('e' or float, optional) – If None: The range is the difference in linear space of the credible intervals +If ‘e’ or float: The range is the difference in log space, or ratio in linear space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
+
+ +
+
+fit_mixture_to_pdf_1d(mixture, **kwargs)
+

Find peaks in the histogram along an axis.

+
+
Parameters:
+
    +
  • intervals (array_like, optional) – Accumulate the histogram between these invervals before finding peaks

  • +
  • axis (int, optional) – Axis along which to find peaks.

  • +
+
+
+
+ +
+
+classmethod fromHdf(grp, index=None)
+

Reads in the object from a HDF file

+
+ +
+
+marginalize(axis=0)
+

Get the marginal histogram along an axis

+
+
Parameters:
+
    +
  • intervals (array_like) – Array of size 2 containing lower and upper limits between which to count.

  • +
  • log ('e' or float, optional) – Entries are given in linear space, but internally bins and values are logged. +Plotting is in log space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
Returns:
+

out

+
+
Return type:
+

geobipy.Histogram1D

+
+
+
+ +
+
+mean(axis=0)
+

Gets the mean along the given axis.

+

This is not the true mean of the original samples. It is the best estimated mean using the binned counts multiplied by the axis bin centres.

+
+
Parameters:
+
    +
  • log ('e' or float, optional.) – Take the log of the mean to base “log”

  • +
  • axis (int) – Axis to take the mean along.

  • +
+
+
Returns:
+

out – The means along the axis.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+median(log=None, axis=0)
+

Gets the median for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the median.

  • +
+
+
Returns:
+

out – The medians along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+mode(log=None, axis=0)
+

Gets the median for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the median.

  • +
+
+
Returns:
+

out – The medians along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+opacity(percent=95.0, log=None, axis=0)
+

Return an opacity between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility map to less opaqueness.

+
+
Parameters:
+
    +
  • percent (float, optional.) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int, optional.) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Opacity along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+opacity_level(percent=95.0, log=None, axis=0)
+

Get the index along axis 1 from the bottom up that corresponds to the percent opacity

+
+ +
+
+pcolor(**kwargs)
+

Plot like an image

+
+
Parameters:
+
    +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
+
+ +
+
+percentile(percent, log=None, reciprocate=False, axis=0)
+

Gets the median and the credible intervals for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

    +
  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • +
  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • +
  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

  • +
+

+
+
+
+ +
+
+plot(overlay=None, **kwargs)
+

Plots the histogram

+
+ +
+
+sample(n_samples, log=None)
+

Generates samples from the histogram.

+

A uniform distribution is used for each bin to generate samples. +The number of samples generated per bin is scaled by the count for that bin using the requested number of samples.

+
+
Parameters:
+

nSamples (int) – Number of samples to generate.

+
+
Returns:
+

out – The samples.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+transparency(percent=95.0, log=None, axis=0)
+

Return a transparency value between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility are mapped to more transparency.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Transparency along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+ +
+
+geobipy.src.classes.statistics.Histogram.rand(d0, d1, ..., dn)
+

Random values in a given shape.

+
+

Note

+

This is a convenience function for users porting code from Matlab, +and wraps random_sample. That function takes a +tuple to specify the size of the output, which is consistent with +other NumPy functions like numpy.zeros and numpy.ones.

+
+

Create an array of the given shape and populate it with +random samples from a uniform distribution +over [0, 1).

+
+
Parameters:
+
    +
  • d0 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • d1 (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • ... (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
  • dn (int, optional) – The dimensions of the returned array, must be non-negative. +If no argument is given a single Python float is returned.

  • +
+
+
Returns:
+

out – Random values.

+
+
Return type:
+

ndarray, shape (d0, d1, ..., dn)

+
+
+
+

See also

+

random

+
+

Examples

+
>>> np.random.rand(3,2)
+array([[ 0.14022471,  0.96360618],  #random
+       [ 0.37601032,  0.25528411],  #random
+       [ 0.49313049,  0.94909878]]) #random
+
+
+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/Histogram2D.html b/docs/content/api/classes/statistics/Histogram2D.html new file mode 100644 index 00000000..75b7c139 --- /dev/null +++ b/docs/content/api/classes/statistics/Histogram2D.html @@ -0,0 +1,552 @@ + + + + + + + Histogram2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

Histogram2D

+
Inheritance diagram of geobipy.src.classes.statistics.Histogram2D
+ + + + +

@Histogram_Class +Module describing an efficient histogram class

+
+
+class geobipy.src.classes.statistics.Histogram2D.Histogram2D(x=None, y=None, **kwargs)
+

2D Histogram class that can update and plot efficiently.

+

Class extension to the RectilinearMesh2D. The mesh defines the x and y axes, while the Histogram2D manages the counts.

+

Histogram2D(x, y, name, units)

+
+
Parameters:
+
    +
  • x (array_like or geobipy.RectilinearMesh1D, optional) – If array_like, defines the centre x locations of each element of the 2D hitmap array.

  • +
  • y (array_like or geobipy.RectilinearMesh1D, optional) – If array_like, defines the centre y locations of each element of the 2D hitmap array.

  • +
  • name (str) – Name of the hitmap array, default is ‘Frequency’.

  • +
  • units (str) – Units of the hitmap array, default is none since counts are unitless.

  • +
+
+
Returns:
+

out – 2D histogram

+
+
Return type:
+

Histogram2D

+
+
+
+
+comboPlot(**kwargs)
+

Combination plot using the 2D histogram and two axis histograms

+
+ +
+
+compute_MinsleyFoksBedrosian2020_P_lithology(global_mixture, local_mixture, log=None, axis=0)
+

Compute the cluster probability using Minsley Foks 2020.

+

Compute the probability of clusters using both a global mixture model and a local mixture model fit to the histogram. +In MinsleyFoksBedrosian2020, the local mixture models were generated by fitting the histogram’s estimated pdf while the global mixture model +is used to label all local mixture models on a dataset scale.

+
+
Parameters:
+
    +
  • global_mixture (sklearn.mixture) – Global mixture model with n components to charactize the potential labels that local mixture might belong to.

  • +
  • local_mixture (geobipy.Mixture) – Mixture model with k components fit to the estimated pdf of the histogram.

  • +
  • log (scalar or 'e', optional) – Take the log of the histogram bins. +Defaults to None.

  • +
+
+
Returns:
+

probabilities

+
+
Return type:
+

(self.shape[axis] x n) array of the probability that the local mixtures belong to each global mixture component.

+
+
+
+ +
+
+create2DjointProbabilityDistribution(H1, H2)
+

Create 2D joint distribution from two Histograms.

+

Given two histograms each of a single variable, regrid them to the +same number of bins if necessary and take their outer product to obtain +a 2D joint probability density.

+
+
Parameters:
+
    +
  • H1 (geobipy.Histogram1D) – First histogram.

  • +
  • H2 (geobipy.Histogram1D) – Second histogram.

  • +
+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, nRepeats=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+credibleIntervals(percent=90.0, log=None, reciprocate=False, axis=0)
+

Gets the median and the credible intervals for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

    +
  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • +
  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • +
  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

  • +
+

+
+
+
+ +
+
+credibleRange(percent=90.0, log=None, axis=0)
+

Get the range of credibility with depth

+
+
Parameters:
+
    +
  • percent (float) – Percent of the credible intervals

  • +
  • log ('e' or float, optional) – If None: The range is the difference in linear space of the credible intervals +If ‘e’ or float: The range is the difference in log space, or ratio in linear space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
+
+ +
+
+fit_estimated_pdf(intervals=None, axis=0, mixture_type='pearson', iPoint=None, rank=None, verbose=False, **kwargs)
+

Find peaks in the histogram along an axis.

+
+
Parameters:
+
    +
  • intervals (array_like, optional) – Accumulate the histogram between these invervals before finding peaks

  • +
  • axis (int, optional) – Axis along which to find peaks.

  • +
+
+
+
+ +
+
+classmethod fromHdf(grp, index=None)
+

Reads in the object from a HDF file

+
+ +
+
+intervalStatistic(intervals, axis=0, statistic='mean')
+

Compute the statistic of an array between the intervals given along dimension dim.

+
+
Returns:
+

out – 2D histogram with the new intervals.

+
+
Return type:
+

geobipy.Histogram2D

+
+
+
+

See also

+
+
geobipy.RectilinearMesh2D.intervalMean

for parameter information

+
+
scipy.stats.binned_statistic

for more information

+
+
+
+
+ +
+
+marginalProbability(fractions, distributions, axis=0, reciprocateParameter=None, log=None, verbose=False, **kwargs)
+

Compute the marginal (joint) probability between the Histogram and a set of distributions.

+
+(1)\[p(distribution_{i} | \boldsymbol{v}) =\]
+
+ +
+
+marginalize(intervals=None, index=None, log=None, axis=0)
+

Get the marginal histogram along an axis

+
+
Parameters:
+
    +
  • intervals (array_like) – Array of size 2 containing lower and upper limits between which to count.

  • +
  • log ('e' or float, optional) – Entries are given in linear space, but internally bins and values are logged. +Plotting is in log space.

  • +
  • axis (int) – Axis along which to get the marginal histogram.

  • +
+
+
Returns:
+

out

+
+
Return type:
+

geobipy.Histogram1D

+
+
+
+ +
+
+mean(log=None, axis=0)
+

Gets the mean along the given axis.

+

This is not the true mean of the original samples. It is the best estimated mean using the binned counts multiplied by the axis bin centres.

+
+
Parameters:
+
    +
  • log ('e' or float, optional.) – Take the log of the mean to base “log”

  • +
  • axis (int) – Axis to take the mean along.

  • +
+
+
Returns:
+

out – The means along the axis.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+median(log=None, axis=0)
+

Gets the median for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the median.

  • +
+
+
Returns:
+

out – The medians along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+mode(log=None, axis=0)
+

Gets the mode for the specified axis.

+
+
Parameters:
+
    +
  • log ('e' or float, optional) – Take the log of the mode to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the mode.

  • +
+
+
Returns:
+

med – Contains the modes along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+opacity(percent=95.0, log=None, axis=0)
+

Return an opacity between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility map to less opaqueness.

+
+
Parameters:
+
    +
  • percent (float, optional.) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int, optional.) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Opacity along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+pcolor(**kwargs)
+

Plot the Histogram2D as an image

+
+
Parameters:
+
    +
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot +If array_like, each pixel is given an individual alpha value.

  • +
  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. +Values in c that are <= 0 are masked.

  • +
  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • +
  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • +
  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • +
  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • +
  • flipX (bool, optional) – Flip the X axis

  • +
  • flipY (bool, optional) – Flip the Y axis

  • +
  • grid (bool, optional) – Plot the grid

  • +
  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • +
  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

  • +
+
+
+
+ +
+
+percent_interval(percent=90.0, log=None, axis=0)
+

Gets the percent interval along axis.

+

Get the statistical interval, e.g. median is 50%.

+
+
Parameters:
+
    +
  • percent (float) – Interval percentage. 0.0 < percent < 100.0

  • +
  • log ('e' or float, optional) – Take the log of the interval to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

interval – Contains the interval along the specified axis. Has size equal to self.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+percentage(percent, log=None, axis=0)
+

Gets the percentage of the CDF for the specified axis.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional) – Take the log to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • +
  • axis (int) – Along which axis to obtain the CDF percentage.

  • +
+
+
Returns:
+

out – The CDF percentage along the specified axis. Has size equal to arr.shape[axis].

+
+
Return type:
+

array_like

+
+
+
+ +
+
+transparency(percent=95.0, log=None, axis=0)
+

Return a transparency value between 0 and 1 based on the difference between credible invervals of the hitmap.

+

Higher ranges in credibility are mapped to more transparency.

+
+
Parameters:
+
    +
  • percent (float) – Confidence percentage.

  • +
  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. +Else: Take the ratio of the credible intervals.

  • +
  • axis (int) – Along which axis to obtain the interval locations.

  • +
+
+
Returns:
+

out – Transparency along the axis.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+update(xValues, yValues=None, trim=False)
+

Update the histogram by counting the entry of values into the bins of the histogram.

+
+
Parameters:
+
    +
  • xValues (array_like) –

      +
    • If xValues is 1D, yValues must be given.

    • +
    • If xValues is 2D, the first dimension must have size = 2. yValues will be ignored.

    • +
    +

  • +
  • yValues (array_like, optional) – Added to the second dimension of the histogram +Ignored if xValues is 2D.

  • +
  • trim (bool) – Values outside the histogram axes are clipped to the upper and lower bins.

  • +
+
+
+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/Hitmap2D.html b/docs/content/api/classes/statistics/Hitmap2D.html new file mode 100644 index 00000000..33277a41 --- /dev/null +++ b/docs/content/api/classes/statistics/Hitmap2D.html @@ -0,0 +1,148 @@ + + + + + + + Hitmap2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/MvNormalDistribution.html b/docs/content/api/classes/statistics/MvNormalDistribution.html new file mode 100644 index 00000000..2694984b --- /dev/null +++ b/docs/content/api/classes/statistics/MvNormalDistribution.html @@ -0,0 +1,219 @@ + + + + + + + MvNormal — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

MvNormal

+
Inheritance diagram of geobipy.src.classes.statistics.MvNormalDistribution
+ + + + +

@MvNormalDistribution +Module defining a multivariate normal distribution with statistical procedures

+
+
+class geobipy.src.classes.statistics.MvNormalDistribution.MvNormal(mean, variance, ndim=None, prng=None, **kwargs)
+

Class extension to geobipy.baseDistribution

+

Handles a multivariate normal distribution. Uses Scipy to evaluate probabilities, +but Numpy to generate random samples since scipy is slow.

+

MvNormal(mean, variance, ndim, prng)

+
+
Parameters:
+
    +
  • mean (scalar or array_like) – Mean(s) for each dimension

  • +
  • variance (scalar or array_like) – Variance for each dimension

  • +
  • ndim (int, optional) – The number of dimensions in the multivariate normal. +Only used if mean and variance are scalars that are constant for all dimensions

  • +
  • prng (numpy.random.RandomState, optional) – A random state to generate random numbers. Required for parallel instantiation.

  • +
+
+
Returns:
+

out – Multivariate normal distribution.

+
+
Return type:
+

MvNormal

+
+
+
+
+bins(nBins=99, nStd=4.0, axis=None, relative=False)
+

Discretizes a range given the mean and variance of the distribution

+
+
Parameters:
+
    +
  • nBins (int, optional) – Number of bins to return.

  • +
  • nStd (float, optional) – The bin edges = mean +- nStd * variance.

  • +
  • dim (int, optional) – Get the bins of this dimension, if None, returns bins for all dimensions.

  • +
+
+
Returns:
+

bins – The bin edges.

+
+
Return type:
+

geobipy.StatArray

+
+
+
+ +
+
+property ndim
+

Place Holder for children

+
+ +
+
+pad(N)
+

Pads the mean and variance to the given size +N: Padded size

+
+ +
+
+probability(x, log, axis=None, **kwargs)
+

For a realization x, compute the probability

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/NormalDistribution.html b/docs/content/api/classes/statistics/NormalDistribution.html new file mode 100644 index 00000000..1100ec3c --- /dev/null +++ b/docs/content/api/classes/statistics/NormalDistribution.html @@ -0,0 +1,209 @@ + + + + + + + Normal distribution — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Normal distribution

+
Inheritance diagram of geobipy.src.classes.statistics.NormalDistribution
+ + + + +

@NormalDistribution +Module defining a normal distribution with statistical procedures

+
+
+class geobipy.src.classes.statistics.NormalDistribution.Normal(mean=0.0, variance=1.0, log=False, prng=None, **kwargs)
+

Univariate normal distribution

+

Normal(mean, variance)

+
+
Parameters:
+
    +
  • mean (numpy.float) – The mean of the distribution

  • +
  • variance (numpy.float) – The variance of the distribution

  • +
+
+
+
+
+bins(nBins=99, nStd=4.0)
+

Discretizes a range given the mean and variance of the distribution

+
+ +
+
+cdf(x)
+

For a realization x, compute the probability

+
+ +
+
+property ndim
+

Place Holder for children

+
+ +
+
+probability(x, log)
+

For a realization x, compute the probability

+
+ +
+
+rng(size=1)
+

Generate random numbers

+
+
Parameters:
+

N (int or sequence of ints) – Number of samples to generate

+
+
Returns:
+

numpy.ndarray

+
+
Return type:
+

out

+
+
+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/OrderStatistics.html b/docs/content/api/classes/statistics/OrderStatistics.html new file mode 100644 index 00000000..5bb040f7 --- /dev/null +++ b/docs/content/api/classes/statistics/OrderStatistics.html @@ -0,0 +1,161 @@ + + + + + + + Order Statistics — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Order Statistics

+
Inheritance diagram of geobipy.src.classes.statistics.OrderStatistics
+ + + + +

@OrderStatistics +Module defining modified order statistics as in Malinverno2002Parsimonious Bayesian Markov chain Monte Carlo inversion +in a nonlinear geophysical problem,Geophysical Journal International

+
+
+class geobipy.src.classes.statistics.OrderStatistics.Order(denominator, **kwargs)
+

Class defining Order Statistics +Specific application to Bayesian inversion of EM data

+
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/UniformDistribution.html b/docs/content/api/classes/statistics/UniformDistribution.html new file mode 100644 index 00000000..c9fc3596 --- /dev/null +++ b/docs/content/api/classes/statistics/UniformDistribution.html @@ -0,0 +1,191 @@ + + + + + + + Uniform distribution — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Uniform distribution

+
Inheritance diagram of geobipy.src.classes.statistics.UniformDistribution
+ + + + +

@UniformDistribution +Module defining a uniform distribution with statistical procedures

+
+
+class geobipy.src.classes.statistics.UniformDistribution.Uniform(min=0.0, max=1.0, log=False, prng=None)
+

Class defining a uniform distribution

+
+
+bins(nBins=99, dim=None)
+

Discretizes a range given the min and max of the distribution

+
+
Parameters:
+
    +
  • nBins (int, optional) – Number of bins to return.

  • +
  • dim (int, optional) – Get the bins of this dimension, if None, returns bins for all dimensions.

  • +
+
+
Returns:
+

bins – The bin edges.

+
+
Return type:
+

array_like

+
+
+
+ +
+
+cdf(x, log=False)
+

Get the value of the cumulative distribution function for a x

+
+ +
+
+property ndim
+

Place Holder for children

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/baseDistribution.html b/docs/content/api/classes/statistics/baseDistribution.html new file mode 100644 index 00000000..2a2245e3 --- /dev/null +++ b/docs/content/api/classes/statistics/baseDistribution.html @@ -0,0 +1,180 @@ + + + + + + + baseDistribution — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

baseDistribution

+
Inheritance diagram of geobipy.src.classes.statistics.baseDistribution
+ + + +
+
+class geobipy.src.classes.statistics.baseDistribution.baseDistribution(prng)
+

Define an abstract base distribution class

+
+
+bins()
+

Place Holder for children

+
+ +
+
+deepcopy()
+

Place holder for children

+
+ +
+
+property moment
+

Place Holder for children

+
+ +
+
+property ndim
+

Place Holder for children

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/statistics/statistics.html b/docs/content/api/classes/statistics/statistics.html new file mode 100644 index 00000000..55a3226f --- /dev/null +++ b/docs/content/api/classes/statistics/statistics.html @@ -0,0 +1,157 @@ + + + + + + + Statistics classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/content/api/classes/system/CircularLoop.html b/docs/content/api/classes/system/CircularLoop.html new file mode 100644 index 00000000..45cf7d97 --- /dev/null +++ b/docs/content/api/classes/system/CircularLoop.html @@ -0,0 +1,216 @@ + + + + + + + Circular Loop — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Circular Loop

+
Inheritance diagram of geobipy.src.classes.system.CircularLoop
+ + + + + +
+
+class geobipy.src.classes.system.CircularLoop.CircularLoop(x=None, y=None, z=None, elevation=None, orientation=None, moment=None, pitch=None, roll=None, yaw=None, radius=None, **kwargs)
+

Defines a circular loop for EM acquisition systems

+

CircularLoop(orient, moment, x, y, z, pitch, roll, yaw, radius)

+
+
Parameters:
+
    +
  • orient (str) – Orientation of the loop, ‘x’ or ‘z’

  • +
  • moment (int) – Moment of the loop

  • +
  • x (float) – X location of the loop relative to an observation location

  • +
  • y (float) – Y location of the loop relative to an observation location

  • +
  • z (float) – Z location of the loop relative to an observation location

  • +
  • pitch (float) – Pitch of the loop

  • +
  • roll (float) – Roll of the loop

  • +
  • yaw (float) – Yaw of the loop

  • +
  • radius (float) – Radius of the loop

  • +
+
+
+
+
+Bcast(world, root=0)
+

Broadcast using MPI

+
+
Parameters:
+

world (mpi4py.MPI.COMM_WORLD) – An MPI communicator

+
+
Returns:
+

out – A CircularLoop on each core

+
+
Return type:
+

CircularLoop

+
+
+
+ +
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+classmethod fromHdf(grp, index=None)
+

Reads in the object from a HDF file

+
+ +
+
+property summary
+

Print a summary

+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/system/EmLoop.html b/docs/content/api/classes/system/EmLoop.html new file mode 100644 index 00000000..46390da7 --- /dev/null +++ b/docs/content/api/classes/system/EmLoop.html @@ -0,0 +1,235 @@ + + + + + + + EmLoop — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

EmLoop

+
Inheritance diagram of geobipy.src.classes.system.EmLoop
+ + + + +
+
+class geobipy.src.classes.system.EmLoop.EmLoop(x=None, y=None, z=None, elevation=None, orientation=None, moment=None, pitch=None, roll=None, yaw=None, **kwargs)
+

Defines a loop in an EM system e.g. transmitter or reciever

+

This is an abstract base class and should not be instantiated

+

EmLoop()

+
+
+createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)
+

Create the hdf group metadata in file +parent: HDF object to create a group inside +myName: Name of the group

+
+ +
+
+classmethod fromHdf(grp, index=None)
+

Reads in the object from a HDF file

+
+ +
+
+perturb()
+

Propose a new point given the attached propsal distributions

+
+ +
+
+property probability
+

Evaluate the probability for the EM data point given the specified attached priors

+
+
Parameters:
+
    +
  • rEerr (bool) – Include the relative error when evaluating the prior

  • +
  • aEerr (bool) – Include the additive error when evaluating the prior

  • +
  • height (bool) – Include the elevation when evaluating the prior

  • +
  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • +
  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

  • +
+
+
Returns:
+

out – The evaluation of the probability using all assigned priors

+
+
Return type:
+

float64

+
+
+

Notes

+

For each boolean, the associated prior must have been set.

+
+
Raises:
+

TypeError – If a prior has not been set on a requested parameter

+
+
+
+ +
+
+set_pitch_posterior()
+
+ +
+
+set_roll_posterior()
+
+ +
+
+set_yaw_posterior()
+
+ +
+
+property summary
+

Print a summary

+
+ +
+
+writeHdf(parent, name, withPosterior=True, index=None)
+

Write the StatArray to an HDF object +parent: Upper hdf file or group +myName: object hdf name. Assumes createHdf has already been called +create: optionally create the data set as well before writing

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/system/FdemSystem.html b/docs/content/api/classes/system/FdemSystem.html new file mode 100644 index 00000000..52f631fb --- /dev/null +++ b/docs/content/api/classes/system/FdemSystem.html @@ -0,0 +1,213 @@ + + + + + + + Frequency domain system — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Frequency domain system

+
Inheritance diagram of geobipy.src.classes.system.FdemSystem
+ + + +

@FdemSystem_Class +Module describing a frequency domain EM acquisition system

+
+
+class geobipy.src.classes.system.FdemSystem.FdemSystem(frequencies, transmitter, receiver, n_frequencies=None)
+

Defines a Frequency Domain ElectroMagnetic acquisition system

+
+
+Bcast(world, root=0)
+

Broadcast the FdemSystem using MPI

+
+ +
+
+property component_id
+

For each coil orientation pair, adds the index of the frequency to the appropriate list +e.g. two coils at the i$^{th}$ frequency with ‘x’ as their orientation cause i to be added to the ‘xx’ list.

+
+ +
+
+fileInformation()
+

Description of the system file.

+
+ +
+
+classmethod fromHdf(grp)
+

Reads the object from a HDF file

+
+ +
+
+classmethod read(filename)
+

Read in a file containing the system information

+

The system file is structured using columns with the first line containing header information +Each subsequent row contains the information for each measurement frequency +freq tor tmom tx ty tz ror rmom rx ry rz +378 z 1 0 0 0 z 1 7.93 0 0 +1776 z 1 0 0 0 z 1 7.91 0 0 +…

+

where tor and ror are the orientations of the transmitter/reciever loops [x or z]. +tmom and rmom are the moments of the loops. +t/rx,y,z are the loop offsets from the observation locations in the data file.

+
+ +
+
+property summary
+

Summary of the FdemSystem

+
+ +
+
+property tensor_id
+

For each coil orientation pair, adds the index of the frequency to the appropriate list +e.g. two coils at the i$^{th}$ frequency with ‘x’ as their orientation cause i to be added to the ‘xx’ list.

+
+ +
+
+toHdf(h5obj, name)
+

Write the object to a HDF file

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/system/TdemSystem.html b/docs/content/api/classes/system/TdemSystem.html new file mode 100644 index 00000000..eb68cbdb --- /dev/null +++ b/docs/content/api/classes/system/TdemSystem.html @@ -0,0 +1,190 @@ + + + + + + + Time domain system — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Time domain system

+
Inheritance diagram of geobipy.src.classes.system.TdemSystem
+ + + +
+
+class geobipy.src.classes.system.TdemSystem.TdemSystem(offTimes=None, transmitterLoop=None, receiverLoop=None, loopOffset=None, waveform=None, offTimeFilters=None, components=['z'], system_filename=None)
+

Initialize a Time domain system class

+

TdemSystem(systemFileName)

+
+
Parameters:
+

systemFileName (str) – The system file to read from

+
+
Returns:
+

out – A time domain system class

+
+
Return type:
+

TdemSystem

+
+
+
+
+property get_modellingTimes
+

Generates regularly log spaced times that covers both the waveform and measurment times.

+
+
Parameters:
+
    +
  • waveformTimes (array_like) – Times of the waveform change points

  • +
  • measurementTimes (array_like) – Measurement times for the system

  • +
+
+
Returns:
+

out – Times spanning both the waveform and measrement times

+
+
Return type:
+

array_like

+
+
+
+ +
+
+property off_time
+

Time windows.

+
+ +
+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/api/classes/system/system.html b/docs/content/api/classes/system/system.html new file mode 100644 index 00000000..c57946b9 --- /dev/null +++ b/docs/content/api/classes/system/system.html @@ -0,0 +1,149 @@ + + + + + + + System classes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

System classes

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/getting_started/getting_started.html b/docs/content/getting_started/getting_started.html new file mode 100644 index 00000000..6af6c5e7 --- /dev/null +++ b/docs/content/getting_started/getting_started.html @@ -0,0 +1,130 @@ + + + + + + + Getting Started — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Getting Started

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/getting_started/installation.html b/docs/content/getting_started/installation.html new file mode 100644 index 00000000..9e15e0ce --- /dev/null +++ b/docs/content/getting_started/installation.html @@ -0,0 +1,275 @@ + + + + + + + Installing GeoBIPy — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Installing GeoBIPy

+

First things first, install a Python 3.5+ distribution. This is the minimum version that we have tested with. +You will also need to install Numpy and a Fortran compiler.

+

This package has a few requirements depending on what you wish to do with it.

+

If you require a serial version of the code, see Installing a serial version of GeoBIPy.

+

If you require an parallel implementation, you will need to install an MPI library, and Python’s mpi4py module. See Installing MPI and mpi4py.

+

If you require parallel file reading and writing, you will also need to install an MPI enabled HDF5 library, as well as Python’s h5py wrapper to that library. It is important to read the notes below on installing h5py on top of a parallel HDF library. The traditional “pip install h5py” will not work correctly. See Installing parallel HDF5 and h5py to do this correctly.

+

If you need to install the parallel IO version of the code, we would recommend that you start with a clean install of Python. This makes it easier to determine whether you have installed and linked the correct version of the parallel HDF5 library.

+

There are two versions when installing GeoBIPy, a serial version, and a parallel version. Since GeoBIPy uses a Fortran backend for forward modelling frequency domain data, you will need to have a Fortran compiler installed. Make sure that the compiler can handle derived data types since I make use of object oriented programming in Fortran.

+
+

Installing a serial version of GeoBIPy

+

This is the easiest installation and provides access to a serial implementation of the code.

+

Simply clone the git repository, navigate to the package folder that contains the setup.py file, and type “pip install .”

+

You should then be able to import modules from geobipy. For this type of installation mpi will not need to be installed, and the serial version of h5py will suffice i.e. the standard “pip install h5py” is fine. h5py will automatically be installed during the install of GeoBIPy since it is a dependency.

+

Side note: Let’s say you ran a production run on a parallel machine with MPI and parallel HDF capabilities. You generated all the results, copied them back to your local machine, and wish to make plots and images. You will only need to install the serial version of the code on your local machine to do this.

+
+
+

Installing a parallel version of GeoBIPy

+

Installing the parallel version of the code is a little trickier due to the dependencies necessary between the OpenMPI and/or HDF libraries, and how Python’s mpi4py and h5py wrap around those.

+
+

Installing MPI and mpi4py

+

To run this code in parallel you will need both an MPI library and the python wrapper, mpi4py. You must install MPI first before mpi4py.

+
+

MPI

+

If you are installing GeoBIPy on a parallel machine, I would think that you have access to prebuilt MPI libraries. +If you are on a local laptop, you will need to install one.

+
+
+

mpi4py

+

At this point, if you have an mpi4py module already installed, please remove it (you can check with “pip list”). +If you started with a clean installation you should not have to worry about this. +To test whether a new install of mpi4py will see the mpi library you have, just type “which mpicc”. +The path that you see should point to the implementation that you want mpi4py to link to. +Make sure you are about to install mpi4py to the correct python installation. +If you type ‘which python’ it should return the path to the correct python distribution. +If you are using environments, make sure you have activated the correct one.

+

Next, use “pip install mpi4py –no-cache-dir”. This last option is very important, without it, pip might install its own MPI library called MPICH2. +I would try to avoid this because if you need to install the HDF5 library you will need know which directories to link to (see Installing parallel HDF5 and h5py).

+

At the end of the day, h5py needs to communicate with both the correct HDF5 library and mpi4py, and both of those need to communicate with the same MPI library.

+
+
+
+

Installing parallel HDF5 and h5py

+

If a parallel HDF5 library is not available, you will need to install one. First make sure you follow Installing MPI and mpi4py so that an MPI library is available to you. You must install a HDF5 library first before h5py.

+
+

HDF5

+

When you install HDF5, make sure that the correct MPI library can be seen by typing “which mpicc”. When you configure the HDF5 library, be sure to use the –enable-parallel option.

+
+
+

h5py

+

Once the HDF5 library is installed you will need to install a parallel enabled h5py package

+

Make sure you are about to install h5py to the correct python installation. If you type ‘which python’ it should return the path to the correct python installation.

+

First check the following

+
    +
  • HDF5_DIR = Get the path to the HDF5 installation.

  • +
  • Check that ‘which mpicc’ returns the correct version of an mpi enabled compiler. This needs to point to the same MPI library that mpi4py was installed on top of.

  • +
  • Do the following, replacing items in < > with your mpicc compiler and you HDF5 install directory.

  • +
+

This will install h5py and compile the source.

+
CC=<Your mpicc compiler> HDF5_MPI="ON" HDF5_DIR=<Your HDF5_DIR> pip install --no-binary=h5py h5py
+
+
+
+
+
+
+

Installing the time domain forward modeller

+

Ross Brodie at Geoscience Australia has written a great forward modeller, gatdaem1D, in C++ with a python interface. +You can obtain that code here at the GA repository

+

Go ahead and “git clone” that repository.

+

These instructions only describe how to install Ross’ forward modeller, but it is part of a larger code base for inversion. +If you wish to install his entire package, please follow his instructions.

+
+

Prerequisites

+

To compile his forward modeller, you will need a c++ compiler, and FFTW

+

On a Mac, installing these two items is easy if you use a package manager such as homebrew

+

If you use brew, simply do the following

+
brew install gcc
+brew install fftw
+
+
+

If you do not have brew, or use a package manager, you can install fftw from source instead.

+

Download fftw-3.3.7.tar.gz from the FFTW downloads .

+

Untar the folder and install fftw using the following.

+
tar -zxvf fftw-3.3.7.tar.gz
+cd fftw-3.3.7
+mkdir build
+cd build
+../configure --prefix=path-to-install-to/fftw-3.3.7 --enable-threads
+make
+make install
+
+
+

where, path-to-install-to is the location where you want fftw to be installed.

+
+
+

Compile the gatdaem1d shared library

+

Next, within the gatdaem1d folder, navigate to the makefiles folder and modify the top part of the file “gatdaem1d_python.make” to the following

+
SHELL = /bin/sh
+.SUFFIXES:
+.SUFFIXES: .cpp .o
+cxx = g++
+cxxflags = -std=c++11 -O3 -Wall -fPIC
+FFTW_DIR = path-to-fftw
+
+ldflags    += -shared
+bindir     = ../python/gatdaem1d
+
+srcdir     = ../src
+objdir     = ./obj
+includes   = -I$(srcdir) -I$(FFTW_DIR)/include
+libs       = -L$(FFTW_DIR)/lib -lfftw3
+library    = $(bindir)/gatdaem1d.so
+
+
+

You can find out where brew installed fftw by typing

+
brew info fftw
+
+
+

Which may return something like “/usr/local/Cellar/fftw/3.3.5”

+

In this case, path-to-fftw is “/usr/local/Cellar/fftw/3.3.5”

+

If you installed fftw from source, then path-to-fftw is that install path.

+

Next, type the following to compile the gatdaem1d c++ code.

+
make -f gatdaem1d_python.make
+
+
+
+
+

Installing the Python Bindings

+

Finally, to install the python wrapper to gatdaem1d, navigate to the python folder of the gatdaem1d repository. +Type,

+
pip install .
+
+
+

You should now have access to the time domain forward modeller within geobipy.

+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/content/getting_started/running_geobipy.html b/docs/content/getting_started/running_geobipy.html new file mode 100644 index 00000000..3b138f70 --- /dev/null +++ b/docs/content/getting_started/running_geobipy.html @@ -0,0 +1,313 @@ + + + + + + + Running GeoBIPy — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Running GeoBIPy

+

There are two methods of running GeoBIPy from the command line once it is installed. +For the serial version the following can be used

+
geobipySerial <userParameterFile> <Output Folder>
+
+
+

For a parallel installed version use the following, (replace the MPI redirect with whatever is suitable for your machine)

+
mpirun geobipyParallel <userParameterFile> <Output Folder>
+
+
+

In both cases, <Output Folder> specifies where the HDF5 files will be written, while the <userParameterFile> is a python script that contains the customizable parameters for GeoBIPy. +Below is an example scipt that you can use for reference.

+
# General information about specifying parameters.
+# The following list of parameters can be given either a single value or a list of values
+# of length equal to the number of systems in the data. If one value is specified and there
+# are multiple systems, that value is used for all of them.
+# initialRelativeError
+# minimumRelativeError
+# maximumRelativeError
+# initialAdditiveError
+# minimumAdditiveError
+# maximumAdditiveError
+# relativeErrorProposalVariance
+# additiveErrorProposalVariance
+
+# -------------------------------------------------------
+# General file structure information.
+# -------------------------------------------------------
+# Data folder
+data_directory = "..//..//supplementary//data"
+# The data_filename and system_filename options are single strings for single system dataset,
+# or a list of str for multi-system datasets like Skytem.
+# Data File Name. If there are multiple, encompass them with [ ].
+data_filename = data_directory + "//Resolve_single.txt"
+# System File Name. If there are multiple, encompass them with [ ].
+system_filename = data_directory + "//FdemSystem2.stm"
+
+# Define the data type to invert
+data_type = FdemData
+
+# Maximum number of Markov Chains per data point.
+n_markov_chains = 10000
+
+# -------------------------------------------------------
+# General GeoBIPy options.
+# -------------------------------------------------------
+# Interactively plot a single data point as it progresses
+interactive_plot = False
+# How often to update the plot. (lower is generally slower)
+update_plot_every = 1000
+# Save a PNG of the final results for each data point.
+save_png = False
+# Save the results of the McMC inversion to HDF5 files. (Generally always True)
+save_hdf5 = True
+
+# -------------------------------------------------------
+# Turning on or off different solvable parameters.
+# -------------------------------------------------------
+# Parameter Priors
+# solveParameter will prevent parameters from exploding to very large or very small numbers.
+# solveGradient prevents large changes in parameters value from occurring.
+# If both of these are active, the recovered earth models generally contain
+# less layers due to an implicit constraint.
+# If you feel that your recovered models are too conservative, try turning one of these off.
+# It is highly recommended to have at least one of these options turned on!
+# Use a prior on the parameter magnitude.
+solve_parameter = False
+# Use the Prior on the difference in log parameter diff(log(X))
+solve_gradient = True
+
+# Use the prior on the relative data errors
+solve_relative_error = True
+# Use the prior on the additive data errors
+solve_additive_error = True
+# Use the prior on the data height
+solve_height = True
+# Use the prior on the calibration parameters for the data
+solve_calibration = False
+
+# -------------------------------------------------------
+# Prior Details
+# -------------------------------------------------------
+# Earth model prior details
+# -------------------------
+# Maximum number of layers in the 1D model
+maximum_number_of_layers = 30
+# Minimum layer depth in metres
+minimum_depth = 1.0
+# Maximum layer depth in metres
+maximum_depth = 150.0
+# Minimum layer thickness.
+# If minimumThickness: None, it will be autocalculated.
+minimum_thickness = None
+
+# Data prior details
+# ------------------
+# The data priors are imposed on three different aspects of the data.
+# The relative and additive error and the elevation of the data point.
+# Data uncertainty priors are used if solveRelativeError or solveAdditiveError are True.
+# If the data file contains columns of the estimated standard deviations, they are used as the initial values
+# when starting an McMC inversion. If the file does not contain these estimates, then the initial
+# values are used below as sqrt((relative * data)^2 + (additive)^2).
+
+# Assign an initial percentage relative Error
+# If the file contains no standard deviations, this will be used
+# to assign the initial data uncertainties.
+initial_relative_error = 0.05
+## Relative Error Prior Details
+# Minimum Relative Error
+minimum_relative_error = 0.001
+# Maximum Relative Error
+maximum_relative_error = 0.5
+
+# Assign an initial additive error level.
+# If the file contains no standard deviations, this will be used
+# to assign the initial data uncertainties.
+initial_additive_error = 5.0
+# Additive Error Prior Details
+# Minimum Additive Error
+minimum_additive_error = 3.0
+# Maximum Relative Error
+maximum_additive_error = 20.0
+
+# Elevation range allowed (m), either side of measured height
+maximum_height_change = 1.0
+
+# -------------------------------------------------------
+# Proposal details
+# -------------------------------------------------------
+
+# Data proposal details
+# ---------------------
+# The relative, additive, and elevation proposal variances are assigned to
+# normal distributions with a mean equal to its value in the current model (of the Markov chain)
+# These variances are used when we randomly choose a new value for that given variable.
+# Proposal variance for the relative error
+relative_error_proposal_variance = 2.5e-7
+# Proposal variance for the additive error
+additive_error_proposal_variance = 1.0e-4
+# Proposal variance of the elevation
+height_proposal_variance = 0.01
+
+# Earth model proposal details
+# ----------------------------
+# Evolution Probabilities for earth model manipulation during the Markov chain.
+# These four values are internally scaled such that their sum is 1.0.
+# Probability that a layer is inserted into the model.
+probability_of_birth = 1.0/6.0
+# Probablitiy that a layer is removed from the model.
+probability_of_death = 1.0/6.0
+# Probability that an interface in the model is perturbed.
+probability_of_perturb = 1.0/6.0
+# Probability of no change occuring to the layers of the model.
+probability_of_no_change = 0.5
+
+# -------------------------------------------------------
+# Typically Defaulted parameters
+# -------------------------------------------------------
+# Standard Deviation of log(rho): log(1 + factor)
+# Default is 10.0
+factor = None
+# Standard Deviation for the difference in layer resistivity
+# Default is 1.5
+gradient_standard_deviation = None
+# Initial scaling factor for proposal covariance
+covariance_scaling = None
+# Scaling factor for data misfit
+multiplier = None
+# Clipping Ratio for interface contrasts
+clip_ratio = None
+# Only sample the prior
+ignore_likelihood = False
+
+# Impose bounds on the parameter value
+# None, or a length 2 list i.e. [a, b]
+parameter_limits = None
+
+# Display the resistivity?
+reciprocate_parameters = True
+
+verbose = False
+
+# Don't change this.
+if (timeDomain):
+dataInit = 'TdemData()'
+else:
+dataInit = 'FdemData()'
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/index.html b/docs/examples/1D_Inference/index.html new file mode 100644 index 00000000..c896df6a --- /dev/null +++ b/docs/examples/1D_Inference/index.html @@ -0,0 +1,163 @@ + + + + + + + 1D Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

1D Inference

+

There are a couple of ways to run an inference using geobipy, the first is via command line using

+
geobipy skytem_options.py <output folder>
+
+
+

The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples)

+
+

Running GeoBIPy to invert Resolve data

+
Running GeoBIPy to invert Resolve data
+
+

Running GeoBIPy to invert Skytem data

+
Running GeoBIPy to invert Skytem data
+
+

Running GeoBIPy to invert Tempest data

+
Running GeoBIPy to invert Tempest data
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/plot_inference_1d_resolve.html b/docs/examples/1D_Inference/plot_inference_1d_resolve.html new file mode 100644 index 00000000..b4977b30 --- /dev/null +++ b/docs/examples/1D_Inference/plot_inference_1d_resolve.html @@ -0,0 +1,251 @@ + + + + + + + Running GeoBIPy to invert Resolve data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Resolve data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+data_type = "Resolve"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+parameter_file = "../../supplementary/options_files/{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv'
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=2, **kwargs)
+
+
+
    +
  • plot inference 1d resolve
  • +
  • Fiducial [2], Frequency Domain EM Data
  • +
+
Using user input file ../../supplementary/options_files/Resolve_options
+Output files will be produced at Resolve/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary//data//Resolve_glacial.csv and system files ..//..//supplementary//data//FdemSystem2.stm
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:00.097752 h:m:s
+i=5000, k=2, acc=*34.600, 0.007 s/Model, 35.645 s Elapsed
+
+Remaining Points -2/1 || Elapsed Time: 0:00:36.760574 h:m:s || ETA 0:00:12.253525 h:m:s
+
+
+

Total running time of the script: (0 minutes 37.269 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/plot_inference_1d_skytem.html b/docs/examples/1D_Inference/plot_inference_1d_skytem.html new file mode 100644 index 00000000..c5249552 --- /dev/null +++ b/docs/examples/1D_Inference/plot_inference_1d_skytem.html @@ -0,0 +1,247 @@ + + + + + + + Running GeoBIPy to invert Skytem data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Skytem data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+data_type = "Skytem_512"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+parameter_file = "../../supplementary/options_files/{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv'
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=2, **kwargs)
+
+
+
Using user input file ../../supplementary/options_files/Skytem_512_options
+Output files will be produced at Skytem_512/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary//data//Skytem_512_glacial.csv and system files ['..//..//supplementary//data/SkytemHM_512.stm', '..//..//supplementary//data/SkytemLM_512.stm']
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:00.170724 h:m:s
+i=5000, k=6, acc=*17.440, 0.012 s/Model, 58.130 s Elapsed
+
+Remaining Points -2/1 || Elapsed Time: 0:00:58.301548 h:m:s || ETA 0:00:19.433849 h:m:s
+
+
+

Total running time of the script: (0 minutes 58.527 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/plot_inference_1d_tempest.html b/docs/examples/1D_Inference/plot_inference_1d_tempest.html new file mode 100644 index 00000000..926753c5 --- /dev/null +++ b/docs/examples/1D_Inference/plot_inference_1d_tempest.html @@ -0,0 +1,251 @@ + + + + + + + Running GeoBIPy to invert Tempest data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Tempest data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+data_type = "Tempest"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+parameter_file = "../../supplementary/options_files/{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = kwargs['data_filename'] + '//' + data_filename + '.csv'
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=2, **kwargs)
+
+
+
    +
  • plot inference 1d tempest
  • +
  • Fiducial [2.], Time Domain EM Data
  • +
+
Using user input file ../../supplementary/options_files/Tempest_options
+Output files will be produced at Tempest/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary//data//Tempest_glacial.csv and system files ..//..//supplementary//data/Tempest.stm
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:00.264718 h:m:s
+i=5000, k=7, acc=*27.680, 0.016 s/Model, 79.015 s Elapsed
+
+Remaining Points -2/1 || Elapsed Time: 0:01:20.439016 h:m:s || ETA 0:00:26.813005 h:m:s
+
+
+

Total running time of the script: (1 minutes 21.185 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/readme.html b/docs/examples/1D_Inference/readme.html new file mode 100644 index 00000000..58ef1447 --- /dev/null +++ b/docs/examples/1D_Inference/readme.html @@ -0,0 +1,121 @@ + + + + + + + 1D Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

1D Inference

+

There are a couple of ways to run an inference using geobipy, the first is via command line using

+
geobipy skytem_options.py <output folder>
+
+
+

The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples)

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/1D_Inference/sg_execution_times.html b/docs/examples/1D_Inference/sg_execution_times.html new file mode 100644 index 00000000..6aa47119 --- /dev/null +++ b/docs/examples/1D_Inference/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

02:56.981 total execution time for 3 files from examples/1D_Inference:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Running GeoBIPy to invert Tempest data (plot_inference_1d_tempest.py)

01:21.185

0.0

Running GeoBIPy to invert Skytem data (plot_inference_1d_skytem.py)

00:58.527

0.0

Running GeoBIPy to invert Resolve data (plot_inference_1d_resolve.py)

00:37.269

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Data/README.html b/docs/examples/Data/README.html new file mode 100644 index 00000000..c1e56f22 --- /dev/null +++ b/docs/examples/Data/README.html @@ -0,0 +1,115 @@ + + + + + + + Data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Data

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Data/index.html b/docs/examples/Data/index.html new file mode 100644 index 00000000..a132743f --- /dev/null +++ b/docs/examples/Data/index.html @@ -0,0 +1,139 @@ + + + + + + + Data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Data

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Data/sg_execution_times.html b/docs/examples/Data/sg_execution_times.html new file mode 100644 index 00000000..b4ad6817 --- /dev/null +++ b/docs/examples/Data/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from examples/Data:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/README.html b/docs/examples/Datapoints/README.html new file mode 100644 index 00000000..95cb2bfd --- /dev/null +++ b/docs/examples/Datapoints/README.html @@ -0,0 +1,115 @@ + + + + + + + Datapoints — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Datapoints

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/index.html b/docs/examples/Datapoints/index.html new file mode 100644 index 00000000..e01b6c25 --- /dev/null +++ b/docs/examples/Datapoints/index.html @@ -0,0 +1,155 @@ + + + + + + + Datapoints — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Datapoints

+
+

Frequency domain datapoint

+
Frequency domain datapoint
+
+

Skytem Datapoint Class

+
Skytem Datapoint Class
+
+

Tempest Datapoint Class

+
Tempest Datapoint Class
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/plot_resolve_datapoint.html b/docs/examples/Datapoints/plot_resolve_datapoint.html new file mode 100644 index 00000000..f9d06123 --- /dev/null +++ b/docs/examples/Datapoints/plot_resolve_datapoint.html @@ -0,0 +1,388 @@ + + + + + + + Frequency domain datapoint — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Frequency domain datapoint

+
from os.path import join
+import numpy as np
+import h5py
+import matplotlib.pyplot as plt
+from geobipy import CircularLoops
+from geobipy import FdemSystem
+from geobipy import FdemData
+from geobipy import FdemDataPoint
+from geobipy import RectilinearMesh1D
+from geobipy import Model
+from geobipy import StatArray
+from geobipy import Distribution
+
+# Instantiating a frequency domain data point
+# +++++++++++++++++++++++++++++++++++++++++++
+#
+# To instantiate a frequency domain datapoint we need to define some
+# characteristics of the acquisition system.
+#
+# We need to define the frequencies in Hz of the transmitter,
+# and the geometery of the loops used for each frequency.
+
+frequencies = np.asarray([380.0, 1776.0, 3345.0, 8171.0, 41020.0, 129550.0])
+
+# Transmitter positions are defined relative to the observation locations in the data
+# This is usually a constant offset for all data points.
+transmitters = CircularLoops(orientation=['z','z','x','z','z','z'],
+                             moment=np.r_[1, 1, -1, 1, 1, 1],
+                             x = np.r_[0,0,0,0,0,0],
+                             y = np.r_[0,0,0,0,0,0],
+                             z = np.r_[0,0,0,0,0,0],
+                             pitch = np.r_[0,0,0,0,0,0],
+                             roll = np.r_[0,0,0,0,0,0],
+                             yaw = np.r_[0,0,0,0,0,0],
+                             radius = np.r_[1,1,1,1,1,1])
+
+# Receiver positions are defined relative to the transmitter
+receivers = CircularLoops(orientation=['z','z','x','z','z','z'],
+                             moment=np.r_[1, 1, -1, 1, 1, 1],
+                             x = np.r_[7.91, 7.91, 9.03, 7.91, 7.91, 7.89],
+                             y = np.r_[0,0,0,0,0,0],
+                             z = np.r_[0,0,0,0,0,0],
+                             pitch = np.r_[0,0,0,0,0,0],
+                             roll = np.r_[0,0,0,0,0,0],
+                             yaw = np.r_[0,0,0,0,0,0],
+                             radius = np.r_[1,1,1,1,1,1])
+
+# Now we can instantiate the system.
+fds = FdemSystem(frequencies, transmitters, receivers)
+
+# And use the system to instantiate a datapoint
+#
+# Note the extra arguments that can be used to create the data point.
+# data is for any observed data one might have, while std are the estimated standard
+# deviations of those observed data.
+#
+# Define some in-phase then quadrature data for each frequency.
+data = np.r_[145.3, 435.8, 260.6, 875.1, 1502.7, 1516.9,
+             217.9, 412.5, 178.7, 516.5, 405.7, 255.7]
+
+fdp = FdemDataPoint(x=0.0, y=0.0, z=30.0, elevation=0.0,
+                    data=data, std=None, predictedData=None,
+                    system=fds, lineNumber=0.0, fiducial=0.0)
+
+# plt.figure()
+# _ = fdp.plot()
+
+# Obtaining a datapoint from a dataset
+# ++++++++++++++++++++++++++++++++++++
+#
+# More often than not, our observed data is stored in a file on disk.
+# We can read in a dataset and pull datapoints from it.
+#
+# For more information about the frequency domain data set see :ref:`Frequency domain dataset`
+
+# Set some paths and file names
+dataFolder = "..//..//supplementary//Data//"
+# The data file name
+dataFile = dataFolder + 'Resolve2.txt'
+# The EM system file name
+systemFile = dataFolder + 'FdemSystem2.stm'
+
+
+

Initialize and read an EM data set +Prepare the dataset so that we can read a point at a time.

+
Dataset = FdemData._initialize_sequential_reading(dataFile, systemFile)
+# Get a datapoint from the file.
+fdp = Dataset._read_record()
+
+
+
# # Initialize and read an EM data set
+# D = FdemData.read_csv(dataFile,systemFile)
+
+# # Get a data point from the dataset
+# fdp = D.datapoint(0)
+# plt.figure()
+# _ = fdp.plot()
+
+# Using a resolve datapoint
+# +++++++++++++++++++++++++
+
+# We can define a 1D layered earth model, and use it to predict some data
+nCells = 19
+par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$")
+depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm')
+depth[-1] = np.inf
+mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par)
+
+# Forward model the data
+fdp.forward(mod)
+
+plt.figure()
+plt.subplot(121)
+_ = mod.pcolor(transpose=True)
+plt.subplot(122)
+_ = fdp.plot_predicted()
+plt.tight_layout()
+
+# Compute the sensitivity matrix for a given model
+J = fdp.sensitivity(mod)
+
+plt.figure()
+_ = np.abs(J).pcolor(equalize=True, log=10, flipY=True)
+
+# Attaching statistical descriptors to the resolve datapoint
+# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+# Set values of relative and additive error for both systems.
+fdp.relative_error = 0.05
+fdp.additive_error = 10.0
+# Define a multivariate log normal distribution as the prior on the predicted data.
+fdp.predictedData.prior = Distribution('MvLogNormal', fdp.data[fdp.active], fdp.std[fdp.active]**2.0, prng=prng)
+
+# This allows us to evaluate the likelihood of the predicted data
+print(fdp.likelihood(log=True))
+# Or the misfit
+print(fdp.data_misfit())
+
+# Plot the misfits for a range of half space conductivities
+plt.figure()
+_ = fdp.plotHalfSpaceResponses(-6.0, 4.0, 200)
+
+plt.title("Halfspace responses");
+
+# We can perform a quick search for the best fitting half space
+halfspace = fdp.find_best_halfspace()
+print('Best half space conductivity is {} $S/m$'.format(halfspace.values))
+plt.figure()
+_ = fdp.plot()
+_ = fdp.plot_predicted()
+
+# Compute the misfit between observed and predicted data
+print(fdp.data_misfit())
+
+# We can attach priors to the height of the datapoint,
+# the relative error multiplier, and the additive error noise floor
+
+
+# Define the distributions used as priors.
+zPrior = Distribution('Uniform', min=np.float64(fdp.z) - 2.0, max=np.float64(fdp.z) + 2.0, prng=prng)
+relativePrior = Distribution('Uniform', min=0.01, max=0.5, prng=prng)
+additivePrior = Distribution('Uniform', min=5, max=15, prng=prng)
+fdp.set_priors(z_prior=zPrior, relative_error_prior=relativePrior, additive_error_prior=additivePrior, prng=prng)
+
+
+# In order to perturb our solvable parameters, we need to attach proposal distributions
+z_proposal = Distribution('Normal', mean=fdp.z, variance = 0.01, prng=prng)
+relativeProposal = Distribution('MvNormal', mean=fdp.relative_error, variance=2.5e-7, prng=prng)
+additiveProposal = Distribution('MvLogNormal', mean=fdp.additive_error, variance=1e-4, prng=prng)
+fdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal)
+
+# With priors set we can auto generate the posteriors
+fdp.set_posteriors()
+
+
+nCells = 19
+par = StatArray(np.linspace(0.01, 0.1, nCells), "Conductivity", "$\frac{S}{m}$")
+depth = StatArray(np.arange(nCells+1) * 10.0, "Depth", 'm')
+depth[-1] = np.inf
+mod = Model(mesh=RectilinearMesh1D(edges=depth), values=par)
+fdp.forward(mod)
+
+# Perturb the datapoint and record the perturbations
+for i in range(10):
+    fdp.perturb()
+    fdp.update_posteriors()
+
+
+# Plot the posterior distributions
+# fig = plt.figure()
+fdp.plot_posteriors(overlay=fdp)
+
+import h5py
+with h5py.File('fdp.h5', 'w') as f:
+    fdp.createHdf(f, 'fdp', withPosterior=True)
+    fdp.writeHdf(f, 'fdp', withPosterior=True)
+
+with h5py.File('fdp.h5', 'r') as f:
+    fdp1 = FdemDataPoint.fromHdf(f['fdp'])
+
+fdp1.plot_posteriors(overlay=fdp1)
+
+import h5py
+with h5py.File('fdp.h5', 'w') as f:
+    fdp.createHdf(f, 'fdp', withPosterior=True, add_axis=np.arange(10.0))
+
+    for i in range(10):
+        fdp.writeHdf(f, 'fdp', withPosterior=True, index=i)
+
+from geobipy import FdemData
+with h5py.File('fdp.h5', 'r') as f:
+    fdp1 = FdemDataPoint.fromHdf(f['fdp'], index=0)
+    fdp2 = FdemData.fromHdf(f['fdp'])
+
+fdp1.plot_posteriors(overlay=fdp1)
+
+plt.show()
+# %%
+
+
+
    +
  • Frequency Domain EM Data
  • +
  • plot resolve datapoint
  • +
  • Halfspace responses
  • +
  • Frequency Domain EM Data, Frequency Domain EM Data, Frequency Domain EM Data, Frequency Domain EM Data
  • +
+
-733.5454886696688
+1367.81945885548
+Best half space conductivity is [0.097701] $S/m$
+45286.828623928755
+
+
+

Total running time of the script: (0 minutes 8.395 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/plot_skytem_datapoint.html b/docs/examples/Datapoints/plot_skytem_datapoint.html new file mode 100644 index 00000000..7214e464 --- /dev/null +++ b/docs/examples/Datapoints/plot_skytem_datapoint.html @@ -0,0 +1,386 @@ + + + + + + + Skytem Datapoint Class — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Skytem Datapoint Class

+

Credits: +We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +https://github.com/GeoscienceAustralia/ga-aem

+

For ground-based time domain data, we are using Dieter Werthmuller’s python package Empymod +https://empymod.github.io/

+

Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy

+
from os.path import join
+import numpy as np
+import h5py
+import matplotlib.pyplot as plt
+from geobipy import Waveform
+from geobipy import SquareLoop, CircularLoop
+from geobipy import butterworth
+from geobipy import TdemSystem
+from geobipy import TdemData
+from geobipy import TdemDataPoint
+from geobipy import RectilinearMesh1D
+from geobipy import Model
+from geobipy import StatArray
+from geobipy import Distribution
+
+dataFolder = "..//..//supplementary//data//"
+
+# Obtaining a datapoint from a dataset
+# ++++++++++++++++++++++++++++++++++++
+# More often than not, our observed data is stored in a file on disk.
+# We can read in a dataset and pull datapoints from it.
+#
+# For more information about the time domain data set, see :ref:`Time domain dataset`
+
+# The data file name
+dataFile=dataFolder + 'skytem_512_saline_clay.csv'
+# The EM system file name
+systemFile=[dataFolder + 'SkytemHM_512.stm', dataFolder + 'SkytemLM_512.stm']
+
+
+

Initialize and read an EM data set +Prepare the dataset so that we can read a point at a time.

+
Dataset = TdemData._initialize_sequential_reading(dataFile, systemFile)
+# Get a datapoint from the file.
+tdp = Dataset._read_record()
+
+Dataset._file.close()
+
+
+
+

Using a time domain datapoint

+

We can define a 1D layered earth model, and use it to predict some data

+
par = StatArray(np.r_[500.0, 20.0], "Conductivity", "$\frac{S}{m}$")
+mod = Model(RectilinearMesh1D(edges=np.r_[0, 75.0, np.inf]), values=par)
+
+
+

Forward model the data

+
tdp.forward(mod)
+
+
+
plt.figure()
+plt.subplot(121)
+_ = mod.pcolor()
+plt.subplot(122)
+_ = tdp.plot()
+_ = tdp.plot_predicted()
+plt.tight_layout()
+
+
+Time Domain EM Data
/Users/nfoks/codes/repositories/geobipy/geobipy/src/classes/data/datapoint/TdemDataPoint.py:354: RuntimeWarning: divide by zero encountered in log
+  additive_error = exp(log(self.additive_error[i]) - 0.5 * (log(off_times) - log(1e-3)))
+
+
+
plt.figure()
+tdp.plotDataResidual(yscale='log', xscale='log')
+plt.title('new')
+
+
+new
Text(0.5, 1.0, 'new')
+
+
+

Compute the sensitivity matrix for a given model

+
J = tdp.sensitivity(mod)
+plt.figure()
+_ = np.abs(J).pcolor(equalize=True, log=10, flipY=True)
+
+
+plot skytem datapoint
+
+

Attaching statistical descriptors to the skytem datapoint

+
from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+# Set values of relative and additive error for both systems.
+tdp.relative_error = np.r_[0.05, 0.05]
+tdp.additive_error = np.r_[1e-14, 1e-13]
+# Define a multivariate log normal distribution as the prior on the predicted data.
+tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng)
+
+
+

This allows us to evaluate the likelihood of the predicted data

+
print(tdp.likelihood(log=True))
+# Or the misfit
+print(tdp.data_misfit())
+
+
+
-324824.70759632764
+652129.2354668385
+
+
+

Plot the misfits for a range of half space conductivities

+
plt.figure()
+_ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200)
+plt.title("Halfspace responses")
+
+
+Halfspace responses
Text(0.5, 1.0, 'Halfspace responses')
+
+
+

We can perform a quick search for the best fitting half space

+
halfspace = tdp.find_best_halfspace()
+
+print('Best half space conductivity is {} $S/m$'.format(halfspace.values))
+plt.figure()
+_ = tdp.plot()
+_ = tdp.plot_predicted()
+
+
+Time Domain EM Data
Best half space conductivity is [0.01047616] $S/m$
+
+
+

Compute the misfit between observed and predicted data

+
print(tdp.data_misfit())
+
+
+
19992.94964076136
+
+
+

We can attach priors to the height of the datapoint, +the relative error multiplier, and the additive error noise floor

+
# Define the distributions used as priors.
+z_prior = Distribution('Uniform', min=np.float64(tdp.z) - 2.0, max=np.float64(tdp.z) + 2.0, prng=prng)
+relativePrior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng)
+additivePrior = Distribution('Uniform', min=np.r_[1e-16, 1e-16], max=np.r_[1e-10, 1e-10], log=True, prng=prng)
+tdp.set_priors(relative_error_prior=relativePrior, additive_error_prior=additivePrior, z_prior=z_prior, prng=prng)
+
+
+

In order to perturb our solvable parameters, we need to attach proposal distributions

+
z_proposal = Distribution('Normal', mean=tdp.z, variance = 0.01, prng=prng)
+relativeProposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-7, prng=prng)
+additiveProposal = Distribution('MvLogNormal', mean=tdp.additive_error, variance=2.5e-3, linearSpace=True, prng=prng)
+tdp.set_proposals(relativeProposal, additiveProposal, z_proposal=z_proposal, prng=prng)
+
+
+

With priorss set we can auto generate the posteriors

+
tdp.set_posteriors()
+
+
+

Perturb the datapoint and record the perturbations +Note we are not using the priors to accept or reject perturbations.

+
for i in range(10):
+    tdp.perturb()
+    tdp.update_posteriors()
+
+
+

Plot the posterior distributions

+
tdp.plot_posteriors(overlay=tdp)
+
+plt.show()
+
+
+Time Domain EM Data
+
+

File Format for a time domain datapoint

+

Here we describe the file format for a time domain datapoint.

+

For individual datapoints we are using the AarhusInv data format.

+

Here we take the description for the AarhusInv TEM data file, modified to reflect what we can +currently handle in GeoBIPy.

+
+
Line 1 :: string

User-defined label describing the TEM datapoint. +This line must contain the following, separated by semicolons. +XUTM= +YUTM= +Elevation= +StationNumber= +LineNumber= +Current=

+
+
Line 2 :: first integer, sourceType

7 = Rectangular loop source parallel to the x - y plane

+
+
Line 2 :: second integer, polarization

3 = Vertical magnetic field

+
+
Line 3 :: 6 floats, transmitter and receiver offsets relative to X/Y UTM location.

If sourceType = 7, Position of the center loop sounding.

+
+
Line 4 :: Transmitter loop dimensions

If sourceType = 7, 2 floats. Loop side length in the x and y directions

+
+
Line 5 :: Fixed

3 3 3

+
+
Line 6 :: first integer, transmitter waveform type. Fixed

3 = User defined waveform.

+
+
Line 6 :: second integer, number of transmitter waveforms. Fixed

1

+
+
Line 7 :: transmitter waveform definition

A user-defined waveform with piecewise linear segments. +A full transmitter waveform definition consists of a number of linear segments +This line contains an integer as the first entry, which specifies the number of +segments, followed by each segment with 4 floats each. The 4 floats per segment +are the start and end times, and start and end amplitudes of the waveform. e.g. +3 -8.333e-03 -8.033e-03 0.0 1.0 -8.033e-03 0.0 1.0 1.0 0.0 5.4e-06 1.0 0.0

+
+
Line 8 :: On time information. Not used but needs specifying.

1 1 1

+
+
Line 9 :: On time low-pass filters. Not used but need specifying.

0

+
+
Line 10 :: On time high-pass filters. Not used but need specifying.

0

+
+
Line 11 :: Front-gate time. Not used but need specifying.

0.0

+
+
Line 12 :: first integer, Number of off time filters

Number of filters

+
+
Line 12 :: second integer, Order of the butterworth filter

1 or 2

+
+
Line 12 :: cutoff frequencies Hz, one per the number of filters

e.g. 4.5e5

+
+
Line 13 :: Off time high pass filters.

See Line 12

+
+
+

Lines after 13 contain 3 columns that pertain to +Measurement Time, Data Value, Estimated Standard Deviation

+

Example data files are contained in +the supplementary folder in this repository

+

Total running time of the script: (0 minutes 3.346 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/plot_tempest_datapoint.html b/docs/examples/Datapoints/plot_tempest_datapoint.html new file mode 100644 index 00000000..b08cf472 --- /dev/null +++ b/docs/examples/Datapoints/plot_tempest_datapoint.html @@ -0,0 +1,380 @@ + + + + + + + Tempest Datapoint Class — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Tempest Datapoint Class

+

Credits: +We would like to thank Ross Brodie at Geoscience Australia for his airborne time domain forward modeller +https://github.com/GeoscienceAustralia/ga-aem

+

For ground-based time domain data, we are using Dieter Werthmuller’s python package Empymod +https://empymod.github.io/

+

Thanks to Dieter for his help getting Empymod ready for incorporation into GeoBIPy

+
from os.path import join
+import numpy as np
+import h5py
+import matplotlib.pyplot as plt
+from geobipy import TempestData
+# from geobipy import TemDataPoint
+from geobipy import RectilinearMesh1D
+from geobipy import Model
+from geobipy import StatArray
+from geobipy import Distribution
+from geobipy import get_prng
+
+dataFolder = "..//..//supplementary//data//"
+# dataFolder = "source//examples//supplementary//Data"
+
+# Obtaining a tempest datapoint from a dataset
+# ++++++++++++++++++++++++++++++++++++++++++++
+# More often than not, our observed data is stored in a file on disk.
+# We can read in a dataset and pull datapoints from it.
+#
+# For more information about the time domain data set, see :ref:`Time domain dataset`
+
+# The data file name
+dataFile = dataFolder + 'tempest_saline_clay.csv'
+# The EM system file name
+systemFile = dataFolder + 'Tempest.stm'
+
+# Prepare the dataset so that we can read a point at a time.
+Dataset = TempestData._initialize_sequential_reading(dataFile, systemFile)
+# Get a datapoint from the file.
+tdp = Dataset._read_record(0)
+
+plt.figure()
+tdp.plot()
+
+prng = get_prng(seed=146100583096709124601953385843316024947)
+
+
+Time Domain EM Data
+

Using a tempest domain datapoint

+

We can define a 1D layered earth model, and use it to predict some data

+
par = StatArray(np.r_[0.01, 0.1, 1.], "Conductivity", "$\frac{S}{m}$")
+mod = Model(mesh=RectilinearMesh1D(edges=np.r_[0.0, 50.0, 75.0, np.inf]), values=par)
+
+par = StatArray(np.logspace(-3, 3, 30), "Conductivity", "$\frac{S}{m}$")
+e = np.linspace(0, 350, 31); e[-1] = np.inf
+mod = Model(mesh=RectilinearMesh1D(edges=e), values=par)
+
+
+

Forward model the data

+
tdp.forward(mod)
+
+print('primary', tdp.primary_field)
+print('sx', tdp.secondary_field[:15])
+print('sz', tdp.secondary_field[15:])
+
+# #%%
+# plt.figure()
+# plt.subplot(121)
+# _ = mod.pcolor(transpose=True)
+# plt.subplot(122)
+# _ = tdp.plot()
+# _ = tdp.plot_predicted()
+# plt.tight_layout()
+# plt.suptitle('Model and response')
+
+# #%%
+# # plt.figure()
+# # tdp.plotDataResidual(xscale='log')
+# # plt.title('data residual')
+
+# #%%
+# # Compute the sensitivity matrix for a given model
+J = tdp.sensitivity(mod)
+# plt.figure()
+# _ = np.abs(J).pcolor(equalize=True, log=10, flipY=True)
+
+print('J', J)
+# print('J shape', J.shape)
+# print('sx 0', J[:16, 0])
+
+tdp.fm_dlogc(mod)
+
+print('new primary', tdp.primary_field)
+print('sx', tdp.secondary_field[:15])
+print('sz', tdp.secondary_field[15:])
+
+print('new J', tdp.sensitivity_matrix)
+
+
+
primary [34.27253219 17.55503397]
+sx [4.50040745 2.57068627 2.01534336 ... 0.33251557 0.29674627 0.15444462]
+sz [6.46667394 4.43233932 3.84850348 ... 1.04330666 0.76773288 0.54604945]
+J [[ 1.13463137e-01  1.49920887e-01  1.76789170e-01 ... -1.01809840e-09
+   1.13341751e-11  7.27489718e-13]
+ [ 2.09383016e-02  3.20412212e-02  4.74815387e-02 ... -1.02489023e-09
+   1.15994185e-11  7.25910166e-13]
+ [ 1.04188675e-02  1.61552555e-02  2.45575508e-02 ... -1.03167228e-09
+   1.18645190e-11  7.24296662e-13]
+ ...
+ [ 7.20880061e-05  1.13758034e-04  1.79138645e-04 ... -6.62044639e-09
+   1.91310127e-10  4.83737910e-13]
+ [ 3.95655826e-05  6.25753935e-05  9.87713313e-05 ... -6.33418159e-09
+   2.26727066e-10 -1.05451995e-12]
+ [ 1.60007270e-05  3.08385747e-05  5.05626410e-05 ... -1.28316523e-09
+   1.11041966e-10 -2.41585978e-12]]
+new primary [34.27253219 17.55503397]
+sx [4.50040745 2.57068627 2.01534336 ... 0.33251557 0.29674627 0.15444462]
+sz [6.46667394 4.43233932 3.84850348 ... 1.04330666 0.76773288 0.54604945]
+new J [[ 1.13463137e-01  1.49920887e-01  1.76789170e-01 ... -1.01809840e-09
+   1.13341751e-11  7.27489718e-13]
+ [ 2.09383016e-02  3.20412212e-02  4.74815387e-02 ... -1.02489023e-09
+   1.15994185e-11  7.25910166e-13]
+ [ 1.04188675e-02  1.61552555e-02  2.45575508e-02 ... -1.03167228e-09
+   1.18645190e-11  7.24296662e-13]
+ ...
+ [ 7.20880061e-05  1.13758034e-04  1.79138645e-04 ... -6.62044639e-09
+   1.91310127e-10  4.83737910e-13]
+ [ 3.95655826e-05  6.25753935e-05  9.87713313e-05 ... -6.33418159e-09
+   2.26727066e-10 -1.05451995e-12]
+ [ 1.60007270e-05  3.08385747e-05  5.05626410e-05 ... -1.28316523e-09
+   1.11041966e-10 -2.41585978e-12]]
+
+
+
+
+

Attaching statistical descriptors to the tempest datapoint

+
from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+# Set relative errors for the primary fields, and secondary fields.
+tdp.relative_error = np.r_[0.001, 0.001]
+
+# Set the additive errors for
+tdp.additive_error = np.hstack([[0.011474, 0.012810, 0.008507, 0.005154, 0.004742, 0.004477, 0.004168, 0.003539, 0.003352, 0.003213, 0.003161, 0.003122, 0.002587, 0.002038, 0.002201],
+                                [0.007383, 0.005693, 0.005178, 0.003659, 0.003426, 0.003046, 0.003095, 0.003247, 0.002775, 0.002627, 0.002460, 0.002178, 0.001754, 0.001405, 0.001283]])
+# Define a multivariate log normal distribution as the prior on the predicted data.
+tdp.predictedData.prior = Distribution('MvLogNormal', tdp.data[tdp.active], tdp.std[tdp.active]**2.0, prng=prng)
+
+
+

This allows us to evaluate the likelihood of the predicted data

+
print(tdp.likelihood(log=True))
+# Or the misfit
+print(tdp.data_misfit())
+
+
+
-35698.4834358605
+71558.40557872524
+
+
+

Plot the misfits for a range of half space conductivities

+
plt.figure()
+plt.subplot(1, 2, 1)
+_ = tdp.plotHalfSpaceResponses(-6.0, 4.0, 200)
+plt.title("Halfspace responses")
+
+
+Halfspace responses
Text(0.5, 1.0, 'Halfspace responses')
+
+
+

We can perform a quick search for the best fitting half space

+
halfspace = tdp.find_best_halfspace()
+print('Best half space conductivity is {} $S/m$'.format(halfspace.values))
+plt.subplot(1, 2, 2)
+_ = tdp.plot()
+_ = tdp.plot_predicted()
+
+plt.figure()
+tdp.plot_secondary_field()
+tdp.plot_predicted_secondary_field()
+
+# #%%
+# # We can attach priors to the height of the datapoint,
+# # the relative error multiplier, and the additive error noise floor
+
+# Define the distributions used as priors.
+relative_prior = Distribution('Uniform', min=np.r_[0.01, 0.01], max=np.r_[0.5, 0.5], prng=prng)
+receiver_x_prior = Distribution('Uniform', min=np.float64(tdp.receiver.x) - 1.0, max=np.float64(tdp.receiver.x) + 1.0, prng=prng)
+receiver_z_prior = Distribution('Uniform', min=np.float64(tdp.receiver.z) - 1.0, max=np.float64(tdp.receiver.z) + 1.0, prng=prng)
+receiver_pitch_prior = Distribution('Uniform', min=tdp.receiver.pitch - 5.0, max=tdp.receiver.pitch + 5.0, prng=prng)
+tdp.set_priors(relative_error_prior=relative_prior, receiver_x_prior=receiver_x_prior, receiver_z_prior=receiver_z_prior, receiver_pitch_prior=receiver_pitch_prior, prng=prng)
+
+
+
    +
  • Time Domain EM Data
  • +
  • plot tempest datapoint
  • +
+
Best half space conductivity is [0.01830738] $S/m$
+
+
+

In order to perturb our solvable parameters, we need to attach proposal distributions

+
relative_proposal = Distribution('MvNormal', mean=tdp.relative_error, variance=2.5e-4, prng=prng)
+receiver_x_proposal = Distribution('Normal', mean=tdp.receiver.x, variance = 0.01, prng=prng)
+receiver_z_proposal = Distribution('Normal', mean=tdp.receiver.z, variance = 0.01, prng=prng)
+receiver_pitch_proposal = Distribution('Normal', mean=tdp.receiver.pitch, variance = 0.01, prng=prng)
+tdp.set_proposals(relative_error_proposal=relative_proposal,
+                  receiver_x_proposal=receiver_x_proposal,
+                  receiver_z_proposal=receiver_z_proposal,
+                  receiver_pitch_proposal=receiver_pitch_proposal,
+                  solve_additive_error=True, additive_error_proposal_variance=1e-4, prng=prng)
+
+
+

With priors set we can auto generate the posteriors

+
tdp.set_posteriors()
+
+
+

Perturb the datapoint and record the perturbations +Note we are not using the priors to accept or reject perturbations.

+
for i in range(10):
+    tdp.perturb()
+    tdp.update_posteriors()
+
+plt.show()
+
+
+

Total running time of the script: (0 minutes 4.060 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Datapoints/sg_execution_times.html b/docs/examples/Datapoints/sg_execution_times.html new file mode 100644 index 00000000..c2bd427c --- /dev/null +++ b/docs/examples/Datapoints/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:15.801 total execution time for 3 files from examples/Datapoints:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Frequency domain datapoint (plot_resolve_datapoint.py)

00:08.395

0.0

Tempest Datapoint Class (plot_tempest_datapoint.py)

00:04.060

0.0

Skytem Datapoint Class (plot_skytem_datapoint.py)

00:03.346

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Distributions/README.html b/docs/examples/Distributions/README.html new file mode 100644 index 00000000..6dfd074a --- /dev/null +++ b/docs/examples/Distributions/README.html @@ -0,0 +1,115 @@ + + + + + + + Distributions — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Distributions

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Distributions/index.html b/docs/examples/Distributions/index.html new file mode 100644 index 00000000..bb43364c --- /dev/null +++ b/docs/examples/Distributions/index.html @@ -0,0 +1,149 @@ + + + + + + + Distributions — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Distributions

+
+

Distribution Class

+
Distribution Class
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Distributions/plot_distributions.html b/docs/examples/Distributions/plot_distributions.html new file mode 100644 index 00000000..0907b264 --- /dev/null +++ b/docs/examples/Distributions/plot_distributions.html @@ -0,0 +1,223 @@ + + + + + + + Distribution Class — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Distribution Class

+

Handles the initialization of different statistical distribution

+
from geobipy import Distribution
+from geobipy import plotting as cP
+import matplotlib.pyplot as plt
+import numpy as np
+
+from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+
+
+
+

Univariate Normal Distribution

+
D = Distribution('Normal', 0.0, 1.0, prng=prng)
+
+# Get the bins of the Distribution from +- 4 standard deviations of the mean
+bins = D.bins()
+
+# Grab random samples from the distribution
+D.rng(10)
+
+# We can then get the Probability Density Function for those bins
+pdf = D.probability(bins, log=False)
+
+# And we can plot that PDF
+plt.figure()
+plt.plot(bins, pdf)
+
+
+plot distributions
[<matplotlib.lines.Line2D object at 0x7fbf52a35c00>]
+
+
+
+
+

Multivariate Normal Distribution

+
D = Distribution('MvNormal',[0.0,1.0,2.0],[1.0,1.0,1.0], prng=prng)
+D.rng()
+
+
+
array([ 0.64050649,  1.77177243, -0.34500474])
+
+
+

Uniform Distribution

+
D = Distribution('Uniform', 0.0, 1.0, prng=prng)
+D.bins()
+
+
+
StatArray([0.        , 0.01010101, 0.02020202, 0.03030303, 0.04040404,
+           0.05050505, 0.06060606, 0.07070707, 0.08080808, 0.09090909,
+           0.1010101 , 0.11111111, 0.12121212, 0.13131313, 0.14141414,
+           0.15151515, 0.16161616, 0.17171717, 0.18181818, 0.19191919,
+           0.2020202 , 0.21212121, 0.22222222, 0.23232323, 0.24242424,
+           0.25252525, 0.26262626, 0.27272727, 0.28282828, 0.29292929,
+           0.3030303 , 0.31313131, 0.32323232, 0.33333333, 0.34343434,
+           0.35353535, 0.36363636, 0.37373737, 0.38383838, 0.39393939,
+           0.4040404 , 0.41414141, 0.42424242, 0.43434343, 0.44444444,
+           0.45454545, 0.46464646, 0.47474747, 0.48484848, 0.49494949,
+           0.50505051, 0.51515152, 0.52525253, 0.53535354, 0.54545455,
+           0.55555556, 0.56565657, 0.57575758, 0.58585859, 0.5959596 ,
+           0.60606061, 0.61616162, 0.62626263, 0.63636364, 0.64646465,
+           0.65656566, 0.66666667, 0.67676768, 0.68686869, 0.6969697 ,
+           0.70707071, 0.71717172, 0.72727273, 0.73737374, 0.74747475,
+           0.75757576, 0.76767677, 0.77777778, 0.78787879, 0.7979798 ,
+           0.80808081, 0.81818182, 0.82828283, 0.83838384, 0.84848485,
+           0.85858586, 0.86868687, 0.87878788, 0.88888889, 0.8989899 ,
+           0.90909091, 0.91919192, 0.92929293, 0.93939394, 0.94949495,
+           0.95959596, 0.96969697, 0.97979798, 0.98989899, 1.        ])
+
+
+

Total running time of the script: (0 minutes 4.664 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Distributions/sg_execution_times.html b/docs/examples/Distributions/sg_execution_times.html new file mode 100644 index 00000000..b27cef6e --- /dev/null +++ b/docs/examples/Distributions/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:04.664 total execution time for 1 file from examples/Distributions:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Distribution Class (plot_distributions.py)

00:04.664

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/HDF5/README.html b/docs/examples/HDF5/README.html new file mode 100644 index 00000000..e87ed250 --- /dev/null +++ b/docs/examples/HDF5/README.html @@ -0,0 +1,115 @@ + + + + + + + HDF 5 — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

HDF 5

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/HDF5/hdf5.html b/docs/examples/HDF5/hdf5.html new file mode 100644 index 00000000..04a2ac3c --- /dev/null +++ b/docs/examples/HDF5/hdf5.html @@ -0,0 +1,236 @@ + + + + + + + Using HDF5 within GeoBIPy — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Using HDF5 within GeoBIPy

+

Inference for large scale datasets in GeoBIPy is handled using MPI and distributed memory systems. +A common bottleneck with large parallel algorithms is the input output of information to disk. +We use HDF5 to read and write data in order to leverage the parallel capabililties of the HDF5 API.

+

Each object within GeoBIPy has a create_hdf, write_hdf, and read_hdf routine.

+
import numpy as np
+import h5py
+from geobipy import StatArray
+
+
+

StatArray

+
# Instantiate a StatArray
+x = StatArray(np.arange(10.0), name = 'an Array', units = 'some units')
+
+# Write the StatArray to a HDF file.
+with h5py.File("x.h5", 'w') as f:
+    x.toHdf(f, "x")
+
+# Read the StatArray back in.
+with h5py.File("x.h5", 'r') as f:
+    y = StatArray.fromHdf(f, 'x')
+
+print('x', x)
+print('y', y)
+
+
+

There are actually steps within the “toHdf” function. +First, space is created within the HDF file and second, the data is written to that space +These functions are split because during the execution of a parallel enabled program, +all the space within the HDF file needs to be allocated before we can write to the file +using multiple cores.

+
# Write the StatArray to a HDF file.
+with h5py.File("x.h5", 'w') as f:
+    x.createHdf(f, "x")
+    x.writeHdf(f, "x")
+
+# Read the StatArray back in.
+with h5py.File("x.h5", 'r') as f:
+    y = StatArray.fromHdf(f, 'x')
+
+print('x', x)
+print('y', y)
+
+
+

The create and write HDF methods also allow extra space to be allocated so that +the extra memory can be written later, perhaps by multiple cores. +Here we specify space for 2 arrays, the memory is stored contiguously as a numpy array. +We then write to only the first index.

+
# Write the StatArray to a HDF file.
+with h5py.File("x.h5", 'w') as f:
+    x.createHdf(f, "x", nRepeats=2)
+    x.writeHdf(f, "x", index=0)
+
+# Read the StatArray back in.
+with h5py.File("x.h5", 'r') as f:
+    y = StatArray.fromHdf(f, 'x', index=0)
+
+print('x', x)
+print('y', y)
+
+
+

The duplication can also be a shape.

+
# Write the StatArray to a HDF file.
+with h5py.File("x.h5", 'w') as f:
+    x.createHdf(f, "x", nRepeats=(2, 2))
+    x.writeHdf(f, "x", index=(0, 0))
+
+# Read the StatArray back in.
+with h5py.File("x.h5", 'r') as f:
+    y = StatArray.fromHdf(f, 'x', index=(0, 0))
+
+print('x', x)
+print('y', y)
+
+
+

Similarly, we can duplicate a 2D array with an extra 2D duplication

+
x = StatArray(np.random.randn(2, 2), name = 'an Array', units = 'some units')
+# Write the StatArray to a HDF file.
+with h5py.File("x.h5", 'w') as f:
+    x.createHdf(f, "x", nRepeats=(2, 2))
+    x.writeHdf(f, "x", index=(0, 0))
+
+# Read the StatArray back in.
+with h5py.File("x.h5", 'r') as f:
+    y = StatArray.fromHdf(f, 'x', index=(0, 0))
+
+print('x', x)
+print('y', y)
+
+
+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/HDF5/index.html b/docs/examples/HDF5/index.html new file mode 100644 index 00000000..0497bd3b --- /dev/null +++ b/docs/examples/HDF5/index.html @@ -0,0 +1,147 @@ + + + + + + + HDF 5 — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

HDF 5

+
+

Using HDF5 within GeoBIPy

+
Using HDF5 within GeoBIPy
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/HDF5/sg_execution_times.html b/docs/examples/HDF5/sg_execution_times.html new file mode 100644 index 00000000..41d8fe22 --- /dev/null +++ b/docs/examples/HDF5/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 1 file from examples/HDF5:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Using HDF5 within GeoBIPy (hdf5.py)

00:00.000

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference/1D/readme.html b/docs/examples/Inference/1D/readme.html new file mode 100644 index 00000000..bc68aba1 --- /dev/null +++ b/docs/examples/Inference/1D/readme.html @@ -0,0 +1,121 @@ + + + + + + + 1D Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

1D Inference

+

There are a couple of ways to run an inference using geobipy, the first is via command line using

+
geobipy skytem_options.py <output folder>
+
+
+

The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples)

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference/README.html b/docs/examples/Inference/README.html new file mode 100644 index 00000000..ca42073c --- /dev/null +++ b/docs/examples/Inference/README.html @@ -0,0 +1,115 @@ + + + + + + + Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference/index.html b/docs/examples/Inference/index.html new file mode 100644 index 00000000..a603bcf8 --- /dev/null +++ b/docs/examples/Inference/index.html @@ -0,0 +1,141 @@ + + + + + + + Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference/sg_execution_times.html b/docs/examples/Inference/sg_execution_times.html new file mode 100644 index 00000000..934789ca --- /dev/null +++ b/docs/examples/Inference/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from examples/Inference:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_1D/plot_inference_1d_resolve.html b/docs/examples/Inference_1D/plot_inference_1d_resolve.html new file mode 100644 index 00000000..d07603c8 --- /dev/null +++ b/docs/examples/Inference_1D/plot_inference_1d_resolve.html @@ -0,0 +1,254 @@ + + + + + + + Running GeoBIPy to invert Resolve data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Resolve data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+data_type = "Resolve"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+supplementary = "..//..//supplementary//"
+
+parameter_file = supplementary + "//options_files//{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv'
+kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename']
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=30, **kwargs)
+
+
+
    +
  • plot inference 1d resolve
  • +
  • Fiducial [30], Frequency Domain EM Data
  • +
+
Using user input file ..//..//supplementary////options_files//Resolve_options
+Output files will be produced at Resolve/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary////data//Resolve_glacial.csv and system files ..//..//supplementary////data//..//data/FdemSystem2.stm
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:06.650509 h:m:s
+i=5000, k=2, acc=*42.520, 0.007 s/Model, 37.213 s Elapsed, eta=--:--:-- h:m:s
+
+Remaining Points -30/1 || Elapsed Time: 0:00:39.027413 h:m:s || ETA 0:00:01.258949 h:m:s
+
+
+

Total running time of the script: (0 minutes 50.537 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_1D/plot_inference_1d_skytem.html b/docs/examples/Inference_1D/plot_inference_1d_skytem.html new file mode 100644 index 00000000..ff19446a --- /dev/null +++ b/docs/examples/Inference_1D/plot_inference_1d_skytem.html @@ -0,0 +1,250 @@ + + + + + + + Running GeoBIPy to invert Skytem data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Skytem data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+data_type = "Skytem_512"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+supplementary = "..//..//supplementary//"
+parameter_file = supplementary + "//options_files//{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv'
+kwargs['system_filename'] = [supplementary + "//data//" + x for x in kwargs['system_filename']]
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=2, **kwargs)
+
+
+
Using user input file ..//..//supplementary////options_files//Skytem_512_options
+Output files will be produced at Skytem_512/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary////data//Skytem_512_glacial.csv and system files ['..//..//supplementary////data//..//data//SkytemHM_512.stm', '..//..//supplementary////data//..//data//SkytemLM_512.stm']
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:00.171754 h:m:s
+i=5000, k=6, acc=*17.440, 0.012 s/Model, 60.254 s Elapsed, eta=--:--:-- h:m:s
+
+Remaining Points -2/1 || Elapsed Time: 0:01:00.423246 h:m:s || ETA 0:00:20.141082 h:m:s
+
+
+

Total running time of the script: (1 minutes 6.343 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_1D/plot_inference_1d_tempest.html b/docs/examples/Inference_1D/plot_inference_1d_tempest.html new file mode 100644 index 00000000..169e3c33 --- /dev/null +++ b/docs/examples/Inference_1D/plot_inference_1d_tempest.html @@ -0,0 +1,255 @@ + + + + + + + Running GeoBIPy to invert Tempest data — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Running GeoBIPy to invert Tempest data

+
import os
+import sys
+import pathlib
+from datetime import timedelta
+import time
+import numpy as np
+from geobipy import Inference3D
+from geobipy import user_parameters
+from geobipy import get_prng
+
+def checkCommandArguments():
+    """Check the users command line arguments. """
+    import argparse
+    # warnings.filterwarnings('error')
+
+    Parser = argparse.ArgumentParser(description="GeoBIPy",
+                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    Parser.add_argument('--index', default=0, type=int, help='job array index 0-18')
+    Parser.add_argument('--data', default=None, help="Data type. Choose from ['skytem_512', 'tempest', 'resolve']")
+    Parser.add_argument('--model', default=None, help="Model type. Choose from ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']")
+
+    return Parser.parse_args()
+
+
+
np.random.seed(0)
+
+args = checkCommandArguments()
+sys.path.append(os.getcwd())
+
+models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+data_type = "Tempest"
+model_type = models[args.index]
+
+
+

The directory where HDF files will be stored +%%

+
file_path = os.path.join(data_type, model_type)
+pathlib.Path(file_path).mkdir(parents=True, exist_ok=True)
+
+for filename in os.listdir(file_path):
+    try:
+        if os.path.isfile(file_path) or os.path.islink(file_path):
+            os.unlink(file_path)
+    except Exception as e:
+        print('Failed to delete %s. Reason: %s' % (file_path, e))
+
+output_directory = file_path
+
+data_filename = data_type + '_' + model_type
+
+supplementary = "..//..//supplementary//"
+
+parameter_file = supplementary + "//options_files//{}_options".format(data_type)
+inputFile = pathlib.Path(parameter_file)
+assert inputFile.exists(), Exception("Cannot find input file {}".format(inputFile))
+
+output_directory = pathlib.Path(output_directory)
+assert output_directory.exists(), Exception("Make sure the output directory exists {}".format(output_directory))
+
+print('Using user input file {}'.format(parameter_file))
+print('Output files will be produced at {}'.format(output_directory))
+
+kwargs = user_parameters.read(inputFile)
+
+kwargs['n_markov_chains'] = 5000
+
+kwargs['data_filename'] = supplementary + '//data//' + data_filename + '.csv'
+kwargs['system_filename'] = supplementary + "//data//" + kwargs['system_filename']
+
+# Everyone needs the system classes read in early.
+data = kwargs['data_type']._initialize_sequential_reading(kwargs['data_filename'], kwargs['system_filename'])
+
+# Start keeping track of time.
+t0 = time.time()
+
+seed = 146100583096709124601953385843316024947
+prng = get_prng(seed=seed)
+
+inference3d = Inference3D(data, prng=prng)
+inference3d.create_hdf5(directory=output_directory, **kwargs)
+
+print("Created hdf5 files in {} h:m:s".format(str(timedelta(seconds=time.time()-t0))))
+
+inference3d.infer(index=2, **kwargs)
+
+
+
    +
  • plot inference 1d tempest
  • +
  • Fiducial [2.], Time Domain EM Data
  • +
+
Using user input file ..//..//supplementary////options_files//Tempest_options
+Output files will be produced at Tempest/glacial
+Creating HDF5 files, this may take a few minutes...
+Files are being created for data files ..//..//supplementary////data//Tempest_glacial.csv and system files ..//..//supplementary////data//..//data/Tempest.stm
+Created hdf5 file for line 0.0 with 79 data points
+Created hdf5 files 79 total data points
+Created hdf5 files in 0:00:00.360661 h:m:s
+i=5000, k=7, acc=*27.680, 0.015 s/Model, 76.969 s Elapsed, eta=--:--:-- h:m:s
+
+Remaining Points -2/1 || Elapsed Time: 0:01:18.267442 h:m:s || ETA 0:00:26.089147 h:m:s
+
+
+

Total running time of the script: (1 minutes 22.225 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_1D/readme.html b/docs/examples/Inference_1D/readme.html new file mode 100644 index 00000000..87c739fb --- /dev/null +++ b/docs/examples/Inference_1D/readme.html @@ -0,0 +1,121 @@ + + + + + + + 1D Inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

1D Inference

+

There are a couple of ways to run an inference using geobipy, the first is via command line using

+
geobipy skytem_options.py <output folder>
+
+
+

The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples)

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_1D/sg_execution_times.html b/docs/examples/Inference_1D/sg_execution_times.html new file mode 100644 index 00000000..9a7f4240 --- /dev/null +++ b/docs/examples/Inference_1D/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

02:28.568 total execution time for 3 files from examples/Inference_1D:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Running GeoBIPy to invert Tempest data (plot_inference_1d_tempest.py)

01:22.225

0.0

Running GeoBIPy to invert Skytem data (plot_inference_1d_skytem.py)

01:06.343

0.0

Running GeoBIPy to invert Resolve data (plot_inference_1d_resolve.py)

00:00.000

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/index.html b/docs/examples/Inference_2D/index.html new file mode 100644 index 00000000..72389896 --- /dev/null +++ b/docs/examples/Inference_2D/index.html @@ -0,0 +1,120 @@ + + + + + + + Inference 2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference 2D

+
+

sphx_glr_examples_2D_Inference_inference_2d_plotting.py

+
2D Posterior analysis of the Bayesian inference
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/plot_inference_2d_resolve.html b/docs/examples/Inference_2D/plot_inference_2d_resolve.html new file mode 100644 index 00000000..bd4f88d5 --- /dev/null +++ b/docs/examples/Inference_2D/plot_inference_2d_resolve.html @@ -0,0 +1,334 @@ + + + + + + + 2D Posterior analysis of Resolve inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Posterior analysis of Resolve inference

+

All plotting in GeoBIPy can be carried out using the 3D inference class

+
    +
  • resolve glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • resolve saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • resolve resistive_dolomites, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • resolve resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • resolve coastal_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • resolve ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
+
/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+
+
+
+

+
+
import matplotlib.pyplot as plt
+import numpy as np
+from geobipy import Model
+from geobipy import Inference2D
+
+def plot_2d_summary(folder, data_type, model_type):
+   #%%
+   # Inference for a line of inferences
+   # ++++++++++++++++++++++++++++++++++
+   #
+   # We can instantiate the inference handler by providing a path to the directory containing
+   # HDF5 files generated by GeoBIPy.
+   #
+   # The InfereceXD classes are low memory.  They only read information from the HDF5 files
+   # as and when it is needed.
+   #
+   # The first time you use these classes to create plots, expect longer initial processing times.
+   # I precompute expensive properties and store them in the HDF5 files for later use.
+
+   from numpy.random import Generator
+   from numpy.random import PCG64DXSM
+   generator = PCG64DXSM(seed=0)
+   prng = Generator(generator)
+
+   #%%
+   results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng)
+
+   kwargs = {
+         "log" : 10,
+         "cmap" : 'jet'
+         }
+
+   fig = plt.figure(figsize=(16, 8))
+   plt.suptitle("{} {}".format(data_type, model_type))
+   gs0 = fig.add_gridspec(6, 2, hspace=1.0)
+
+   true_model = Model.create_synthetic_model(model_type)
+   true_model.mesh.y_edges = true_model.mesh.y_edges / 4.1
+
+   kwargs['vmin'] = np.log10(np.min(true_model.values))
+   kwargs['vmax'] = np.log10(np.max(true_model.values))
+
+   ax = fig.add_subplot(gs0[0, 0])
+   true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+
+   plt.ylim([-160, 60])
+
+   ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # By adding the useVariance keyword, we can make regions of lower confidence more transparent
+   ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # # # # # We can also choose to keep parameters above the DOI opaque.
+   # # # # results_2d.compute_doi()
+   # # # # plt.subplot(313)
+   # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs);
+   # # # # results_2d.plot_data_elevation(linewidth=0.3);
+   # # # # results_2d.plot_elevation(linewidth=0.3);
+
+   ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax)
+   results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+   ax1.set_title('Best model')
+
+   del kwargs['vmin']
+   del kwargs['vmax']
+
+   ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%')
+   results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%')
+   results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%')
+   results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   #%%
+   # We can plot the parameter values that produced the highest posterior
+   ax1 = fig.add_subplot(gs0[2, 0], sharex=ax)
+   results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True)
+
+   ax1 = fig.add_subplot(gs0[1, 0], sharex=ax)
+
+   ll, bb, ww, hh = ax1.get_position().bounds
+   ax1.set_position([ll, bb, ww*0.8, hh])
+
+   results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True)
+   results_2d.plot_burned_in(ax=ax1, underlay=True)
+
+   #%%
+   # Now we can start plotting some more interesting posterior properties.
+   # How about the confidence?
+   ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax)
+   results_2d.plot_confidence(ax=ax1);
+   results_2d.plot_data_elevation(ax=ax1, linewidth=0.3);
+   results_2d.plot_elevation(ax=ax1, linewidth=0.3);
+
+   #%%
+   # We can take the interface depth posterior for each data point,
+   # and display an interface probability cross section
+   # This posterior can be washed out, so the clim_scaling keyword lets me saturate
+   # the top and bottom 0.5% of the colour range
+   ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax)
+   ax1.set_title('P(Interface)')
+   results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax)
+   results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+
+   plt.show()
+   # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300)
+
+if __name__ == '__main__':
+   models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+   for model in models:
+      try:
+         plot_2d_summary("../../../Parallel_Inference/", "resolve", model)
+      except Exception as e:
+         print(model)
+         print(e)
+         pass
+
+
+

Total running time of the script: (0 minutes 24.877 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/plot_inference_2d_skytem.html b/docs/examples/Inference_2D/plot_inference_2d_skytem.html new file mode 100644 index 00000000..719ebaf3 --- /dev/null +++ b/docs/examples/Inference_2D/plot_inference_2d_skytem.html @@ -0,0 +1,330 @@ + + + + + + + 2D Posterior analysis of Skytem inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Posterior analysis of Skytem inference

+

All plotting in GeoBIPy can be carried out using the 3D inference class

+
    +
  • skytem_512 glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • skytem_512 saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • skytem_512 resistive_dolomites
  • +
  • skytem_512 resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • skytem_512 coastal_salt_water
  • +
  • skytem_512 ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
+
/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+resistive_dolomites
+x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+coastal_salt_water
+x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+
+
+
+

+
+
import argparse
+import matplotlib.pyplot as plt
+import numpy as np
+from geobipy import Model
+from geobipy import Inference2D
+
+def plot_2d_summary(folder, data_type, model_type):
+   #%%
+   # Inference for a line of inferences
+   # ++++++++++++++++++++++++++++++++++
+   #
+   # We can instantiate the inference handler by providing a path to the directory containing
+   # HDF5 files generated by GeoBIPy.
+   #
+   # The InfereceXD classes are low memory.  They only read information from the HDF5 files
+   # as and when it is needed.
+   #
+   # The first time you use these classes to create plots, expect longer initial processing times.
+   # I precompute expensive properties and store them in the HDF5 files for later use.
+
+   from numpy.random import Generator
+   from numpy.random import PCG64DXSM
+   generator = PCG64DXSM(seed=0)
+   prng = Generator(generator)
+
+   #%%
+   results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng)
+
+   kwargs = {
+         "log" : 10,
+         "cmap" : 'jet'
+         }
+
+   fig = plt.figure(figsize=(16, 8))
+   plt.suptitle("{} {}".format(data_type, model_type))
+   gs0 = fig.add_gridspec(6, 2, hspace=1.0)
+
+   true_model = Model.create_synthetic_model(model_type)
+
+   kwargs['vmin'] = np.log10(np.min(true_model.values))
+   kwargs['vmax'] = np.log10(np.max(true_model.values))
+
+   ax = fig.add_subplot(gs0[0, 0])
+   true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+
+   plt.ylim([-550, 60])
+
+   ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # By adding the useVariance keyword, we can make regions of lower confidence more transparent
+   ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # # # # # We can also choose to keep parameters above the DOI opaque.
+   # # # # results_2d.compute_doi()
+   # # # # plt.subplot(313)
+   # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs);
+   # # # # results_2d.plot_data_elevation(linewidth=0.3);
+   # # # # results_2d.plot_elevation(linewidth=0.3);
+
+   ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax)
+   results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+   ax1.set_title('Best model')
+
+   del kwargs['vmin']
+   del kwargs['vmax']
+
+   ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%')
+   results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%')
+   results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%')
+   results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   #%%
+   # We can plot the parameter values that produced the highest posterior
+   ax1 = fig.add_subplot(gs0[2, 0], sharex=ax)
+   results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True)
+
+   ax1 = fig.add_subplot(gs0[1, 0], sharex=ax)
+
+   ll, bb, ww, hh = ax1.get_position().bounds
+   ax1.set_position([ll, bb, ww*0.8, hh])
+
+   results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True)
+   results_2d.plot_burned_in(ax=ax1, underlay=True)
+
+   #%%
+   # Now we can start plotting some more interesting posterior properties.
+   # How about the confidence?
+   ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax)
+   results_2d.plot_confidence(ax=ax1);
+   results_2d.plot_data_elevation(ax=ax1, linewidth=0.3);
+   results_2d.plot_elevation(ax=ax1, linewidth=0.3);
+
+   #%%
+   # We can take the interface depth posterior for each data point,
+   # and display an interface probability cross section
+   # This posterior can be washed out, so the clim_scaling keyword lets me saturate
+   # the top and bottom 0.5% of the colour range
+   ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax)
+   ax1.set_title('P(Interface)')
+   results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax)
+   results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   plt.show()
+   # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300)
+
+
+if __name__ == '__main__':
+   types = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+   for model in types:
+      try:
+         plot_2d_summary('../../../Parallel_Inference/', "skytem_512", model)
+      except Exception as e:
+         print(model)
+         print(e)
+         pass
+
+
+

Total running time of the script: (0 minutes 10.130 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/plot_inference_2d_tempest.html b/docs/examples/Inference_2D/plot_inference_2d_tempest.html new file mode 100644 index 00000000..ec30d88d --- /dev/null +++ b/docs/examples/Inference_2D/plot_inference_2d_tempest.html @@ -0,0 +1,334 @@ + + + + + + + 2D Posterior analysis of Tempest inference — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Posterior analysis of Tempest inference

+

All plotting in GeoBIPy can be carried out using the 3D inference class

+
    +
  • tempest glacial, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • tempest saline_clay, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • tempest resistive_dolomites, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • tempest resistive_basement, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
  • tempest coastal_salt_water
  • +
  • tempest ice_over_salt_water, Best model, 5%, 50%, 95%, P(# of Layers), P(Interface)
  • +
+
/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+coastal_salt_water
+x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:2039: RuntimeWarning: invalid value encountered in double_scalars
+  self._mtx[1, 2] += ty
+/Users/nfoks/miniconda3/lib/python3.10/site-packages/matplotlib/transforms.py:372: RuntimeWarning: invalid value encountered in double_scalars
+  return (x0, y0, x1 - x0, y1 - y0)
+
+
+
+

+
+
import argparse
+import matplotlib.pyplot as plt
+import numpy as np
+from geobipy import Model
+from geobipy import Inference2D
+
+def plot_2d_summary(folder, data_type, model_type):
+   #%%
+   # Inference for a line of inferences
+   # ++++++++++++++++++++++++++++++++++
+   #
+   # We can instantiate the inference handler by providing a path to the directory containing
+   # HDF5 files generated by GeoBIPy.
+   #
+   # The InfereceXD classes are low memory.  They only read information from the HDF5 files
+   # as and when it is needed.
+   #
+   # The first time you use these classes to create plots, expect longer initial processing times.
+   # I precompute expensive properties and store them in the HDF5 files for later use.
+
+   from numpy.random import Generator
+   from numpy.random import PCG64DXSM
+   generator = PCG64DXSM(seed=0)
+   prng = Generator(generator)
+
+   #%%
+   results_2d = Inference2D.fromHdf('{}/{}/{}/0.0.h5'.format(folder, data_type, model_type), prng=prng)
+
+   kwargs = {
+         "log" : 10,
+         "cmap" : 'jet'
+         }
+
+   fig = plt.figure(figsize=(16, 8))
+   plt.suptitle("{} {}".format(data_type, model_type))
+   gs0 = fig.add_gridspec(6, 2, hspace=1.0)
+
+   true_model = Model.create_synthetic_model(model_type)
+
+   kwargs['vmin'] = np.log10(np.min(true_model.values))
+   kwargs['vmax'] = np.log10(np.max(true_model.values))
+
+   ax = fig.add_subplot(gs0[0, 0])
+   true_model.pcolor(flipY=True, ax=ax, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax, xlabel=False, ylabel=False);
+
+   plt.ylim([-550, 60])
+
+   ax1 = fig.add_subplot(gs0[0, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mean_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # By adding the useVariance keyword, we can make regions of lower confidence more transparent
+   ax1 = fig.add_subplot(gs0[1, 1], sharex=ax, sharey=ax)
+   results_2d.plot_mode_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   # # # # # We can also choose to keep parameters above the DOI opaque.
+   # # # # results_2d.compute_doi()
+   # # # # plt.subplot(313)
+   # # # # results_2d.plot_mean_model(use_variance=True, mask_below_doi=True, **kwargs);
+   # # # # results_2d.plot_data_elevation(linewidth=0.3);
+   # # # # results_2d.plot_elevation(linewidth=0.3);
+
+   ax1 = fig.add_subplot(gs0[2, 1], sharex=ax, sharey=ax)
+   results_2d.plot_best_model(ax=ax1, wrap_clabel=True, **kwargs);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+   ax1.set_title('Best model')
+
+   del kwargs['vmin']
+   del kwargs['vmax']
+
+   ax1 = fig.add_subplot(gs0[3, 1], sharex=ax, sharey=ax); ax1.set_title('5%')
+   results_2d.plot_percentile(ax=ax1, percent=0.05, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[4, 1], sharex=ax, sharey=ax); ax1.set_title('50%')
+   results_2d.plot_percentile(ax=ax1, percent=0.5, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 1], sharex=ax, sharey=ax); ax1.set_title('95%')
+   results_2d.plot_percentile(ax=ax1, percent=0.95, wrap_clabel=True, **kwargs)
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   #%%
+   # We can plot the parameter values that produced the highest posterior
+   ax1 = fig.add_subplot(gs0[2, 0], sharex=ax)
+   results_2d.plot_k_layers(ax=ax1, wrap_ylabel=True)
+
+   ax1 = fig.add_subplot(gs0[1, 0], sharex=ax)
+
+   ll, bb, ww, hh = ax1.get_position().bounds
+   ax1.set_position([ll, bb, ww*0.8, hh])
+
+   results_2d.plot_channel_saturation(ax=ax1, wrap_ylabel=True)
+   results_2d.plot_burned_in(ax=ax1, underlay=True)
+
+   #%%
+   # Now we can start plotting some more interesting posterior properties.
+   # How about the confidence?
+   ax1 = fig.add_subplot(gs0[3, 0], sharex=ax, sharey=ax)
+   results_2d.plot_confidence(ax=ax1);
+   results_2d.plot_data_elevation(ax=ax1, linewidth=0.3);
+   results_2d.plot_elevation(ax=ax1, linewidth=0.3);
+
+   #%%
+   # We can take the interface depth posterior for each data point,
+   # and display an interface probability cross section
+   # This posterior can be washed out, so the clim_scaling keyword lets me saturate
+   # the top and bottom 0.5% of the colour range
+   ax1 = fig.add_subplot(gs0[4, 0], sharex=ax, sharey=ax)
+   ax1.set_title('P(Interface)')
+   results_2d.plot_interfaces(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   ax1 = fig.add_subplot(gs0[5, 0], sharex=ax, sharey=ax)
+   results_2d.plot_entropy(cmap='Greys', clim_scaling=0.5, ax=ax1);
+   results_2d.plot_data_elevation(linewidth=0.3, ax=ax1);
+   results_2d.plot_elevation(linewidth=0.3, ax=ax1);
+
+   plt.show()
+   # plt.savefig('{}_{}.png'.format(data_type, model_type), dpi=300)
+
+
+if __name__ == '__main__':
+   models = ['glacial', 'saline_clay', 'resistive_dolomites', 'resistive_basement', 'coastal_salt_water', 'ice_over_salt_water']
+
+   # import warnings
+   # warnings.filterwarnings('error')
+   for model in models:
+      try:
+         plot_2d_summary('../../../Parallel_Inference/', "tempest", model)
+      except Exception as e:
+         print(model)
+         print(e)
+         pass
+
+
+

Total running time of the script: (0 minutes 12.999 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/readme.html b/docs/examples/Inference_2D/readme.html new file mode 100644 index 00000000..e149cd57 --- /dev/null +++ b/docs/examples/Inference_2D/readme.html @@ -0,0 +1,115 @@ + + + + + + + Inference 2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Inference 2D

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Inference_2D/sg_execution_times.html b/docs/examples/Inference_2D/sg_execution_times.html new file mode 100644 index 00000000..658197e4 --- /dev/null +++ b/docs/examples/Inference_2D/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:48.006 total execution time for 3 files from examples/Inference_2D:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

2D Posterior analysis of Resolve inference (plot_inference_2d_resolve.py)

00:24.877

0.0

2D Posterior analysis of Tempest inference (plot_inference_2d_tempest.py)

00:12.999

0.0

2D Posterior analysis of Skytem inference (plot_inference_2d_skytem.py)

00:10.130

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/README.html b/docs/examples/Meshes/README.html new file mode 100644 index 00000000..8a4c54b7 --- /dev/null +++ b/docs/examples/Meshes/README.html @@ -0,0 +1,115 @@ + + + + + + + Meshes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Meshes

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/index.html b/docs/examples/Meshes/index.html new file mode 100644 index 00000000..2c93cfaf --- /dev/null +++ b/docs/examples/Meshes/index.html @@ -0,0 +1,145 @@ + + + + + + + Meshes — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Meshes

+
+

1D Rectilinear Mesh

+
1D Rectilinear Mesh
+
+

2D Rectilinear Mesh

+
2D Rectilinear Mesh
+
+

3D Rectilinear Mesh

+
3D Rectilinear Mesh
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/plot_rectilinear_mesh_1d.html b/docs/examples/Meshes/plot_rectilinear_mesh_1d.html new file mode 100644 index 00000000..ad2710e7 --- /dev/null +++ b/docs/examples/Meshes/plot_rectilinear_mesh_1d.html @@ -0,0 +1,475 @@ + + + + + + + 1D Rectilinear Mesh — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

1D Rectilinear Mesh

+
from copy import deepcopy
+from geobipy import StatArray
+from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh2D_stitched
+import matplotlib.gridspec as gridspec
+import matplotlib.pyplot as plt
+import numpy as np
+import h5py
+
+
+
+

The basics

+

Instantiate a new 1D rectilinear mesh by specifying cell centres, edges, or widths.

+
x = StatArray(np.cumsum(np.arange(0.0, 10.0)), 'Depth', 'm')
+
+
+

Cell edges

+
rm = RectilinearMesh1D(edges=x, centres=None, widths=None)
+
+
+

We can plot the grid of the mesh +Or Pcolor the mesh showing. An array of cell values is used as the colour.

+
arr = StatArray(np.random.randn(*rm.shape), "Name", "Units")
+p=0; plt.figure(p)
+plt.subplot(121)
+_ = rm.plotGrid(transpose=True, flip=True)
+plt.subplot(122)
+_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)
+
+# Mask the mesh cells by a distance
+rm_masked, indices, arr2 = rm.mask_cells(2.0, values=arr)
+p+=1; plt.figure(p)
+_ = rm_masked.pcolor(StatArray(arr2), grid=True, transpose=True, flip=True)
+
+# Writing and reading to/from HDF5
+# ++++++++++++++++++++++++++++++++
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.toHdf(f, 'rm1d')
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(122)
+_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.createHdf(f, 'rm1d', add_axis=10)
+    for i in range(10):
+        rm.writeHdf(f, 'rm1d', index=i)
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)
+with h5py.File('rm1d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(131)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(132)
+_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)
+plt.subplot(133)
+_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True)
+
+
+
    +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
+
+
+

Log-space rectilinear mesh

+

Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +Here we use edges

+
x = StatArray(np.logspace(-3, 3, 10), 'Depth', 'm')
+
+
+
rm = RectilinearMesh1D(edges=x, log=10)
+
+# We can plot the grid of the mesh
+# Or Pcolor the mesh showing. An array of cell values is used as the colour.
+p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.plotGrid(transpose=True, flip=True)
+plt.subplot(122)
+arr = StatArray(np.random.randn(rm.nCells), "Name", "Units")
+_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)
+
+# Writing and reading to/from HDF5
+# ++++++++++++++++++++++++++++++++
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.toHdf(f, 'rm1d')
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(122)
+_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.createHdf(f, 'rm1d', add_axis=10)
+    for i in range(10):
+        rm.writeHdf(f, 'rm1d', index=i)
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)
+with h5py.File('rm1d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(131)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(132)
+_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)
+plt.subplot(133)
+_ = rm2.pcolor(np.repeat(arr[None, :], 10, 0), grid=True, flipY=True)
+
+
+
    +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
+
+
+

RelativeTo

+

Instantiate a new 1D rectilinear mesh by specifying cell centres or edges. +Here we use edges

+
x = StatArray(np.arange(11.0), 'Deviation', 'm')
+
+
+
rm = RectilinearMesh1D(edges=x, relativeTo=5.0)
+
+
+

We can plot the grid of the mesh +Or Pcolor the mesh showing. An array of cell values is used as the colour.

+
p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.plotGrid(transpose=True, flip=True)
+plt.subplot(122)
+arr = StatArray(np.random.randn(rm.nCells), "Name", "Units")
+_ = rm.pcolor(arr, grid=True, transpose=True, flip=True)
+
+# Writing and reading to/from HDF5
+# ++++++++++++++++++++++++++++++++
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.createHdf(f, 'rm1d')
+    rm.writeHdf(f, 'rm1d')
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(122)
+_ = rm1.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.createHdf(f, 'rm1d', add_axis=3)
+    for i in range(3):
+        rm.relativeTo += 0.5
+        rm.writeHdf(f, 'rm1d', index=i)
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'], index=0)
+with h5py.File('rm1d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(131)
+_ = rm.pcolor(StatArray(arr), grid=True, transpose=True, flip=True)
+plt.subplot(132)
+_ = rm1.pcolor(arr, grid=True, transpose=True, flip=True)
+plt.subplot(133)
+_ = rm2.pcolor(np.repeat(arr[None, :], 3, 0), grid=True, flipY=True)
+
+
+# Making a mesh perturbable
+# +++++++++++++++++++++++++
+n_cells = 2
+widths = StatArray(np.full(n_cells, fill_value=10.0), 'test')
+rm = RectilinearMesh1D(widths=widths, relativeTo=0.0)
+
+
+
    +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
+
+
+

Randomness and Model Perturbations

+

We can set the priors on the 1D model by assigning minimum and maximum layer +depths and a maximum number of layers. These are used to create priors on +the number of cells in the model, a new depth interface, new parameter values +and the vertical gradient of those parameters. +The halfSpaceValue is used as a reference value for the parameter prior.

+
from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+# Set the priors
+rm.set_priors(min_edge = 1.0,
+              max_edge = 150.0,
+              max_cells = 30,
+              prng = prng)
+
+
+

We can evaluate the prior of the model using depths only

+
print('Log probability of the Mesh given its priors: ', rm.probability)
+
+
+
Log probability of the Mesh given its priors:  -13.338200594791775
+
+
+

To propose new meshes, we specify the probabilities of creating, removing, perturbing, and not changing +an edge interface +Here we force the creation of a layer.

+
rm.set_proposals(probabilities = [0.25, 0.25, 0.25, 0.25], prng=prng)
+rm.set_posteriors()
+
+rm0 = deepcopy(rm)
+
+
+

We can then perturb the layers of the model

+
for i in range(1000):
+    rm = rm.perturb()
+    rm.update_posteriors()
+
+
+
p+=1; fig = plt.figure(p)
+ax = rm._init_posterior_plots(fig)
+
+rm.plot_posteriors(axes=ax)
+
+with h5py.File('rm1d.h5', 'w') as f:
+    rm.createHdf(f, 'rm1d', withPosterior = True)
+    rm.writeHdf(f, 'rm1d', withPosterior = True)
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm1 = RectilinearMesh1D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(121)
+_ = rm.pcolor(StatArray(rm.shape), grid=True, transpose=True, flip=True)
+plt.subplot(122)
+_ = rm1.pcolor(StatArray(rm1.shape), grid=True, transpose=True, flip=True)
+
+p+=1; fig = plt.figure(p)
+ax = rm1._init_posterior_plots(fig)
+rm1.plot_posteriors(axes=ax)
+
+
+
    +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
+
[<Axes: xlabel='# of Layers', ylabel='Density'>, <Axes: xlabel='test', ylabel='Density'>]
+
+
+

Expanded

+
with h5py.File('rm1d.h5', 'w') as f:
+    tmp = rm.pad(rm.max_cells)
+    tmp.createHdf(f, 'rm1d', withPosterior=True, add_axis=StatArray(np.arange(3.0), name='Easting', units="m"))
+
+    rm.relativeTo = 5.0
+    rm.writeHdf(f, 'rm1d', withPosterior = True, index=0)
+
+    rm = deepcopy(rm0)
+    for i in range(1000):
+        rm = rm.perturb(); rm.update_posteriors()
+    rm.relativeTo = 10.0
+    rm.writeHdf(f, 'rm1d', withPosterior = True, index=1)
+
+    rm = deepcopy(rm0)
+    for i in range(1000):
+        rm = rm.perturb(); rm.update_posteriors()
+    rm.relativeTo = 25.0
+    rm.writeHdf(f, 'rm1d', withPosterior = True, index=2)
+
+with h5py.File('rm1d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['rm1d'])
+
+p+=1; plt.figure(p)
+plt.subplot(121)
+arr = np.random.randn(3, rm.max_cells) * 10
+_ = rm0.pcolor(arr[0, :rm0.nCells.item()], grid=True, transpose=True, flip=True)
+plt.subplot(122)
+_ = rm2.pcolor(arr, grid=True, flipY=True, equalize=True)
+
+from geobipy import RectilinearMesh2D
+with h5py.File('rm1d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['rm1d'], index=0)
+
+plt.figure()
+plt.subplot(121)
+rm2.plotGrid(transpose=True, flip=True)
+plt.subplot(122)
+rm2.edges.posterior.pcolor(transpose=True, flip=True)
+
+plt.show()
+
+
+
    +
  • plot rectilinear mesh 1d
  • +
  • plot rectilinear mesh 1d
  • +
+

Total running time of the script: (0 minutes 4.711 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/plot_rectilinear_mesh_2d.html b/docs/examples/Meshes/plot_rectilinear_mesh_2d.html new file mode 100644 index 00000000..d22f9b52 --- /dev/null +++ b/docs/examples/Meshes/plot_rectilinear_mesh_2d.html @@ -0,0 +1,413 @@ + + + + + + + 2D Rectilinear Mesh — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Rectilinear Mesh

+

This 2D rectilinear mesh defines a grid with straight cell boundaries.

+

It can be instantiated in two ways.

+

The first is by providing the cell centres or +cell edges in two dimensions.

+

The second embeds the 2D mesh in 3D by providing the cell centres or edges in three dimensions. +The first two dimensions specify the mesh coordinates in the horiztontal cartesian plane +while the third discretizes in depth. This allows us to characterize a mesh whose horizontal coordinates +do not follow a line that is parallel to either the “x” or “y” axis.

+
import h5py
+from geobipy import StatArray
+from geobipy import RectilinearMesh1D, RectilinearMesh2D, RectilinearMesh3D
+import matplotlib.pyplot as plt
+import numpy as np
+
+
+

Specify some cell centres in x and y

+
x = StatArray(np.arange(10.0), 'Easting', 'm')
+y = StatArray(np.arange(20.0), 'Depth', 'm')
+rm = RectilinearMesh2D(x_centres=x, y_centres=y)
+
+
+

We can plot the grid lines of the mesh.

+
p=0;
+plt.figure(p)
+_  = rm.plotGrid(flipY=True, linewidth=0.5)
+
+# Intersecting multisegment lines with a mesh
+arr = np.zeros(rm.shape)
+i = rm.line_indices([0.0, 3.0, 6.0, 9], [2.0, 6.0, 0.0, 10])
+arr[i[:, 0], i[:, 1]] = 1
+p += 1; plt.figure(p)
+rm.pcolor(values = arr)
+
+
+
    +
  • plot rectilinear mesh 2d
  • +
  • plot rectilinear mesh 2d
  • +
+
(<Axes: xlabel='Easting (m)', ylabel='Depth (m)'>, <matplotlib.collections.QuadMesh object at 0x7fbfa25ab9d0>, <matplotlib.colorbar.Colorbar object at 0x7fbfa25a9480>)
+
+
+

We can pcolor the mesh by providing cell values.

+
xx, yy = np.meshgrid(rm.y.centres, rm.x.centres)
+arr = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values")
+
+p += 1; plt.figure(p)
+_ = rm.pcolor(arr, grid=True, flipY=True, linewidth=0.5)
+
+# xG = rm.xGradientMatrix()
+# zG = rm.yGradientMatrix()
+
+# dax = StatArray((xG * arr.flatten()).reshape((arr.shape[0], arr.shape[1]-1)))
+# rm2 = rm[:, :9]
+
+# plt.figure()
+# rm2.pcolor(dax, xAxis='r', grid=True, flipY=True, linewidth=0.5)
+
+# dax = StatArray((zG * arr.flatten()).reshape((arr.shape[0]-1, arr.shape[1])))
+
+# plt.figure()
+# dax.pcolor(grid=True, flipY=True, linewidth=0.5)
+
+
+plot rectilinear mesh 2d

Mask the x axis cells by a distance

+
rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, values=arr)
+p += 1; plt.figure(p)
+_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)
+
+
+plot rectilinear mesh 2d

Mask the z axis cells by a distance

+
rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(y_distance=0.2, values=arr)
+p += 1; plt.figure(p)
+_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)
+
+
+plot rectilinear mesh 2d

Mask axes by a distance

+
rm_masked, x_indices, z_indices, arr2 = rm.mask_cells(x_distance=0.4, y_distance=0.2, values=arr)
+p += 1; plt.figure(p)
+_ = rm_masked.pcolor(StatArray(arr2), grid=True, flipY=True)
+
+x = StatArray(np.arange(10.0), 'Easting', 'm')
+y = StatArray(np.cumsum(np.arange(15.0)), 'Depth', 'm')
+rm = RectilinearMesh2D(x_centres=x, y_centres=y)
+
+
+plot rectilinear mesh 2d

We can perform some interval statistics on the cell values of the mesh +Generate some values

+
a = np.repeat(np.arange(1.0, np.float64(rm.x.nCells+1))[:, np.newaxis], rm.y.nCells, 1)
+
+
+

Compute the mean over an interval for the mesh.

+
rm.intervalStatistic(a, intervals=[6.8, 12.4], axis=0, statistic='mean')
+
+
+
(array([[9., 9., 9., ..., 9., 9., 9.]]), [6.8, 12.4])
+
+
+

Compute the mean over multiple intervals for the mesh.

+
rm.intervalStatistic(a, intervals=[6.8, 12.4, 20.0, 40.0], axis=0, statistic='mean')
+
+
+
(array([[ 9.,  9.,  9., ...,  9.,  9.,  9.],
+       [nan, nan, nan, ..., nan, nan, nan],
+       [nan, nan, nan, ..., nan, nan, nan]]), [6.8, 12.4, 20.0, 40.0])
+
+
+

We can specify either axis

+
rm.intervalStatistic(a, intervals=[2.8, 4.2], axis=1, statistic='mean')
+
+
+
(array([[ 1.],
+       [ 2.],
+       [ 3.],
+       ...,
+       [ 8.],
+       [ 9.],
+       [10.]]), [2.8, 4.2])
+
+
+
rm.intervalStatistic(a, intervals=[2.8, 4.2, 5.1, 8.4], axis=1, statistic='mean')
+
+
+
(array([[ 1., nan,  1.],
+       [ 2., nan,  2.],
+       [ 3., nan,  3.],
+       ...,
+       [ 8., nan,  8.],
+       [ 9., nan,  9.],
+       [10., nan, 10.]]), [2.8, 4.2, 5.1, 8.4])
+
+
+

Slice the 2D mesh to retrieve either a 2D mesh or 1D mesh

+
rm2 = rm[:5, :5]
+rm3 = rm[:5, 5]
+rm4 = rm[5, :5]
+
+p += 1; plt.figure(p)
+plt.subplot(131)
+rm2.plotGrid()
+plt.subplot(132)
+rm3.plotGrid()
+plt.subplot(133)
+rm4.plotGrid(transpose=True)
+
+
+plot rectilinear mesh 2d

Resample a grid

+
values = StatArray(np.random.randn(*rm.shape))
+rm2, values2 = rm.resample(0.5, 0.5, values)
+
+p += 1; plt.figure(p)
+plt.subplot(121)
+rm.pcolor(values)
+plt.subplot(122)
+rm2.pcolor(values2)
+
+
+plot rectilinear mesh 2d
(<Axes: >, <matplotlib.collections.QuadMesh object at 0x7fbf62976530>, <matplotlib.colorbar.Colorbar object at 0x7fbf629765c0>)
+
+
+
+

Axes in log space

+
x = StatArray(np.logspace(-1, 4, 10), 'x')
+y = StatArray(np.logspace(0, 3, 10), 'y')
+rm = RectilinearMesh2D(x_edges=x, x_log=10, y_edges=y, y_log=10)
+
+# We can plot the grid lines of the mesh.
+p += 1; plt.figure(p)
+_  = rm.plotGrid(linewidth=0.5)
+
+
+plot rectilinear mesh 2d
with h5py.File('rm2d.h5', 'w') as f:
+    rm.toHdf(f, 'test')
+
+with h5py.File('rm2d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['test'])
+
+arr = np.random.randn(*rm.shape)
+p += 1; plt.figure(p)
+plt.subplot(211)
+rm.pcolor(arr)
+plt.subplot(212)
+rm2.pcolor(arr)
+
+
+plot rectilinear mesh 2d
(<Axes: xlabel='x', ylabel='y'>, <matplotlib.collections.QuadMesh object at 0x7fbf629922f0>, <matplotlib.colorbar.Colorbar object at 0x7fbf629916c0>)
+
+
+
+
+

RelativeTo

+
x = StatArray(np.arange(10.0), 'Northing', 'm')
+y = StatArray(np.arange(20.0), 'Depth', 'm')
+
+rm = RectilinearMesh2D(x_centres=x, y_centres=y)
+
+p += 1; plt.figure(p)
+plt.subplot(121)
+_  = rm.plotGrid(linewidth=0.5, flipY=True)
+rm = RectilinearMesh2D(x_centres=x, x_relative_to=0.2*np.random.randn(y.size), y_centres=y, y_relative_to=0.2*np.random.randn(x.size))
+plt.subplot(122)
+_  = rm.plotGrid(linewidth=0.5, flipY=True)
+
+# RelativeTo single
+with h5py.File('rm2d.h5', 'w') as f:
+    rm.toHdf(f, 'test')
+
+with h5py.File('rm2d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['test'])
+
+arr = np.random.randn(*rm.shape)
+p += 1; plt.figure(p)
+plt.subplot(211)
+rm.pcolor(arr, flipY=True)
+plt.subplot(212)
+rm2.pcolor(arr, flipY=True)
+
+# RelativeTo expanded
+with h5py.File('rm2d.h5', 'w') as f:
+    rm.createHdf(f, 'test', add_axis=RectilinearMesh1D(centres=StatArray(np.arange(3.0), name='Easting', units="m"), relativeTo = 0.2*np.random.randn(x.size, y.size)))
+    for i in range(3):
+        rm.x.relativeTo += 0.5
+        rm.y.relativeTo += 0.5
+        rm.writeHdf(f, 'test', index=i)
+
+with h5py.File('rm2d.h5', 'r') as f:
+    rm2 = RectilinearMesh2D.fromHdf(f['test'], index=0)
+
+with h5py.File('rm2d.h5', 'r') as f:
+    rm3 = RectilinearMesh3D.fromHdf(f['test'])
+
+p += 1; plt.figure(p)
+plt.subplot(311)
+rm.pcolor(arr, flipY=True)
+plt.subplot(312)
+rm2.pcolor(arr, flipY=True)
+
+p += 1; plt.figure(p)
+arr = np.random.randn(*rm3.shape)
+plt.subplot(311)
+mesh = rm3[0, :, :]
+mesh.pcolor(arr[0, :, :], flipY=True)
+plt.subplot(312)
+mesh = rm3[:, 0, :]
+mesh.pcolor(arr[:, 0, :], flipY=True)
+plt.subplot(313)
+rm3[:, :, 0].pcolor(arr[:, :, 0])
+
+plt.show()
+
+
+
    +
  • plot rectilinear mesh 2d
  • +
  • plot rectilinear mesh 2d
  • +
  • plot rectilinear mesh 2d
  • +
  • plot rectilinear mesh 2d
  • +
+

Total running time of the script: (0 minutes 2.015 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/plot_rectilinear_mesh_3d.html b/docs/examples/Meshes/plot_rectilinear_mesh_3d.html new file mode 100644 index 00000000..840bd474 --- /dev/null +++ b/docs/examples/Meshes/plot_rectilinear_mesh_3d.html @@ -0,0 +1,299 @@ + + + + + + + 3D Rectilinear Mesh — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

3D Rectilinear Mesh

+

This 3D rectilinear mesh defines a grid with straight cell boundaries.

+
from geobipy import StatArray
+from geobipy import RectilinearMesh3D
+import matplotlib.pyplot as plt
+import numpy as np
+import h5py
+
+
+

Specify some cell centres in x and y

+
x = StatArray(np.arange(10.0), 'Easting', 'm')
+y = StatArray(np.arange(15.0), 'Northing', 'm')
+z = StatArray(np.arange(20.0), 'Depth', 'm')
+
+rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)
+
+rm1 = rm[:5, :5, :5]
+rm2 = rm[:, :, 5]
+rm3 = rm[:, 5, :]
+rm4 = rm[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+rm2.plotGrid()
+plt.subplot(232)
+rm3.plotGrid()
+plt.subplot(233)
+rm4.plotGrid()
+
+
+plot rectilinear mesh 3d
rm2 = rm[:, 5, 5]
+rm3 = rm[5, :, 5]
+rm4 = rm[5, 5, :]
+
+plt.subplot(234)
+rm2.plotGrid()
+plt.subplot(235)
+rm3.plotGrid()
+plt.subplot(236)
+rm4.plotGrid()
+
+
+plot rectilinear mesh 3d
with h5py.File('rm3d.h5', 'w') as f:
+    rm.createHdf(f, 'test')
+    rm.writeHdf(f, 'test')
+
+with h5py.File('rm3d.h5', 'r') as f:
+    rm2 = RectilinearMesh3D.fromHdf(f['test'])
+
+rm.pyvista_mesh().save('rm3d.vtk')
+
+
+xx, yy = np.meshgrid(rm.y.centres, rm.x.centres)
+z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re")
+rm = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re)
+
+rm1 = rm[:5, :5, :5]
+rm2 = rm[:, :, 5]
+rm3 = rm[:, 5, :]
+rm4 = rm[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+rm2.plotGrid()
+plt.subplot(232)
+rm3.plotGrid()
+plt.subplot(233)
+rm4.plotGrid()
+
+
+plot rectilinear mesh 3d

We can plot the mesh in 3D!

+
pv = rm.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
mesh = rm.pyvista_mesh().save('rm3d_re1.vtk')
+
+
+x_re = StatArray(np.sin(np.repeat(rm.y.centres[:, None], rm.z.nCells, 1)), "x_re")
+
+xx, yy = np.meshgrid(rm.y.centres, rm.x.centres)
+z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re")
+rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re)
+
+rm1 = rm[:5, :5, :5]
+rm2 = rm[:, :, 5]
+rm3 = rm[:, 5, :]
+rm4 = rm[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+rm2.plotGrid()
+plt.subplot(232)
+rm3.plotGrid()
+plt.subplot(233)
+rm4.plotGrid()
+
+
+plot rectilinear mesh 3d

We can plot the mesh in 3D!

+
pv = rm.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
mesh = rm.pyvista_mesh().save('rm3d_re2.vtk')
+
+
+xx, yy = np.meshgrid(rm.z.centres, rm.y.centres)
+x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re")
+
+xx, yy = np.meshgrid(rm.z.centres, rm.x.centres)
+y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re")
+
+xx, yy = np.meshgrid(rm.y.centres, rm.x.centres)
+z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re")
+rm = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)
+
+rm1 = rm[:5, :5, :5]
+rm2 = rm[:, :, 5]
+rm3 = rm[:, 5, :]
+rm4 = rm[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+rm2.plotGrid()
+plt.subplot(232)
+rm3.plotGrid()
+plt.subplot(233)
+rm4.plotGrid()
+
+
+plot rectilinear mesh 3d

We can plot the mesh in 3D!

+
pv = rm.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
mesh = rm.pyvista_mesh().save('rm3d_re3.vtk')
+
+with h5py.File('rm3d.h5', 'w') as f:
+    rm.toHdf(f, 'test')
+
+with h5py.File('rm3d.h5', 'r') as f:
+    rm2 = RectilinearMesh3D.fromHdf(f['test'])
+
+rm2.pyvista_mesh().save('rm3d_read.vtk')
+
+plt.show()
+
+
+

Total running time of the script: (0 minutes 3.318 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Meshes/sg_execution_times.html b/docs/examples/Meshes/sg_execution_times.html new file mode 100644 index 00000000..e75cf794 --- /dev/null +++ b/docs/examples/Meshes/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:10.044 total execution time for 3 files from examples/Meshes:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

1D Rectilinear Mesh (plot_rectilinear_mesh_1d.py)

00:04.711

0.0

3D Rectilinear Mesh (plot_rectilinear_mesh_3d.py)

00:03.318

0.0

2D Rectilinear Mesh (plot_rectilinear_mesh_2d.py)

00:02.015

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/README.html b/docs/examples/Models/README.html new file mode 100644 index 00000000..5aa5f80d --- /dev/null +++ b/docs/examples/Models/README.html @@ -0,0 +1,115 @@ + + + + + + + Models — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Models

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/index.html b/docs/examples/Models/index.html new file mode 100644 index 00000000..4a3ae3a2 --- /dev/null +++ b/docs/examples/Models/index.html @@ -0,0 +1,155 @@ + + + + + + + Models — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Models

+
+

1D Model with an infinite halfspace

+
1D Model with an infinite halfspace
+
+

2D Rectilinear Model

+
2D Rectilinear Model
+
+

3D Rectilinear Model

+
3D Rectilinear Model
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/plot_model_1d.html b/docs/examples/Models/plot_model_1d.html new file mode 100644 index 00000000..ea66b95f --- /dev/null +++ b/docs/examples/Models/plot_model_1d.html @@ -0,0 +1,321 @@ + + + + + + + 1D Model with an infinite halfspace — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

1D Model with an infinite halfspace

+
from copy import deepcopy
+from geobipy import StatArray
+from geobipy import RectilinearMesh1D
+from geobipy import Model
+from geobipy import Distribution
+import matplotlib.pyplot as plt
+import numpy as np
+
+
+
+

Instantiate the 1D Model with a Half Space

+
# Make a test model with 10 layers, and increasing parameter values
+nLayers = 2
+par = StatArray(np.linspace(0.001, 0.02, nLayers), "Conductivity", "$\\frac{S}{m}$")
+thk = StatArray(np.full(nLayers, fill_value=10.0))
+thk[-1] = np.inf
+mesh = RectilinearMesh1D(widths = thk)
+
+mod = Model(mesh = mesh, values=par)
+# mod = Model1D(parameters=par, widths=thk)
+
+plt.figure()
+mod.plotGrid(transpose=True, flip=True)
+
+
+plot model 1d
+
+

Randomness and Model Perturbations

+

We can set the priors on the 1D model by assigning minimum and maximum layer +depths and a maximum number of layers. These are used to create priors on +the number of cells in the model, a new depth interface, new parameter values +and the vertical gradient of those parameters. +The halfSpaceValue is used as a reference value for the parameter prior.

+
from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+# Set the priors
+mod.set_priors(value_mean=0.01,
+              min_edge=1.0,
+              max_edge=150.0,
+              max_cells=30,
+              solve_value=True,
+              solve_gradient=True,
+              prng=prng)
+
+
+

We can evaluate the prior of the model using depths only

+
print('Log probability of the Model given its priors: ', mod.probability(False, False))
+# Or with priors on its parameters, and parameter gradient with depth.
+print('Log probability of the Model given its priors: ', mod.probability(True, True))
+
+
+
Log probability of the Model given its priors:  -13.338200594791775
+Log probability of the Model given its priors:  -19.780269280707714
+
+
+

To propose new models, we specify the probabilities of creating, removing, perturbing, and not changing +a layer interface

+
pProposal = Distribution('LogNormal', 0.01, np.log(2.0)**2.0, linearSpace=True, prng=prng)
+mod.set_proposals(probabilities=[0.25, 0.25, 0.5, 0.25], proposal=pProposal, prng=prng)
+
+
+

We can then perturb the layers of the model

+
remapped, perturbed = mod.perturb()
+
+
+
fig = plt.figure(figsize=(8, 6))
+ax = plt.subplot(121)
+mod.pcolor(transpose=True, flip=True, log=10)  # , grid=True)
+ax = plt.subplot(122)
+perturbed.pcolor(transpose=True, flip=True, log=10)  # , grid=True)
+
+
+plot model 1d
<Axes: >
+
+
+

We can evaluate the prior of the model using depths only

+
print('Log probability of the Model given its priors: ',perturbed.probability(False, False))
+# Or with priors on its parameters, and parameter gradient with depth.
+print('Log probability of the Model given its priors: ',perturbed.probability(True, True))
+
+
+
Log probability of the Model given its priors:  -13.338200594791775
+Log probability of the Model given its priors:  -19.03751254813826
+
+
+
+
+

Perturbing a model multiple times

+

In the stochasitic inference process, we perturb the model structure, +and parameter values, multiple times. +Each time the model is perturbed, we can record its state +in a posterior distribution.

+

For a 1D model, the parameter posterior is a 2D hitmap with depth in one dimension +and the parameter value in the other. +We also attach a 1D histogram for the number of layers, +and a 1D histogram for the locations of interfaces.

+

Since we have already set the priors on the Model, we can set the posteriors +based on bins from from the priors.

+
mod.set_posteriors()
+
+mod0 = deepcopy(mod)
+
+
+

Now we randomly perturb the model, and update its posteriors.

+
mod.update_posteriors()
+for i in range(1001):
+    remapped, perturbed = mod.perturb()
+
+    # And update the model posteriors
+    perturbed.update_posteriors()
+
+    mod = perturbed
+
+
+

We can now plot the posteriors of the model.

+

Remember in this case, we are simply perturbing the model structure and parameter values +The proposal for the parameter values is fixed and centred around a single value. +fig = plt.figure(figsize=(8, 6))

+
# plt.subplot(131)
+# mod.nCells.posterior.plot()
+# ax = plt.subplot(132)
+# mod.values.posterior.pcolor(cmap='gray_r', colorbar=False, flipY=True, logX=10)
+# plt.subplot(133, sharey=ax)
+# mod.mesh.edges.posterior.plot(transpose=True, flipY=True)
+
+# plt.figure()
+# mod.plot_posteriors(**{"cmap": 'gray_r',
+#                   "xscale": 'log',
+#                   "noColorbar": True,
+#                   "flipY": True,
+#                   'credible_interval_kwargs':{'axis': 1,
+#                                           'reciprocate': True,
+#                                           'xscale': 'log'}})
+# mod.par.posterior.plotCredibleIntervals(xscale='log', axis=1)
+
+
+fig = plt.figure(figsize=(8, 6))
+# gs = fig.add_gridspec(nrows=1, ncols=1)
+mod.plot_posteriors(axes=fig,
+                    edges_kwargs = {
+                        "transpose":True,
+                        "flipY":True
+                    },
+                    parameter_kwargs = {
+                        "cmap": 'gray_r',
+                        "xscale": 'log',
+                        "colorbar": False,
+                        "flipY": True,
+                        'credible_interval_kwargs':{
+                              'reciprocate':True,
+                            #   'axis': 1,
+                              'xscale': 'log'
+                        }
+                    },
+                    best = mod)
+
+
+plt.show()
+
+
+plot model 1d

Total running time of the script: (0 minutes 3.092 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/plot_model_2d.html b/docs/examples/Models/plot_model_2d.html new file mode 100644 index 00000000..6eefab2a --- /dev/null +++ b/docs/examples/Models/plot_model_2d.html @@ -0,0 +1,206 @@ + + + + + + + 2D Rectilinear Model — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

2D Rectilinear Model

+

This 2D rectilinear model defines a grid with straight cell boundaries.

+
from geobipy import StatArray
+from geobipy import RectilinearMesh2D
+from geobipy import Model
+import h5py
+import matplotlib.pyplot as plt
+import numpy as np
+
+
+

Specify some cell centres in x and y

+
x = StatArray(np.arange(11.0), 'Easting', 'm')
+y = StatArray(np.arange(11.0), 'Northing', 'm')
+mesh = RectilinearMesh2D(x_edges=x, y_edges=y)
+
+xx, yy = np.meshgrid(mesh.x.centres, mesh.y.centres)
+values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Values")
+
+mod = Model(mesh=mesh, values = values)
+
+plt.figure()
+mod.pcolor()
+
+mod2 = mod.resample(0.5, 0.5)
+mod3 = mod.resample(1.5, 1.5)
+plt.figure()
+plt.subplot(121)
+mod2.pcolor()
+plt.axis('equal')
+plt.subplot(122)
+mod3.pcolor()
+plt.axis('equal')
+
+
+# #%%
+# # We can plot the mesh in 3D!
+# pv = rm.pyvista_plotter()
+# pv.show()
+
+# rm.to_vtk('Model3D.vtk')
+
+with h5py.File('Model2D.h5', 'w') as f:
+    mod.toHdf(f, 'model')
+
+with h5py.File('Model2D.h5', 'r') as f:
+    mod2 = Model.fromHdf(f['model'])
+
+
+plt.show()
+
+
+
    +
  • plot model 2d
  • +
  • plot model 2d
  • +
+

Total running time of the script: (0 minutes 0.249 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/plot_model_3d.html b/docs/examples/Models/plot_model_3d.html new file mode 100644 index 00000000..db8699bc --- /dev/null +++ b/docs/examples/Models/plot_model_3d.html @@ -0,0 +1,335 @@ + + + + + + + 3D Rectilinear Model — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

3D Rectilinear Model

+

This 3D rectilinear model defines a grid with straight cell boundaries.

+
from geobipy import StatArray
+from geobipy import RectilinearMesh3D
+from geobipy import Model
+import matplotlib.pyplot as plt
+import numpy as np
+import h5py
+
+
+"""
+3D Rectilinear Mesh
+-------------------
+This 3D rectilinear mesh defines a grid with straight cell boundaries.
+
+"""
+
+
+
'\n3D Rectilinear Mesh\n-------------------\nThis 3D rectilinear mesh defines a grid with straight cell boundaries.\n\n'
+
+
+
from geobipy import StatArray
+from geobipy import RectilinearMesh3D
+from geobipy import Model
+import matplotlib.pyplot as plt
+import numpy as np
+import h5py
+
+
+

Specify some cell centres in x and y

+
x = StatArray(np.arange(10.0), 'Easting', 'm')
+y = StatArray(np.arange(15.0), 'Northing', 'm')
+z = StatArray(np.arange(20.0), 'Depth', 'm')
+
+mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)
+
+xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)
+values = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "Height")
+values = np.repeat(values[:, :, None], mesh.z.nCells, 2)
+
+model = Model(mesh=mesh, values=values)
+
+model1 = model[:5, :5, :5]
+model2 = model[:, :, 5]
+model3 = model[:, 5, :]
+model4 = model[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+model2.pcolor()
+plt.subplot(232)
+model3.pcolor()
+plt.subplot(233)
+model4.pcolor()
+
+
+plot model 3d
(<Axes: xlabel='Northing (m)', ylabel='Depth (m)'>, <matplotlib.collections.QuadMesh object at 0x7fbf544e80a0>, <matplotlib.colorbar.Colorbar object at 0x7fbf544eb100>)
+
+
+
model2 = model[:, 5, 5]
+model3 = model[5, :, 5]
+model4 = model[5, 5, :]
+
+plt.subplot(234)
+model2.pcolor()
+plt.subplot(235)
+model3.pcolor()
+plt.subplot(236)
+model4.pcolor()
+
+
+plot model 3d
<Axes: xlabel='Depth (m)'>
+
+
+
with h5py.File('model3d.h5', 'w') as f:
+    model.createHdf(f, 'test')
+    model.writeHdf(f, 'test')
+
+with h5py.File('model3d.h5', 'r') as f:
+    model2 = Model.fromHdf(f['test'])
+
+model.pyvista_mesh().save('model3d.vtk')
+
+
+xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)
+z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re")
+mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z, z_relative_to=z_re)
+model = Model(mesh=mesh, values=values)
+
+model1 = model[:5, :5, :5]
+model2 = model[:, :, 5]
+model3 = model[:, 5, :]
+model4 = model[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+model2.pcolor()
+plt.subplot(232)
+model3.pcolor()
+plt.subplot(233)
+model4.pcolor()
+
+
+plot model 3d
(<Axes: xlabel='Northing (m)'>, <matplotlib.collections.QuadMesh object at 0x7fbf531d48e0>, <matplotlib.colorbar.Colorbar object at 0x7fbf531d5f30>)
+
+
+

We can plot the mesh in 3D!

+
pv = model.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
model.pyvista_mesh().save('model3d_re1.vtk')
+
+
+x_re = StatArray(np.sin(np.repeat(mesh.y.centres[:, None], mesh.z.nCells, 1)), "x_re")
+mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, z_edges=z, z_relative_to=z_re)
+model = Model(mesh=mesh, values=values)
+
+model1 = model[:5, :5, :5]
+model2 = model[:, :, 5]
+model3 = model[:, 5, :]
+model4 = model[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+model2.pcolor()
+plt.subplot(232)
+model3.pcolor()
+plt.subplot(233)
+model4.pcolor()
+
+
+plot model 3d
(<Axes: xlabel='Northing (m)'>, <matplotlib.collections.QuadMesh object at 0x7fbf62995a50>, <matplotlib.colorbar.Colorbar object at 0x7fbf62995930>)
+
+
+

We can plot the mesh in 3D!

+
pv = model.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
model.pyvista_mesh().save('model3d_re2.vtk')
+
+
+xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres)
+y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re")
+
+mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)
+model = Model(mesh=mesh, values=values)
+
+model1 = model[:5, :5, :5]
+model2 = model[:, :, 5]
+model3 = model[:, 5, :]
+model4 = model[5, :, :]
+
+plt.figure()
+plt.subplot(231)
+model2.pcolor()
+plt.subplot(232)
+model3.pcolor()
+plt.subplot(233)
+model4.pcolor()
+
+
+plot model 3d
(<Axes: >, <matplotlib.collections.QuadMesh object at 0x7fbf62977460>, <matplotlib.colorbar.Colorbar object at 0x7fbf629755d0>)
+
+
+

We can plot the mesh in 3D!

+
pv = model.pyvista_plotter()
+
+
+

We can plot the mesh in 3D!

+
model.pyvista_mesh().save('model3d_re3.vtk')
+
+# with h5py.File('mesh3d.h5', 'w') as f:
+#     mesh.toHdf(f, 'test')
+
+# with h5py.File('mesh3d.h5', 'r') as f:
+#     mesh2 = RectilinearMesh3D.fromHdf(f['test'])
+
+# mesh2.pyvista_mesh().save('mesh3d_read.vtk')
+
+plt.show()
+
+
+

Total running time of the script: (0 minutes 0.908 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Models/sg_execution_times.html b/docs/examples/Models/sg_execution_times.html new file mode 100644 index 00000000..67d3f524 --- /dev/null +++ b/docs/examples/Models/sg_execution_times.html @@ -0,0 +1,151 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:04.249 total execution time for 3 files from examples/Models:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

1D Model with an infinite halfspace (plot_model_1d.py)

00:03.092

0.0

3D Rectilinear Model (plot_model_3d.py)

00:00.908

0.0

2D Rectilinear Model (plot_model_2d.py)

00:00.249

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/README.html b/docs/examples/README.html new file mode 100644 index 00000000..754f70ac --- /dev/null +++ b/docs/examples/README.html @@ -0,0 +1,115 @@ + + + + + + + Examples — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Examples

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/README.html b/docs/examples/Statistics/README.html new file mode 100644 index 00000000..70f26289 --- /dev/null +++ b/docs/examples/Statistics/README.html @@ -0,0 +1,115 @@ + + + + + + + Statistics — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Statistics

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/index.html b/docs/examples/Statistics/index.html new file mode 100644 index 00000000..126b20ab --- /dev/null +++ b/docs/examples/Statistics/index.html @@ -0,0 +1,149 @@ + + + + + + + Statistics — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Statistics

+
+

Histogram 1D

+
Histogram 1D
+
+

Histogram 2D

+
Histogram 2D
+
+

Histogram 3D

+
Histogram 3D
+
+

StatArray Class

+
StatArray Class
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/plot_StatArray.html b/docs/examples/Statistics/plot_StatArray.html new file mode 100644 index 00000000..b07c073a --- /dev/null +++ b/docs/examples/Statistics/plot_StatArray.html @@ -0,0 +1,828 @@ + + + + + + + StatArray Class — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

StatArray Class

+

Extends the numpy ndarray class to add extra attributes such as names, and +units, and allows us to attach statistical descriptors of the array. +The direct extension to numpy maintains speed and functionality of numpy arrays.

+
from geobipy import StatArray
+from geobipy import Histogram
+from geobipy import Distribution
+from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D
+import numpy as np
+import matplotlib.pyplot as plt
+import h5py
+
+# plt.style.use('seaborn-pastel')
+
+
+
+

Instantiating a new StatArray class

+
# Integer
+test = StatArray(1, name='1')
+print(test.summary)
+test = StatArray(10, name='10')
+print(test.summary)
+# tuple/Shape
+test = StatArray((2, 10), name='(2, 10)')
+print(test.summary)
+
+# float
+test = StatArray(45.454, name='45.454')
+print(test.summary)
+test = StatArray(np.float64(45.454), name='45.454')
+print(test.summary)
+
+# complex
+# test = StatArray(np.complex(0.0, 1.0), name='complex(0, 1)')
+
+# array
+Density = StatArray(np.random.randn(1), name="Density", units="$\frac{g}{cc}$")
+print(Density.summary)
+
+# The StatArray can take any numpy function that returns an array as an input.
+# The name and units of the variable can be assigned to the StatArray.
+
+
+
Name: 1 0x7fbf40481ac0
+Shape: (1,)
+Values: [0.]
+Min: 0.0
+Max: 0.0
+has_posterior: False
+
+Name: 10 0x7fbf52997540
+Shape: (10,)
+Values: [0. 0. 0. ... 0. 0. 0.]
+Min: 0.0
+Max: 0.0
+has_posterior: False
+
+Name: (2, 10) 0x7fbf40481ac0
+Shape: (2, 10)
+Values: [[0. 0. 0. ... 0. 0. 0.]
+ [0. 0. 0. ... 0. 0. 0.]]
+Min: 0.0
+Max: 0.0
+has_posterior: False
+
+Name: 45.454 0x7fbf52997540
+Shape: (1,)
+Values: [45.454]
+Min: 45.454
+Max: 45.454
+has_posterior: False
+
+Name: 45.454 0x7fbf40481ac0
+Shape: (1,)
+Values: [45.454]
+Min: 45.454
+Max: 45.454
+has_posterior: False
+
+Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40
+Shape: (1,)
+Values: [-0.57912126]
+Min: -0.5791212563194518
+Max: -0.5791212563194518
+has_posterior: False
+
+
+
+
+

Attaching Prior and Proposal Distributions to a StatArray

+

The StatArray class has been built so that we may easily +attach not only names and units, but statistical distributions too. +We won’t go into too much detail about the different distribution +classes here so check out the Distribution Class for a better description.

+

Two types of distributions can be attached to the StatArray.

+ +
# Obtain an instantiation of a random number generator.
+# This is optional, but is an important consideration for parallel programming.
+from numpy.random import Generator
+from numpy.random import PCG64DXSM
+generator = PCG64DXSM(seed=0)
+prng = Generator(generator)
+
+Density.prior = Distribution('Uniform', -2.0, 2.0, prng=prng)
+
+
+

We can also attach a proposal distribution

+
Density.proposal = Distribution('Normal', 0.0, 1.0, prng=prng)
+print(Density.summary)
+print("Class type of the prior: ",type(Density.prior))
+print("Class type of the proposal: ",type(Density.proposal))
+
+
+
Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40
+Shape: (1,)
+Values: [-0.57912126]
+Min: -0.5791212563194518
+Max: -0.5791212563194518
+Prior:
+|   Uniform Distribution:
+|   Min: -2.0
+|   Max: 2.0
+Proposal:
+|   Normal
+|       Mean:0.0
+|   Variance:1.0
+has_posterior: False
+
+Class type of the prior:  <class 'geobipy.src.classes.statistics.UniformDistribution.Uniform'>
+Class type of the proposal:  <class 'geobipy.src.classes.statistics.NormalDistribution.Normal'>
+
+
+

The values in the variable can be evaluated against the prior. +In this case, we have 3 elements in the variable, and a univariate Normal for the prior. +Therefore each element is evaluated to get 3 probabilities, one for each element.

+
print(Density.probability(log=False))
+
+
+
0.25
+
+
+

The univariate proposal distribution can generate random samples from itself.

+
print(Density.propose())
+
+
+
1.1375024404290368
+
+
+

From a sampling stand point we can either sample using only the proposal +Or we can only generate samples that simultaneously satisfy the prior.

+
print(Density.propose(relative=True))
+
+
+
[-0.04095499]
+
+
+

We can perturb the variable by drawing from the attached proposal distribution.

+
Density.perturb()
+print(Density.summary)
+
+
+
Name: Density ($\frac{g}{cc}$) 0x7fbf52997f40
+Shape: (1,)
+Values: [0.38188467]
+Min: 0.38188466718060166
+Max: 0.38188466718060166
+Prior:
+|   Uniform Distribution:
+|   Min: -2.0
+|   Max: 2.0
+Proposal:
+|   Normal
+|       Mean:0.0
+|   Variance:1.0
+has_posterior: False
+
+
+
+
+

Attaching a Histogram to capture the posterior distribution

+

The StatArray can perturb itself, evaluate its current probability given its priors +and a histogram can be attached to capture its posterior distribution. +As an example, lets create a Histogram class with bins generated from the prior.

+
bins = Density.prior.bins()
+
+
+

Attach the histogram

+
Density.posterior = Histogram(mesh = RectilinearMesh1D(edges=bins))
+
+
+

In an iterative sense, we can propose and evaluate new values, and update the posterior

+
for i in range(1000):
+    Density.perturb()
+    p = Density.probability(log=False)
+
+    if p > 0.0: # This is a simple example!
+        Density.update_posterior()
+
+
+
plt.figure()
+Density.summaryPlot()
+
+
+Prior, Proposal, Posterior
+
+

Attach a multivariate normal distribution as the prior and proposal

+

Attach the multivariate prior

+
mean = np.random.randn(Density.size)
+variance = np.ones(Density.size)
+Density.prior = Distribution('MvNormal', mean, variance, prng=prng)
+
+
+

Since the prior is multivariate, the appropriate equations are used to +evaluate the probability for all elements in the StatArray. +This produces a single probability.

+
print(Density.probability(log=False))
+
+
+
0.3912195449832787
+
+
+

Attach the multivariate proposal

+
mean = np.random.randn(Density.size)
+variance = np.ones(Density.size)
+Density.proposal = Distribution('MvNormal', mean, variance, prng=prng)
+
+
+

Perturb the variables using the multivariate proposal.

+
Density.perturb()
+Density.summary
+
+with h5py.File('statarray.h5', 'w') as f:
+    Density.createHdf(f, 'statarray', withPosterior=True, add_axis=3)
+    Density.writeHdf(f, 'statarray', withPosterior=True, index=0)
+
+with h5py.File('statarray.h5', 'r') as f:
+    tmp = StatArray.fromHdf(f, 'statarray', index=0, skip_posterior=False)
+
+with h5py.File('statarray.h5', 'r') as f:
+    tmp = StatArray.fromHdf(f, 'statarray', skip_posterior=False)
+
+
+
+
+

Basic manipulation

+

The StatArray contains other functions to perform basic array manipulations

+

These routines essentially wrap around numpy functions, +but the result will have the same name and units, +and if any prior or proposal are set, those will be carried through too.

+
+

1D example

+
x = StatArray(-np.cumsum(np.arange(10.0)))
+print(x)
+
+
+
[ -0.  -1.  -3. ... -28. -36. -45.]
+
+
+
print(x.insert(i=[0, 9], values=[999.0, 999.0]))
+
+
+
[999.  -0.  -1. ... -36. 999. -45.]
+
+
+
print(x.prepend(999.0))
+
+
+
[999.  -0.  -1. ... -28. -36. -45.]
+
+
+
print(x.prepend([998.0, 999.0]))
+
+
+
[998. 999.  -0. ... -28. -36. -45.]
+
+
+
print(x.append([998.0, 999.0]))
+
+
+
[ -0.  -1.  -3. ... -45. 998. 999.]
+
+
+
print(x.resize(14))
+
+
+
[-0. -1. -3. ... -1. -3. -6.]
+
+
+
print(x.delete([5,8]))
+
+
+
[ -0.  -1.  -3. ... -21. -28. -45.]
+
+
+
print(x.edges())
+
+
+
[  0.5  -0.5  -2.  ... -32.  -40.5 -49.5]
+
+
+
print(x.internalEdges())
+
+
+
[ -0.5  -2.   -4.5 ... -24.5 -32.  -40.5]
+
+
+
print(x.firstNonZero())
+
+
+
1
+
+
+
print(x.lastNonZero())
+
+
+
10
+
+
+
print(x.abs())
+
+
+
[ 0.  1.  3. ... 28. 36. 45.]
+
+
+
+
+

2D example

+
x = StatArray(np.asarray([[0, -2, 3],[3, 0, -1],[1, 2, 0]]))
+print(x)
+
+
+
[[ 0 -2  3]
+ [ 3  0 -1]
+ [ 1  2  0]]
+
+
+
print(x.insert(i=0, values=4))
+
+
+
[[ 4  4  4]
+ [ 0 -2  3]
+ [ 3  0 -1]
+ [ 1  2  0]]
+
+
+
print(x.insert(i=[2, 3], values=5, axis=1))
+
+
+
[[ 0 -2  5  3  5]
+ [ 3  0  5 -1  5]
+ [ 1  2  5  0  5]]
+
+
+
print(x.insert(i=2, values=[10, 11, 12], axis=1))
+
+
+
[[ 0 -2 10  3]
+ [ 3  0 11 -1]
+ [ 1  2 12  0]]
+
+
+
print(x.prepend(999))
+
+
+
[[999 999 999]
+ [  0  -2   3]
+ [  3   0  -1]
+ [  1   2   0]]
+
+
+
print(x.prepend([999, 998, 997], axis=1))
+
+
+
[[999 998 997   0  -2   3]
+ [999 998 997   3   0  -1]
+ [999 998 997   1   2   0]]
+
+
+
print(x.append([[999, 998, 997]]))
+
+
+
[[  0  -2   3]
+ [  3   0  -1]
+ [  1   2   0]
+ [999 998 997]]
+
+
+
print(x.resize([5,5]))
+
+
+
[[ 0 -2  3  3  0]
+ [-1  1  2  0  0]
+ [-2  3  3  0 -1]
+ [ 1  2  0  0 -2]
+ [ 3  3  0 -1  1]]
+
+
+
print(x.delete(5))
+
+
+
[ 0 -2  3 ...  1  2  0]
+
+
+
print(x.delete(2, axis=0))
+
+
+
[[ 0 -2  3]
+ [ 3  0 -1]]
+
+
+
print(x.firstNonZero(axis=0))
+
+
+
[1 0 0]
+
+
+
print(x.lastNonZero(axis=0))
+
+
+
[3 3 2]
+
+
+
print(x.firstNonZero(axis=1))
+
+
+
[1 0 0]
+
+
+
print(x.lastNonZero(axis=1))
+
+
+
[3 3 2]
+
+
+
print(x.abs())
+
+
+
[[0 2 3]
+ [3 0 1]
+ [1 2 0]]
+
+
+
+
+
+

Plotting

+

We can easily plot the StatArray with its built in plotting functions. +All plotting functions can take matplotlib keywords

+
# The simplest is to just plot the array
+
+Density = StatArray(np.random.randn(100),name="Density",units="$\frac{g}{cc}$")
+Time = StatArray(np.linspace(0, 100, Density.size), name='Time', units='s')
+Depth = StatArray(np.random.exponential(size=Density.size), name='Depth', units='m')
+
+
+
plt.figure()
+_ = Density.plot(linewidth=0.5, marker='x', markersize=1.0)
+
+
+plot StatArray

We can quickly plot a bar graph.

+
plt.figure()
+_ = Density.bar()
+
+
+plot StatArray

We can scatter the contents of the StatArray if it is 1D

+
plt.figure()
+_ = Density.scatter(alpha=0.7)
+
+
+plot StatArray
+

Histogram Equalization

+

A neat trick with colourmaps is histogram equalization. +This approach forces all colours in the images to have an equal weight. +This distorts the colour bar, but can really highlight the lower and higher +ends of whatever you are plotting. Just add the equalize keyword!

+
plt.figure()
+_ = Density.scatter(alpha=0.7, equalize=True)
+
+
+plot StatArray

Take the log base(x) of the data

+

We can also take the data to a log, log10, log2, or a custom number!

+
plt.figure()
+_ = Density.scatter(alpha=0.7,edgecolor='k',log='e') # could also use log='e', log=2, log=x) where x is the base you require
+
+
+plot StatArray

X and Y axes

+

We can specify the x axis of the scatter plot.

+
plt.figure()
+_ = Density.scatter(x=Time, alpha=0.7, edgecolor='k')
+
+
+plot StatArray

Notice that I never specified the y axis, so the y axis defaulted to the values in the StatArray. +In this case, any operations applied to the colours, are also applied to the y axis, e.g. log=10. +When I take the values of Density to log base 10, because I do not specify the y plotting locations, those locations are similarly affected.

+

I can however force the y co-ordinates by specifying it as input. +In the second subplot I explicitly plot distance on the y axis. +In the first subplot, the y axis is the same as the colourbar.

+
plt.figure()
+ax1 = plt.subplot(211)
+Density.scatter(x=Time, alpha=0.7, edgecolor='k', log=10)
+plt.subplot(212, sharex=ax1)
+_ = Density.scatter(x=Time, y=Depth, alpha=0.7, edgecolor='k', log=10)
+
+
+plot StatArray

Point sizes

+

Since the plotting functions take matplotlib keywords, I can also specify the size of each points.

+
s = np.ceil(100*(np.abs(np.random.randn(Density.size))))
+plt.figure()
+plt.tight_layout()
+ax1 = plt.subplot(211)
+Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=2)
+plt.subplot(212, sharex=ax1)
+#Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', sizeLegend=[1.0, 100, 200, 300])
+v = np.abs(Density)+1.0
+_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k', legend_size=[1.0, 100, 200, 300], log=10)
+
+
+plot StatArray

Of course we can still take the log, or equalize the colour histogram

+
plt.figure()
+_ = Density.scatter(x=Time, y=Depth, s=s, alpha=0.7,edgecolor='k',equalize=True,log=10)
+
+
+plot StatArray

Typically pcolor only works with 2D arrays. The StatArray has a pcolor method that will pcolor a 1D array

+
plt.figure()
+plt.subplot(221)
+Density.pcolor()
+plt.subplot(222)
+Density.pcolor(y=Time)
+plt.subplot(223)
+Density.pcolor(y=Time, flip=True)
+plt.subplot(224)
+_ = Density.pcolor(y=Time, log=10, equalize=True)
+
+
+plot StatArray

We can add grid lines, and add opacity to each element in the pcolor image

+

This is useful if the colour values need to be scaled by another variable e.g. variance.

+
plt.figure()
+plt.subplot(121)
+Density.pcolor(grid=True, cmap='jet')
+plt.subplot(122)
+a = np.linspace(1.0, 0.0, Density.size)
+_ = Density.pcolor(grid=True, alpha=a, cmap='jet')
+
+
+plot StatArray

We can plot a histogram of the StatArray

+
plt.figure()
+_ = Density.hist(100)
+
+
+plot StatArray

We can write the StatArray to a HDF5 file. HDF5 files are binary files that can include compression. They allow quick and easy access to parts of the file, and can also be written to and read from in parallel!

+
with h5py.File('1Dtest.h5','w') as f:
+    Density.toHdf(f,'test')
+
+
+

We can then read the StatArray from the file +Here x is a new variable, that is read in from the hdf5 file we just wrote.

+
x = StatArray.fromHdf('1Dtest.h5', 'test')
+print('x has the same values as Density? ',np.all(x == Density))
+x[2] = 5.0 # Change one of the values in x
+print('x has its own memory allocated (not a reference/pointer)? ', id(x) != id(Density))
+
+
+
x has the same values as Density?  True
+x has its own memory allocated (not a reference/pointer)?  True
+
+
+

We can also define a 2D array

+
Density = StatArray(np.random.randn(50,100),"Density","$\frac{g}{cc}$")
+Density.summary
+
+
+
'Name: Density ($\\frac{g}{cc}$) 0x7fbf53e697c0\nShape: (50, 100)\nValues: [[-0.09261046 -0.62871503  0.44062655 ...  0.85936645 -0.70901278\n   0.25472331]\n [ 1.26548023 -0.10173015  0.75511239 ...  0.10859768 -1.02367524\n   0.46045955]\n [-0.19867799 -0.05990528  0.25505206 ... -0.09695121 -1.36113261\n   0.77678945]\n ...\n [ 2.15214478  0.27318879 -0.40283027 ... -0.17158128  0.43057124\n  -0.32814672]\n [ 0.61189822  1.6826707   0.77990983 ...  1.21618644  0.82026928\n  -2.0003221 ]\n [ 0.65143168  1.01615216 -1.77440758 ... -0.92409722 -0.1278735\n   0.37382774]]\nMin: -3.701988729724111\nMax: 3.7179942041156253\nhas_posterior: False\n'
+
+
+

The StatArray Class’s functions work whether it is 1D or 2D

+

We can still do a histogram

+
plt.figure()
+_ = Density.hist()
+
+
+plot StatArray

And we can use pcolor to plot the 2D array

+
plt.figure()
+_ = Density.pcolor()
+
+
+plot StatArray

The StatArray comes with extra plotting options

+

Here we specify the x and y axes for the 2D array using two other 1D StatArrays

+
plt.figure()
+x = StatArray(np.arange(101),name='x Axis',units = 'mm')
+y = StatArray(np.arange(51),name='y Axis',units = 'elephants')
+_ = Density.pcolor(x=x, y=y)
+
+
+plot StatArray

We can plot using a log10 scale, in this case, we have values that are less +than or equal to 0.0. Plotting with the log option will by default mask any +of those values, and will let you know that it has done so!

+
plt.figure()
+_ = Density.pcolor(x=x,y=y,log=2)
+
+
+plot StatArray

A neat trick with colourmaps is histogram equalization. +This approach forces all colours in the image to have an equal amount. +This distorts the colours, but can really highlight the lower and higher +ends of whatever you are plotting

+
plt.figure()
+_ = Density.pcolor(x=x, y=y, equalize=True)
+
+
+plot StatArray

We can equalize the log10 plot too :)

+
plt.figure()
+_ = Density.pcolor(x=x,y=y,equalize=True, log=10)
+
+
+plot StatArray

We can add opacity to each pixel in the image

+
a = StatArray(np.random.random(Density.shape), 'Opacity from 0.0 to 1.0')
+
+
+
plt.figure()
+ax1 = plt.subplot(131)
+ax = Density.pcolor(x=x, y=y, flipY=True, linewidth=0.1, colorbar=False)
+plt.subplot(132, sharex=ax1, sharey=ax1)
+ax = Density.pcolor(x=x, y=y, alpha=a, flipY=True, linewidth=0.1, colorbar=False)
+plt.subplot(133, sharex=ax1, sharey=ax1)
+_ = a.pcolor(x=x, y=y, flipY=True)
+
+
+plot StatArray

If the array potentially has a lot of white space around the edges, we can trim the image

+
Density[:10, :] = 0.0
+Density[-10:, :] = 0.0
+Density[:, :10] = 0.0
+Density[:, -10:] = 0.0
+plt.figure()
+plt.subplot(121)
+Density.pcolor()
+plt.subplot(122)
+_ = Density.pcolor(trim=0.0)
+
+
+plot StatArray

Create a stacked area plot of a 2D StatArray

+
A = StatArray(np.abs(np.random.randn(13,100)), name='Variable', units="units")
+x = StatArray(np.arange(100),name='x Axis',units = 'mm')
+plt.figure()
+ax1 = plt.subplot(211)
+A.stackedAreaPlot(x=x, axis=1)
+plt.subplot(212, sharex=ax1)
+_ = A.stackedAreaPlot(x=x, i=np.s_[[1,3,4],:], axis=1, labels=['a','b','c'])
+
+plt.show()
+
+
+plot StatArray

Total running time of the script: (0 minutes 3.186 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/plot_histogram_1d.html b/docs/examples/Statistics/plot_histogram_1d.html new file mode 100644 index 00000000..0e78f45d --- /dev/null +++ b/docs/examples/Statistics/plot_histogram_1d.html @@ -0,0 +1,360 @@ + + + + + + + Histogram 1D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Histogram 1D

+

This histogram class allows efficient updating of histograms, plotting and +saving as HDF5

+
from geobipy.src.classes.mesh.RectilinearMesh1D import RectilinearMesh1D
+import h5py
+from geobipy import StatArray
+from geobipy import Histogram
+import numpy as np
+import matplotlib.pyplot as plt
+
+
+
+

Histogram with regular bins

+
# Create regularly spaced bins
+mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm'))
+
+
+

Set the histogram using the bins, and update

+
H = Histogram(mesh=mesh)
+
+
+

We can update the histogram with some new values

+
H.update(np.random.randn(1000), trim=True)
+
+# Plot the histogram
+plt.figure()
+plt.subplot(221)
+_ = H.plot()
+plt.subplot(222)
+_ = H.pdf.bar()
+plt.subplot(223)
+H.pmf.bar()
+plt.subplot(224)
+H.cdf().bar()
+
+
+plot histogram 1d
<Axes: xlabel='bins (m)', ylabel='Cumulative Density Function'>
+
+
+

Get the median, and 95% confidence values

+
print(H.credible_intervals(percent=95.0))
+
+plt.figure()
+H.plot()
+H.plotCredibleIntervals()
+H.plotMean()
+H.plotMedian()
+
+
+plot histogram 1d
(-0.030000000000000027, -1.95, 1.9499999999999997)
+
+
+
+
+

Histogram with irregular bins

+
# Create irregularly spaced bins
+x = np.cumsum(np.arange(10, dtype=np.float64))
+irregularBins = np.hstack([-x[::-1], x[1:]])
+
+
+

Create a named StatArray

+
edges = StatArray(irregularBins, 'irregular bins')
+mesh = RectilinearMesh1D(edges = edges)
+
+
+

Instantiate the histogram with bin edges

+
H = Histogram(mesh=mesh)
+
+# Update the histogram
+H.update((np.random.randn(10000)*20.0) - 10.0)
+
+
+

Plot the histogram

+
plt.figure()
+plt.subplot(211)
+_ = H.plot()
+plt.subplot(212)
+_ = H.plot(normalize=True)
+
+plt.figure()
+H.plot()
+H.plotCredibleIntervals()
+H.plotMean()
+H.plotMedian()
+
+
+
    +
  • plot histogram 1d
  • +
  • plot histogram 1d
  • +
+

We can plot the histogram as a pcolor plot

+
plt.figure()
+_ = H.pcolor(grid=True, transpose=True)
+
+
+plot histogram 1d
+
+

Histogram with linear space entries that are logged internally

+

Create some bins spaced logarithmically

+
mesh = RectilinearMesh1D(edges = StatArray(np.logspace(-5, 3), 'positive bins'), log=10)
+
+
+

Instantiate the Histogram with log=10

+
H = Histogram(mesh)
+
+
+

The update takes in the numbers in linear space and takes their log=10

+
H.update(10.0**(np.random.randn(1000)*2.0), trim=True)
+
+
+
plt.figure()
+plt.subplot(211)
+_ = H.plot()
+
+import h5py
+with h5py.File('h1d.h5', 'w') as f:
+    H.toHdf(f, 'h1d')
+
+with h5py.File('h1d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h1d'])
+
+plt.subplot(212)
+_ = H1.plot()
+
+
+plot histogram 1d
mesh = RectilinearMesh1D(edges=StatArray(np.linspace(-3.0, 3.0, 101), 'bins', 'm'))
+
+
+

Set the histogram using the bins, and update

+
H = Histogram(mesh=mesh)
+
+
+

We can update the histogram with some new values

+
H.update(np.random.randn(1000), trim=True)
+
+import h5py
+with h5py.File('h1d.h5', 'w') as f:
+    H.createHdf(f, 'h1d', add_axis=StatArray(np.arange(3.0), "Name", "Units"))
+    H.writeHdf(f, 'h1d', index=0)
+    H.update(np.random.randn(1000), trim=True)
+    H.writeHdf(f, 'h1d', index=1)
+    H.update(np.random.randn(1000), trim=True)
+    H.writeHdf(f, 'h1d', index=2)
+
+with h5py.File('h1d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h1d'])
+    H2 = Histogram.fromHdf(f['h1d'], index=0)
+    H3 = Histogram.fromHdf(f['h1d'], index=1)
+    H4 = Histogram.fromHdf(f['h1d'], index=2)
+
+
+print(H4.summary)
+
+# plt.figure()
+# plt.subplot(211)
+# _ = H1.plot()
+# plt.subplot(212)
+# _ = H4.plot()
+
+plt.show()
+
+
+
Histogram:
+mesh:
+|   RectilinearMesh1D
+|   Number of Cells:
+|   |   100
+|   Cell Centres:
+|   |   Name: bins (m) 0x7fbfa200e340
+|   |   Shape: (100,)
+|   |   Values: [-2.97 -2.91 -2.85 ...  2.85  2.91  2.97]
+|   |   Min: -2.9699999999999998
+|   |   Max: 2.9699999999999998
+|   |   has_posterior: False
+|
+|   Cell Edges:
+|   |   Name: bins (m) 0x7fbfa200d6c0
+|   |   Shape: (101,)
+|   |   Values: [-3.   -2.94 -2.88 ...  2.88  2.94  3.  ]
+|   |   Min: -3.0
+|   |   Max: 3.0
+|   |   has_posterior: False
+|
+|   log:
+|   |   None
+|   relativeTo:
+|   |   Name:  0x7fbfa1fb06c0
+|   |   Shape: (1,)
+|   |   Values: [0.]
+|   |   Min: 0.0
+|   |   Max: 0.0
+|   |   has_posterior: False
+|
+values:
+|   Name: Frequency 0x7fbfa200f2c0
+|   Shape: (100,)
+|   Values: [3 2 3 ... 0 2 1]
+|   Min: 0
+|   Max: 87
+|   has_posterior: False
+
+
+

Total running time of the script: (0 minutes 1.293 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/plot_histogram_2d.html b/docs/examples/Statistics/plot_histogram_2d.html new file mode 100644 index 00000000..d22303fb --- /dev/null +++ b/docs/examples/Statistics/plot_histogram_2d.html @@ -0,0 +1,485 @@ + + + + + + + Histogram 2D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Histogram 2D

+

This 2D histogram class allows efficient updating of histograms, plotting and +saving as HDF5.

+
import h5py
+import geobipy
+from geobipy import StatArray
+from geobipy import Histogram
+import matplotlib.pyplot as plt
+import matplotlib.gridspec as gridspec
+from geobipy import RectilinearMesh2D
+import numpy as np
+
+
+

Create some histogram bins in x and y

+
x = StatArray(np.linspace(-4.0, 4.0, 100), 'Variable 1')
+y = StatArray(np.linspace(-4.0, 4.0, 105), 'Variable 2')
+
+mesh = RectilinearMesh2D(x_edges=x, y_edges=y)
+
+
+

Instantiate

+
H = Histogram(mesh)
+
+
+

Generate some random numbers

+
a = np.random.randn(1000000)
+b = np.random.randn(1000000)
+
+
+

Update the histogram counts

+
H.update(a, b)
+
+
+
plt.figure()
+plt.subplot(131)
+plt.title("2D Histogram")
+_ = H.plot(cmap='gray_r')
+plt.subplot(132)
+H.pdf.plot(cmap='gray_r')
+plt.subplot(133)
+H.pmf.plot(cmap='gray_r')
+
+
+plt.figure()
+plt.subplot(131)
+H.cdf(axis=0).plot()
+plt.subplot(132)
+H.cdf(axis=1).plot()
+plt.subplot(133)
+H.cdf().plot()
+
+
+
    +
  • 2D Histogram
  • +
  • plot histogram 2d
  • +
+
(<Axes: xlabel='Variable 1', ylabel='Variable 2'>, <matplotlib.collections.QuadMesh object at 0x7fbf619a2110>, <matplotlib.colorbar.Colorbar object at 0x7fbf619a2680>)
+
+
+

We can overlay the histogram with its credible intervals

+
plt.figure()
+plt.title("90% credible intervals overlain")
+H.pcolor(cmap='gray_r')
+H.plotCredibleIntervals(axis=0, percent=95.0)
+_ = H.plotCredibleIntervals(axis=1, percent=95.0)
+
+
+90% credible intervals overlain

Generate marginal histograms along an axis

+
h1 = H.marginalize(axis=0)
+h2 = H.marginalize(axis=1)
+
+
+

Note that the names of the variables are automatically displayed

+
plt.figure()
+plt.suptitle("Marginals along each axis")
+plt.subplot(121)
+h1.plot()
+plt.subplot(122)
+_ = h2.plot()
+
+
+Marginals along each axis

Create a combination plot with marginal histograms. +sphinx_gallery_thumbnail_number = 3

+
plt.figure()
+gs = gridspec.GridSpec(5, 5)
+gs.update(wspace=0.3, hspace=0.3)
+ax = [plt.subplot(gs[1:, :4])]
+H.pcolor(colorbar = False)
+
+ax.append(plt.subplot(gs[:1, :4]))
+h = H.marginalize(axis=0).plot()
+plt.xlabel(''); plt.ylabel('')
+plt.xticks([]); plt.yticks([])
+ax[-1].spines["left"].set_visible(False)
+
+ax.append(plt.subplot(gs[1:, 4:]))
+h = H.marginalize(axis=1).plot(transpose=True)
+plt.ylabel(''); plt.xlabel('')
+plt.yticks([]); plt.xticks([])
+ax[-1].spines["bottom"].set_visible(False)
+
+
+plot histogram 2d

Take the mean or median estimates from the histogram

+
mean = H.mean()
+median = H.median()
+
+
+
plt.figure(figsize=(9.5, 5))
+plt.suptitle("Mean, median, and credible interval overlain")
+ax = plt.subplot(121)
+H.pcolor(cmap='gray_r', colorbar=False)
+H.plotCredibleIntervals(axis=0)
+H.plotMedian(axis=0, color='g')
+H.plotMean(axis=0, color='y')
+plt.legend()
+
+plt.subplot(122, sharex=ax, sharey=ax)
+H.pcolor(cmap='gray_r', colorbar=False)
+H.plotCredibleIntervals(axis=1)
+H.plotMedian(axis=1, color='g')
+H.plotMean(axis=1, color='y')
+plt.legend()
+
+
+Mean, median, and credible interval overlain
<matplotlib.legend.Legend object at 0x7fbf71b42410>
+
+
+

Get the range between credible intervals

+
H.credible_range(percent=95.0)
+
+
+
StatArray([5.25252525, 4.04040404, 3.23232323, ..., 4.76767677,
+           3.7979798 , 3.39393939])
+
+
+

We can map the credible range to an opacity or transparency

+
H.opacity()
+H.transparency()
+
+# H.animate(0, 'test.mp4')
+
+import h5py
+with h5py.File('h2d.h5', 'w') as f:
+    H.toHdf(f, 'h2d')
+
+with h5py.File('h2d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h2d'])
+
+plt.close('all')
+
+x = StatArray(5.0 + np.linspace(-4.0, 4.0, 100), 'Variable 1')
+y = StatArray(10.0 + np.linspace(-4.0, 4.0, 105), 'Variable 2')
+
+mesh = RectilinearMesh2D(x_edges=x, x_relative_to=5.0, y_edges=y, y_relative_to=10.0)
+
+
+

Instantiate

+
H = Histogram(mesh)
+
+
+

Generate some random numbers

+
a = np.random.randn(1000000) + 5.0
+b = np.random.randn(1000000) + 10.0
+
+
+

Update the histogram counts

+
H.update(a, b)
+
+
+
plt.figure()
+plt.subplot(131)
+plt.title("2D Histogram")
+_ = H.plot(cmap='gray_r')
+plt.subplot(132)
+H.pdf.plot(cmap='gray_r')
+plt.subplot(133)
+H.pmf.plot(cmap='gray_r')
+
+plt.figure()
+plt.subplot(131)
+H.cdf(axis=0).plot()
+plt.subplot(132)
+H.cdf(axis=1).plot()
+plt.subplot(133)
+H.cdf().plot()
+
+
+
    +
  • 2D Histogram
  • +
  • plot histogram 2d
  • +
+
(<Axes: xlabel='Variable 1', ylabel='Variable 2'>, <matplotlib.collections.QuadMesh object at 0x7fbfa24cac80>, <matplotlib.colorbar.Colorbar object at 0x7fbfa24c9b70>)
+
+
+

We can overlay the histogram with its credible intervals

+
plt.figure()
+plt.title("90% credible intervals overlain")
+H.pcolor(cmap='gray_r')
+H.plotCredibleIntervals(axis=0, percent=95.0)
+_ = H.plotCredibleIntervals(axis=1, percent=95.0)
+
+# Generate marginal histograms along an axis
+h1 = H.marginalize(axis=0)
+h2 = H.marginalize(axis=1)
+
+
+90% credible intervals overlain

Note that the names of the variables are automatically displayed

+
plt.figure()
+plt.suptitle("Marginals along each axis")
+plt.subplot(121)
+h1.plot()
+plt.subplot(122)
+_ = h2.plot()
+
+
+Marginals along each axis

Create a combination plot with marginal histograms. +sphinx_gallery_thumbnail_number = 3

+
plt.figure()
+gs = gridspec.GridSpec(5, 5)
+gs.update(wspace=0.3, hspace=0.3)
+ax = [plt.subplot(gs[1:, :4])]
+H.pcolor(colorbar = False)
+
+ax.append(plt.subplot(gs[:1, :4]))
+h = H.marginalize(axis=0).plot()
+plt.xlabel(''); plt.ylabel('')
+plt.xticks([]); plt.yticks([])
+ax[-1].spines["left"].set_visible(False)
+
+ax.append(plt.subplot(gs[1:, 4:]))
+h = H.marginalize(axis=1).plot(transpose=True)
+plt.ylabel(''); plt.xlabel('')
+plt.yticks([]); plt.xticks([])
+ax[-1].spines["bottom"].set_visible(False)
+
+
+plot histogram 2d

Take the mean or median estimates from the histogram

+
mean = H.mean()
+median = H.median()
+
+
+
plt.figure(figsize=(9.5, 5))
+plt.suptitle("Mean, median, and credible interval overlain")
+ax = plt.subplot(121)
+H.pcolor(cmap='gray_r', colorbar=False)
+H.plotCredibleIntervals(axis=0)
+H.plotMedian(axis=0, color='g')
+H.plotMean(axis=0, color='y')
+plt.legend()
+
+plt.subplot(122, sharex=ax, sharey=ax)
+H.pcolor(cmap='gray_r', colorbar=False)
+H.plotCredibleIntervals(axis=1)
+H.plotMedian(axis=1, color='g')
+H.plotMean(axis=1, color='y')
+plt.legend()
+
+
+Mean, median, and credible interval overlain
<matplotlib.legend.Legend object at 0x7fbf53b9a650>
+
+
+

Get the range between credible intervals

+
H.credible_range(percent=95.0)
+
+
+
StatArray([3.39393939, 4.04040404, 3.31313131, ..., 3.95959596,
+           3.23232323, 3.31313131])
+
+
+

We can map the credible range to an opacity or transparency

+
H.opacity()
+H.transparency()
+
+# # H.animate(0, 'test.mp4')
+
+with h5py.File('h2d.h5', 'w') as f:
+    H.toHdf(f, 'h2d')
+
+with h5py.File('h2d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h2d'])
+
+plt.figure(figsize=(9.5, 5))
+plt.suptitle("Mean, median, and credible interval overlain")
+ax = plt.subplot(121)
+H1.pcolor(cmap='gray_r', colorbar=False)
+H1.plotCredibleIntervals(axis=0)
+H1.plotMedian(axis=0, color='g')
+H1.plotMean(axis=0, color='y')
+plt.legend()
+
+plt.subplot(122, sharex=ax, sharey=ax)
+H1.pcolor(cmap='gray_r', colorbar=False)
+H1.plotCredibleIntervals(axis=1)
+H1.plotMedian(axis=1, color='g')
+H1.plotMean(axis=1, color='y')
+plt.legend()
+
+with h5py.File('h2d.h5', 'w') as f:
+    H.createHdf(f, 'h2d', add_axis=StatArray(np.arange(3.0), name='Easting', units="m"))
+    for i in range(3):
+        H.writeHdf(f, 'h2d', index=i)
+
+with h5py.File('h2d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h2d'], index=0)
+
+plt.figure(figsize=(9.5, 5))
+plt.suptitle("Mean, median, and credible interval overlain")
+ax = plt.subplot(121)
+H1.pcolor(cmap='gray_r', colorbar=False)
+H1.plotCredibleIntervals(axis=0)
+H1.plotMedian(axis=0, color='g')
+H1.plotMean(axis=0, color='y')
+plt.legend()
+
+plt.subplot(122, sharex=ax, sharey=ax)
+H1.pcolor(cmap='gray_r', colorbar=False)
+H1.plotCredibleIntervals(axis=1)
+H1.plotMedian(axis=1, color='g')
+H1.plotMean(axis=1, color='y')
+plt.legend()
+
+with h5py.File('h2d.h5', 'r') as f:
+    H1 = Histogram.fromHdf(f['h2d'])
+
+H1.pyvista_mesh().save('h3d_read.vtk')
+
+plt.show()
+
+
+
    +
  • Mean, median, and credible interval overlain
  • +
  • Mean, median, and credible interval overlain
  • +
+

Total running time of the script: (0 minutes 14.930 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/plot_histogram_3d.html b/docs/examples/Statistics/plot_histogram_3d.html new file mode 100644 index 00000000..d130c3c1 --- /dev/null +++ b/docs/examples/Statistics/plot_histogram_3d.html @@ -0,0 +1,308 @@ + + + + + + + Histogram 3D — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + +
+

Histogram 3D

+

This 3D histogram class allows efficient updating of histograms, plotting and +saving as HDF5.

+
import geobipy
+from geobipy import StatArray
+from geobipy import Histogram
+import matplotlib.pyplot as plt
+from geobipy import RectilinearMesh3D
+import numpy as np
+
+
+

Create some histogram bins in x and y

+
x = StatArray(np.linspace(-4.0, 4.0, 11), 'Variable 1')
+y = StatArray(np.linspace(-4.0, 4.0, 21), 'Variable 2')
+z = StatArray(np.linspace(-4.0, 4.0, 31), 'Variable 3')
+
+mesh = RectilinearMesh3D(x_edges=x, y_edges=y, z_edges=z)
+
+
+

Instantiate

+
H = Histogram(mesh=mesh)
+
+
+

Generate some random numbers

+
a = np.random.randn(100000)
+b = np.random.randn(100000)
+c = np.random.randn(100000)
+# x = np.asarray([a, b, c])
+
+
+

Update the histogram counts

+
H.update(a, b, c)
+
+
+
plt.figure()
+plt.suptitle("Slice half way along each dimension")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    s = [5 if i  == axis else np.s_[:] for i in range(3)]
+    _ = H[tuple(s)].pcolor(cmap='gray_r')
+
+
+Slice half way along each dimension

Generate marginal histograms along an axis

+
plt.figure()
+plt.suptitle("Marginals along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.marginalize(axis=axis).plot()
+
+
+Marginals along each axis

Take the mean estimate from the histogram

+
plt.figure()
+plt.suptitle("Mean along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.mean(axis=axis).pcolor()
+
+
+Mean along each axis

Take the median estimate from the histogram

+
plt.figure()
+plt.suptitle("Median along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.median(axis=axis).pcolor()
+
+# #%%
+# # We can map the credible range to an opacity or transparency
+# H.opacity()
+# H.transparency()
+
+H.animate(0, 'test.mp4')
+
+H.to_vtk('h3d.vtk')
+
+
+
+
+# Create some histogram bins in x and y
+xx, yy = np.meshgrid(mesh.z.centres, mesh.y.centres)
+x_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "x_re")
+
+xx, yy = np.meshgrid(mesh.z.centres, mesh.x.centres)
+y_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "y_re")
+
+xx, yy = np.meshgrid(mesh.y.centres, mesh.x.centres)
+z_re = StatArray(np.sin(np.sqrt(xx ** 2.0 + yy ** 2.0)), "z_re")
+
+mesh = RectilinearMesh3D(x_edges=x, x_relative_to=x_re, y_edges=y, y_relative_to=y_re, z_edges=z, z_relative_to=z_re)
+
+
+
    +
  • Median along each axis
  • +
  • 3.60
  • +
+

Instantiate

+
H = Histogram(mesh=mesh)
+
+
+

Generate some random numbers

+
a = np.random.randn(100000)
+b = np.random.randn(100000)
+c = np.random.randn(100000)
+# x = np.asarray([a, b, c])
+
+
+

Update the histogram counts

+
H.update(a, b, c)
+
+
+
plt.figure()
+plt.suptitle("Slice half way along each dimension")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    s = [5 if i  == axis else np.s_[:] for i in range(3)]
+    _ = H[tuple(s)].pcolor(cmap='gray_r')
+
+
+Slice half way along each dimension

Generate marginal histograms along an axis

+
plt.figure()
+plt.suptitle("Marginals along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.marginalize(axis=axis).plot()
+
+
+Marginals along each axis

Take the mean estimate from the histogram

+
plt.figure()
+plt.suptitle("Mean along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.mean(axis=axis).pcolor()
+
+
+Mean along each axis

Take the median estimate from the histogram

+
plt.figure()
+plt.suptitle("Median along each axis")
+for axis in range(3):
+    plt.subplot(1, 3, axis+1)
+    _ = H.median(axis=axis).pcolor()
+
+# #%%
+# # We can map the credible range to an opacity or transparency
+# H.opacity()
+# H.transparency()
+
+H.animate(0, 'test.mp4')
+
+plt.show()
+
+H.to_vtk('h3d.vtk')
+
+
+
    +
  • Median along each axis
  • +
  • 3.60
  • +
+

Total running time of the script: (0 minutes 8.325 seconds)

+ +

Gallery generated by Sphinx-Gallery

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/Statistics/sg_execution_times.html b/docs/examples/Statistics/sg_execution_times.html new file mode 100644 index 00000000..436f4844 --- /dev/null +++ b/docs/examples/Statistics/sg_execution_times.html @@ -0,0 +1,155 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:27.735 total execution time for 4 files from examples/Statistics:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Histogram 2D (plot_histogram_2d.py)

00:14.930

0.0

Histogram 3D (plot_histogram_3d.py)

00:08.325

0.0

StatArray Class (plot_StatArray.py)

00:03.186

0.0

Histogram 1D (plot_histogram_1d.py)

00:01.293

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/index.html b/docs/examples/index.html new file mode 100644 index 00000000..8b4464d1 --- /dev/null +++ b/docs/examples/index.html @@ -0,0 +1,291 @@ + + + + + + + Examples — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Examples

+
+

Distributions

+
+

Distribution Class

+
Distribution Class
+
+
+
+
+

Statistics

+
+

Histogram 1D

+
Histogram 1D
+
+

Histogram 2D

+
Histogram 2D
+
+

Histogram 3D

+
Histogram 3D
+
+

StatArray Class

+
StatArray Class
+
+
+
+
+

Meshes

+
+

1D Rectilinear Mesh

+
1D Rectilinear Mesh
+
+

2D Rectilinear Mesh

+
2D Rectilinear Mesh
+
+

3D Rectilinear Mesh

+
3D Rectilinear Mesh
+
+
+
+
+

Models

+
+

1D Model with an infinite halfspace

+
1D Model with an infinite halfspace
+
+

2D Rectilinear Model

+
2D Rectilinear Model
+
+

3D Rectilinear Model

+
3D Rectilinear Model
+
+
+
+
+

Data

+
+
+

Datapoints

+
+

Frequency domain datapoint

+
Frequency domain datapoint
+
+

Skytem Datapoint Class

+
Skytem Datapoint Class
+
+

Tempest Datapoint Class

+
Tempest Datapoint Class
+
+
+
+
+

1D Inference

+

There are a couple of ways to run an inference using geobipy, the first is via command line using

+
geobipy skytem_options.py <output folder>
+
+
+

The other is with a python script similar to the examples in this folder. +In both cases, you will need to write an options file (also shown in these examples)

+
+

Running GeoBIPy to invert Resolve data

+
Running GeoBIPy to invert Resolve data
+
+

Running GeoBIPy to invert Skytem data

+
Running GeoBIPy to invert Skytem data
+
+

Running GeoBIPy to invert Tempest data

+
Running GeoBIPy to invert Tempest data
+
+
+
+
+

Inference 2D

+
+

2D Posterior analysis of Resolve inference

+
2D Posterior analysis of Resolve inference
+
+

2D Posterior analysis of Skytem inference

+
2D Posterior analysis of Skytem inference
+
+

2D Posterior analysis of Tempest inference

+
2D Posterior analysis of Tempest inference
+
+
+
+
+

HDF 5

+
+

Using HDF5 within GeoBIPy

+
Using HDF5 within GeoBIPy
+
+
+ +

Gallery generated by Sphinx-Gallery

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/examples/sg_execution_times.html b/docs/examples/sg_execution_times.html new file mode 100644 index 00000000..3b020b2e --- /dev/null +++ b/docs/examples/sg_execution_times.html @@ -0,0 +1,143 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from examples:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/genindex.html b/docs/genindex.html new file mode 100644 index 00000000..3bde88f3 --- /dev/null +++ b/docs/genindex.html @@ -0,0 +1,1845 @@ + + + + + + Index — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + +

Index

+ +
+ A + | B + | C + | D + | E + | F + | G + | H + | I + | K + | L + | M + | N + | O + | P + | R + | S + | T + | U + | V + | W + | X + | Y + | Z + +
+

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

K

+ + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + +
+ +

X

+ + + +
+ +

Y

+ + + +
+ +

Z

+ + +
+ + + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..508fb704 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,159 @@ + + + + + + + Welcome to GeoBIPy: Geophysical Bayesian Inference in Python — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • + View page source +
  • +
+
+
+
+
+ +
+

Welcome to GeoBIPy: Geophysical Bayesian Inference in Python

+

This package uses a Bayesian formulation and Markov chain Monte Carlo sampling methods to +derive posterior distributions of subsurface and measured data properties. +The current implementation is applied to time and frequency domain electromagnetic data. +Application outside of these data types is in development.

+

Currently there are two types of data that we have implemented; frequency domain electromagnetic data, +and time domain electromagnetic data. +The package comes with a frequency domain forward modeller, but it does not come with a time domain forward modeller. +See the section Installing the time domain forward modeller for more information.

+
+

Using GeoBIPy on Yeti

+

There is no need to install GeoBIPy on Yeti. +Simply type “module load python/geobipy” for the serial version of the code, mainly used for plotting results, +or “module load python/pGeobipy” for a parallel enabled version.

+

Codebase is here!

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv new file mode 100644 index 00000000..91d696c5 Binary files /dev/null and b/docs/objects.inv differ diff --git a/docs/py-modindex.html b/docs/py-modindex.html new file mode 100644 index 00000000..d32a089a --- /dev/null +++ b/docs/py-modindex.html @@ -0,0 +1,311 @@ + + + + + + Python Module Index — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + +

Python Module Index

+ +
+ g +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ g
+ geobipy +
    + geobipy.src.base.fileIO +
    + geobipy.src.base.HDF.hdfRead +
    + geobipy.src.base.HDF.hdfWrite +
    + geobipy.src.base.interpolation +
    + geobipy.src.base.MPI +
    + geobipy.src.base.plotting +
    + geobipy.src.base.utilities +
    + geobipy.src.classes.core.myObject +
    + geobipy.src.classes.core.StatArray +
    + geobipy.src.classes.data.datapoint.DataPoint +
    + geobipy.src.classes.data.datapoint.EmDataPoint +
    + geobipy.src.classes.data.datapoint.FdemDataPoint +
    + geobipy.src.classes.data.datapoint.TdemDataPoint +
    + geobipy.src.classes.data.datapoint.Tempest_datapoint +
    + geobipy.src.classes.data.dataset.Data +
    + geobipy.src.classes.data.dataset.FdemData +
    + geobipy.src.classes.data.dataset.TdemData +
    + geobipy.src.classes.data.dataset.TempestData +
    + geobipy.src.classes.mesh.RectilinearMesh1D +
    + geobipy.src.classes.mesh.RectilinearMesh2D +
    + geobipy.src.classes.mesh.RectilinearMesh2D_stitched +
    + geobipy.src.classes.mesh.RectilinearMesh3D +
    + geobipy.src.classes.model.Model +
    + geobipy.src.classes.pointcloud.Point +
    + geobipy.src.classes.statistics.baseDistribution +
    + geobipy.src.classes.statistics.Distribution +
    + geobipy.src.classes.statistics.GammaDistribution +
    + geobipy.src.classes.statistics.Histogram +
    + geobipy.src.classes.statistics.MvNormalDistribution +
    + geobipy.src.classes.statistics.NormalDistribution +
    + geobipy.src.classes.statistics.OrderStatistics +
    + geobipy.src.classes.statistics.UniformDistribution +
    + geobipy.src.classes.system.CircularLoop +
    + geobipy.src.classes.system.EmLoop +
    + geobipy.src.classes.system.FdemSystem +
    + geobipy.src.classes.system.TdemSystem +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/search.html b/docs/search.html new file mode 100644 index 00000000..ee292ebf --- /dev/null +++ b/docs/search.html @@ -0,0 +1,131 @@ + + + + + + Search — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + + + +
+ +
+ +
+
+ +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js new file mode 100644 index 00000000..4b96e944 --- /dev/null +++ b/docs/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["content/api/api", "content/api/base/HDF", "content/api/base/MPI", "content/api/base/base", "content/api/base/fileIO", "content/api/base/interpolation", "content/api/base/plotting", "content/api/base/utilities", "content/api/classes/classes", "content/api/classes/core/StatArray", "content/api/classes/core/core", "content/api/classes/core/myObject", "content/api/classes/data/data", "content/api/classes/data/datapoint/EmDataPoint", "content/api/classes/data/datapoint/FdemDataPoint", "content/api/classes/data/datapoint/TdemDataPoint", "content/api/classes/data/datapoint/Tempest_dataPoint", "content/api/classes/data/datapoint/datapoint", "content/api/classes/data/datapoint/datapointrst", "content/api/classes/data/dataset/Data", "content/api/classes/data/dataset/FdemData", "content/api/classes/data/dataset/TdemData", "content/api/classes/data/dataset/TempestData", "content/api/classes/data/dataset/dataset", "content/api/classes/mesh/RectilinearMesh1D", "content/api/classes/mesh/RectilinearMesh2D", "content/api/classes/mesh/RectilinearMesh2D_stitched", "content/api/classes/mesh/RectilinearMesh3D", "content/api/classes/mesh/mesh", "content/api/classes/model/Model_", "content/api/classes/model/model", "content/api/classes/pointcloud/Point", "content/api/classes/pointcloud/pointcloud", "content/api/classes/statistics/Distribution", "content/api/classes/statistics/GammaDistribution", "content/api/classes/statistics/Histogram", "content/api/classes/statistics/MvNormalDistribution", "content/api/classes/statistics/NormalDistribution", "content/api/classes/statistics/OrderStatistics", "content/api/classes/statistics/UniformDistribution", "content/api/classes/statistics/baseDistribution", "content/api/classes/statistics/statistics", "content/api/classes/system/CircularLoop", "content/api/classes/system/EmLoop", "content/api/classes/system/FdemSystem", "content/api/classes/system/TdemSystem", "content/api/classes/system/system", "content/getting_started/getting_started", "content/getting_started/installation", "content/getting_started/running_geobipy", "examples/Data/readme", "examples/Data/sg_execution_times", "examples/Datapoints/plot_resolve_datapoint", "examples/Datapoints/plot_skytem_datapoint", "examples/Datapoints/plot_tempest_datapoint", "examples/Datapoints/readme", "examples/Datapoints/sg_execution_times", "examples/Distributions/plot_distributions", "examples/Distributions/readme", "examples/Distributions/sg_execution_times", "examples/HDF5/hdf5", "examples/HDF5/readme", "examples/HDF5/sg_execution_times", "examples/Inference_1D/plot_inference_1d_resolve", "examples/Inference_1D/plot_inference_1d_skytem", "examples/Inference_1D/plot_inference_1d_tempest", "examples/Inference_1D/readme", "examples/Inference_1D/sg_execution_times", "examples/Inference_2D/plot_inference_2d_resolve", "examples/Inference_2D/plot_inference_2d_skytem", "examples/Inference_2D/plot_inference_2d_tempest", "examples/Inference_2D/readme", "examples/Inference_2D/sg_execution_times", "examples/Meshes/plot_rectilinear_mesh_1d", "examples/Meshes/plot_rectilinear_mesh_2d", "examples/Meshes/plot_rectilinear_mesh_3d", "examples/Meshes/readme", "examples/Meshes/sg_execution_times", "examples/Models/plot_model_1d", "examples/Models/plot_model_2d", "examples/Models/plot_model_3d", "examples/Models/readme", "examples/Models/sg_execution_times", "examples/Statistics/plot_StatArray", "examples/Statistics/plot_histogram_1d", "examples/Statistics/plot_histogram_2d", "examples/Statistics/plot_histogram_3d", "examples/Statistics/readme", "examples/Statistics/sg_execution_times", "examples/index", "examples/readme", "examples/sg_execution_times", "index", "sg_execution_times"], "filenames": ["content/api/api.rst", "content/api/base/HDF.rst", "content/api/base/MPI.rst", "content/api/base/base.rst", "content/api/base/fileIO.rst", "content/api/base/interpolation.rst", "content/api/base/plotting.rst", "content/api/base/utilities.rst", "content/api/classes/classes.rst", "content/api/classes/core/StatArray.rst", "content/api/classes/core/core.rst", "content/api/classes/core/myObject.rst", "content/api/classes/data/data.rst", "content/api/classes/data/datapoint/EmDataPoint.rst", "content/api/classes/data/datapoint/FdemDataPoint.rst", "content/api/classes/data/datapoint/TdemDataPoint.rst", "content/api/classes/data/datapoint/Tempest_dataPoint.rst", "content/api/classes/data/datapoint/datapoint.rst", "content/api/classes/data/datapoint/datapointrst.rst", "content/api/classes/data/dataset/Data.rst", "content/api/classes/data/dataset/FdemData.rst", "content/api/classes/data/dataset/TdemData.rst", "content/api/classes/data/dataset/TempestData.rst", "content/api/classes/data/dataset/dataset.rst", "content/api/classes/mesh/RectilinearMesh1D.rst", "content/api/classes/mesh/RectilinearMesh2D.rst", "content/api/classes/mesh/RectilinearMesh2D_stitched.rst", "content/api/classes/mesh/RectilinearMesh3D.rst", "content/api/classes/mesh/mesh.rst", "content/api/classes/model/Model_.rst", "content/api/classes/model/model.rst", "content/api/classes/pointcloud/Point.rst", "content/api/classes/pointcloud/pointcloud.rst", "content/api/classes/statistics/Distribution.rst", "content/api/classes/statistics/GammaDistribution.rst", "content/api/classes/statistics/Histogram.rst", "content/api/classes/statistics/MvNormalDistribution.rst", "content/api/classes/statistics/NormalDistribution.rst", "content/api/classes/statistics/OrderStatistics.rst", "content/api/classes/statistics/UniformDistribution.rst", "content/api/classes/statistics/baseDistribution.rst", "content/api/classes/statistics/statistics.rst", "content/api/classes/system/CircularLoop.rst", "content/api/classes/system/EmLoop.rst", "content/api/classes/system/FdemSystem.rst", "content/api/classes/system/TdemSystem.rst", "content/api/classes/system/system.rst", "content/getting_started/getting_started.rst", "content/getting_started/installation.rst", "content/getting_started/running_geobipy.rst", "examples/Data/readme.rst", "examples/Data/sg_execution_times.rst", "examples/Datapoints/plot_resolve_datapoint.rst", "examples/Datapoints/plot_skytem_datapoint.rst", "examples/Datapoints/plot_tempest_datapoint.rst", "examples/Datapoints/readme.rst", "examples/Datapoints/sg_execution_times.rst", "examples/Distributions/plot_distributions.rst", "examples/Distributions/readme.rst", "examples/Distributions/sg_execution_times.rst", "examples/HDF5/hdf5.rst", "examples/HDF5/readme.rst", "examples/HDF5/sg_execution_times.rst", "examples/Inference_1D/plot_inference_1d_resolve.rst", "examples/Inference_1D/plot_inference_1d_skytem.rst", "examples/Inference_1D/plot_inference_1d_tempest.rst", "examples/Inference_1D/readme.rst", "examples/Inference_1D/sg_execution_times.rst", "examples/Inference_2D/plot_inference_2d_resolve.rst", "examples/Inference_2D/plot_inference_2d_skytem.rst", "examples/Inference_2D/plot_inference_2d_tempest.rst", "examples/Inference_2D/readme.rst", "examples/Inference_2D/sg_execution_times.rst", "examples/Meshes/plot_rectilinear_mesh_1d.rst", "examples/Meshes/plot_rectilinear_mesh_2d.rst", "examples/Meshes/plot_rectilinear_mesh_3d.rst", "examples/Meshes/readme.rst", "examples/Meshes/sg_execution_times.rst", "examples/Models/plot_model_1d.rst", "examples/Models/plot_model_2d.rst", "examples/Models/plot_model_3d.rst", "examples/Models/readme.rst", "examples/Models/sg_execution_times.rst", "examples/Statistics/plot_StatArray.rst", "examples/Statistics/plot_histogram_1d.rst", "examples/Statistics/plot_histogram_2d.rst", "examples/Statistics/plot_histogram_3d.rst", "examples/Statistics/readme.rst", "examples/Statistics/sg_execution_times.rst", "examples/index.rst", "examples/readme.rst", "examples/sg_execution_times.rst", "index.rst", "sg_execution_times.rst"], "titles": ["API", "Heirarchical Data Format (HDF)", "MPI wrapper functions", "Core routines needed for GeoBIPy", "fileIO", "Interpolation", "plotting", "utilities", "Classes used in GeoBIPy", "StatArray", "Core classes", "Core object class", "Data classes", "EmDataPoint", "FdemDataPoint", "TdemDataPoint", "Tempest_datapoint", "DataPoint", "Datapoint classes", "Data", "FdemData", "TdemData", "TempestData", "Dataset classes", "RectilinearMesh1D", "RectilinearMesh2D", "RectilinearMesh2D_stitched", "RectilinearMesh3D", "Mesh classes", "Model", "Model classes", "Point", "Pointcloud classes", "Distribution Wrapper", "Gamma Distribution", "Histogram", "MvNormal", "Normal distribution", "Order Statistics", "Uniform distribution", "baseDistribution", "Statistics classes", "Circular Loop", "EmLoop", "Frequency domain system", "Time domain system", "System classes", "Getting Started", "Installing GeoBIPy", "Running GeoBIPy", "Data", "Computation times", "Frequency domain datapoint", "Skytem Datapoint Class", "Tempest Datapoint Class", "Datapoints", "Computation times", "Distribution Class", "Distributions", "Computation times", "Using HDF5 within GeoBIPy", "HDF 5", "Computation times", "Running GeoBIPy to invert Resolve data", "Running GeoBIPy to invert Skytem data", "Running GeoBIPy to invert Tempest data", "1D Inference", "Computation times", "2D Posterior analysis of Resolve inference", "2D Posterior analysis of Skytem inference", "2D Posterior analysis of Tempest inference", "Inference 2D", "Computation times", "1D Rectilinear Mesh", "2D Rectilinear Mesh", "3D Rectilinear Mesh", "Meshes", "Computation times", "1D Model with an infinite halfspace", "2D Rectilinear Model", "3D Rectilinear Model", "Models", "Computation times", "StatArray Class", "Histogram 1D", "Histogram 2D", "Histogram 3D", "Statistics", "Computation times", "Examples", "Examples", "Computation times", "Welcome to GeoBIPy: Geophysical Bayesian Inference in Python", "Computation times"], "terms": {"The": [0, 1, 2, 4, 6, 7, 9, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 43, 44, 45, 48, 49, 52, 53, 54, 60, 63, 64, 65, 66, 68, 69, 70, 74, 78, 83, 84, 89, 92], "sourc": [0, 2, 9, 48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "code": [0, 2, 9, 17, 35, 48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89, 92], "i": [0, 1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 43, 44, 48, 49, 52, 53, 54, 60, 63, 64, 65, 66, 68, 69, 70, 73, 74, 78, 83, 85, 86, 89, 92], "split": [0, 2, 4, 7, 60], "two": [0, 2, 7, 9, 17, 25, 27, 31, 44, 48, 49, 74, 83, 92], "type": [0, 1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 42, 43, 45, 48, 49, 53, 63, 64, 65, 69, 70, 83, 92], "file": [0, 1, 2, 4, 9, 11, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 42, 43, 44, 45, 48, 49, 51, 52, 54, 56, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 79, 80, 82, 83, 84, 85, 88, 89, 91, 93], "those": [0, 1, 9, 48, 52, 57, 73, 78, 83], "contain": [0, 2, 6, 7, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 27, 31, 35, 44, 48, 49, 53, 68, 69, 70, 83], "set": [0, 1, 6, 9, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 34, 35, 42, 43, 52, 53, 54, 73, 78, 83, 84], "python": [0, 6, 17, 35, 49, 52, 53, 54, 57, 60, 63, 64, 65, 66, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "function": [0, 1, 3, 6, 7, 9, 17, 25, 35, 39, 57, 60, 83, 84], "class": [0, 1, 2, 6, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 56, 59, 63, 64, 65, 68, 69, 70, 84, 85, 86, 88, 89, 92, 93], "core": [0, 2, 8, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 60, 92], "routin": [0, 2, 6, 9, 24, 25, 26, 29, 35, 60, 83, 92], "need": [0, 31, 48, 52, 53, 54, 60, 63, 64, 65, 66, 68, 69, 70, 83, 89, 92], "geobipi": [0, 1, 2, 4, 6, 7, 9, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 47, 52, 53, 54, 57, 62, 66, 67, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89, 93], "us": [0, 1, 2, 4, 6, 7, 9, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 29, 31, 33, 35, 36, 42, 43, 44, 48, 49, 52, 62, 63, 64, 65, 66, 68, 69, 70, 73, 78, 83, 84, 89, 93], "src": [1, 2, 4, 6, 7, 9, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 48, 53, 83, 84], "base": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 24, 25, 26, 29, 35, 40, 43, 48, 53, 54, 78, 83], "hdfread": 1, "find": [1, 7, 9, 24, 35, 48, 63, 64, 65], "filenam": [1, 4, 20, 31, 44, 63, 64, 65], "tag": 1, "locat": [1, 6, 7, 9, 15, 20, 24, 25, 27, 31, 35, 42, 44, 48, 52, 53, 78, 83], "all": [1, 2, 4, 6, 7, 9, 15, 16, 17, 19, 20, 21, 24, 25, 26, 29, 31, 35, 36, 39, 43, 48, 49, 52, 60, 68, 69, 70, 83, 85, 89, 93], "group": [1, 9, 11, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 31, 42, 43], "path": [1, 4, 14, 31, 48, 52, 53, 54, 63, 64, 65, 68, 69, 70], "paramet": [1, 2, 4, 6, 7, 9, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 42, 43, 45, 49, 52, 53, 54, 68, 69, 70, 73, 78], "str": [1, 2, 4, 6, 7, 9, 11, 14, 15, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 42, 45, 49, 63, 64, 65], "hdf5": [1, 49, 62, 63, 64, 65, 68, 69, 70, 73, 83, 84, 85, 86, 89, 93], "name": [1, 2, 4, 6, 7, 9, 11, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 31, 42, 43, 44, 49, 52, 53, 54, 60, 73, 74, 83, 84, 85], "sub": [1, 9], "string": [1, 2, 4, 7, 9, 25, 49, 53], "appear": 1, "return": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 42, 43, 45, 48, 63, 64, 65, 68, 69, 70, 83], "out": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 42, 43, 45, 48, 68, 69, 70, 83], "list": [1, 2, 4, 6, 9, 15, 16, 17, 19, 21, 22, 31, 44, 48, 49], "readkeyfromfil": 1, "h5obj": [1, 9, 11, 44], "fname": [1, 4, 9], "groupnam": 1, "kei": 1, "index": [1, 2, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 42, 43, 44, 52, 60, 63, 64, 65, 73, 74, 83, 84, 85], "none": [1, 2, 4, 6, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 39, 42, 43, 44, 45, 49, 52, 63, 64, 65, 73, 75, 80, 84], "kwarg": [1, 2, 6, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 38, 42, 43, 63, 64, 65, 68, 69, 70], "read": [1, 2, 4, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 26, 27, 29, 31, 35, 42, 43, 44, 45, 48, 52, 53, 54, 60, 63, 64, 65, 68, 69, 70, 73, 83], "from": [1, 2, 4, 6, 7, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 42, 43, 44, 45, 48, 49, 51, 52, 53, 54, 56, 57, 59, 60, 62, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 80, 82, 83, 84, 85, 86, 88, 91, 93], "iter": [1, 83], "over": [1, 9, 13, 19, 25, 31, 35, 74], "them": [1, 31, 48, 49, 68, 69, 70], "h5py": [1, 9, 11, 52, 53, 54, 60, 73, 74, 75, 79, 80, 83, 84, 85], "_hl": [1, 9, 11], "an": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 29, 31, 35, 40, 42, 43, 48, 49, 52, 53, 60, 66, 68, 69, 70, 73, 74, 82, 83, 85, 86, 89, 93], "open": [1, 9], "handl": [1, 4, 19, 20, 21, 31, 36, 48, 53, 57, 60], "object": [1, 2, 6, 7, 9, 10, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 42, 43, 44, 48, 57, 60, 74, 80, 85], "wa": [1, 6, 9, 29, 31, 48], "": [1, 2, 6, 7, 9, 15, 16, 17, 24, 25, 29, 36, 48, 52, 53, 54, 63, 64, 65, 78, 83, 86], "within": [1, 25, 31, 48, 62, 89, 93], "e": [1, 2, 4, 6, 9, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 43, 44, 48, 49, 53, 54, 63, 64, 65, 68, 69, 70, 83], "group1": 1, "group1a": 1, "slice": [1, 6, 7, 9, 74, 86], "option": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 39, 42, 43, 48, 49, 66, 83, 89], "specifi": [1, 2, 6, 7, 9, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 31, 35, 43, 49, 53, 60, 73, 74, 75, 78, 79, 80, 83], "th": [1, 9, 44], "entri": [1, 4, 6, 7, 9, 15, 16, 17, 20, 24, 31, 35, 53], "If": [1, 2, 6, 7, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 43, 48, 49, 53, 83], "creat": [1, 2, 6, 7, 9, 11, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 29, 31, 33, 35, 42, 43, 52, 60, 63, 64, 65, 68, 69, 70, 73, 78, 83, 84, 85, 86], "createhdf": [1, 9, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43, 52, 60, 73, 74, 75, 80, 83, 84, 85], "procedur": [1, 7, 24, 34, 36, 37, 39], "parallel": [1, 2, 9, 25, 27, 36, 49, 53, 60, 74, 83, 92], "nrepeat": [1, 9, 60], "which": [1, 2, 6, 7, 9, 14, 17, 19, 20, 24, 25, 27, 31, 35, 48, 53, 83], "necessari": [1, 48], "ani": [1, 6, 7, 9, 13, 14, 15, 16, 19, 21, 22, 24, 29, 31, 52, 83], "other": [1, 2, 6, 9, 17, 19, 20, 21, 24, 25, 31, 35, 66, 78, 83, 89], "ar": [1, 2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 44, 48, 49, 52, 53, 54, 60, 63, 64, 65, 66, 68, 69, 70, 73, 78, 83, 85, 89, 92], "mai": [1, 2, 6, 9, 19, 21, 22, 24, 25, 26, 31, 48, 63, 64, 65, 83], "fromhdf": [1, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 26, 27, 29, 31, 35, 42, 43, 44, 52, 60, 68, 69, 70, 73, 74, 75, 79, 80, 83, 84, 85], "requir": [1, 9, 19, 20, 21, 22, 31, 36, 48, 83], "extra": [1, 9, 19, 21, 22, 24, 25, 52, 60, 83], "argument": [1, 6, 9, 15, 16, 17, 19, 20, 21, 24, 25, 26, 29, 31, 35, 52, 63, 64, 65, 69, 70], "refer": [1, 49, 73, 78, 83], "you": [1, 4, 6, 9, 24, 25, 26, 27, 31, 48, 49, 66, 68, 69, 70, 83, 89], "wish": [1, 4, 48, 83], "determin": [1, 2, 7, 25, 48, 83], "whether": [1, 4, 7, 9, 19, 24, 25, 48, 83], "multipl": [1, 6, 7, 9, 14, 15, 24, 25, 26, 29, 35, 49, 60, 74], "singl": [1, 2, 4, 14, 17, 19, 20, 21, 22, 25, 35, 49, 74, 78, 83], "onli": [1, 2, 9, 15, 16, 17, 20, 24, 25, 27, 29, 31, 36, 48, 49, 60, 68, 69, 70, 73, 78, 83], "one": [1, 14, 15, 16, 17, 19, 24, 25, 27, 31, 48, 49, 52, 53, 78, 83], "read_al": 1, "written": [1, 2, 48, 49, 60, 83], "through": [1, 2, 9, 29, 83], "highest": [1, 68, 69, 70], "each": [1, 2, 6, 7, 9, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 42, 43, 44, 49, 52, 53, 60, 68, 69, 70, 78, 83, 85, 86], "ha": [1, 2, 9, 15, 16, 17, 19, 21, 24, 25, 27, 31, 35, 42, 43, 48, 60, 83], "attach": [1, 2, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 29, 31, 43, 52, 78], "readhdf": 1, "import": [1, 2, 9, 20, 33, 48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "top": [1, 6, 9, 24, 25, 48, 68, 69, 70], "thi": [1, 2, 4, 7, 9, 13, 15, 16, 17, 19, 20, 21, 22, 24, 25, 27, 29, 31, 35, 36, 39, 43, 48, 49, 52, 53, 54, 63, 64, 65, 66, 68, 69, 70, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89, 92], "can": [1, 2, 6, 9, 15, 16, 21, 22, 24, 25, 27, 31, 48, 49, 52, 53, 54, 57, 60, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "successfulli": 1, "numpi": [1, 2, 4, 6, 7, 9, 17, 19, 20, 21, 24, 27, 29, 31, 33, 35, 36, 37, 48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "arrai": [1, 2, 6, 7, 9, 13, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 35, 57, 60, 63, 64, 65, 73, 74, 83], "entir": [1, 6, 9, 24, 25, 26, 29, 35, 48], "caution": 1, "larg": [1, 2, 7, 9, 49, 60], "A": [1, 2, 4, 6, 7, 9, 11, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 35, 36, 42, 45, 51, 53, 60, 83, 91], "item": [1, 2, 6, 15, 16, 19, 48, 73], "read_groups_with_tag": 1, "memori": [1, 9, 11, 24, 29, 60, 68, 69, 70, 83], "read_item": 1, "provid": [1, 6, 9, 17, 29, 48, 68, 69, 70, 74], "flexibl": 1, "wai": [1, 2, 24, 25, 27, 66, 74, 86, 89], "either": [1, 7, 9, 14, 19, 20, 24, 25, 27, 31, 49, 74, 83], "packag": [1, 48, 53, 54, 68, 69, 70, 92], "have": [1, 2, 4, 6, 7, 9, 15, 16, 17, 24, 25, 26, 27, 29, 31, 35, 43, 48, 49, 52, 69, 70, 78, 83, 92], "writehdf": [1, 9, 15, 16, 17, 19, 21, 25, 27, 31, 42, 43, 52, 60, 73, 74, 75, 80, 83, 84, 85], "so": [1, 2, 6, 7, 9, 13, 24, 25, 26, 29, 35, 48, 52, 53, 54, 60, 68, 69, 70, 83], "instead": [1, 6, 9, 17, 24, 25, 27, 48], "hobj": 1, "dataset": [1, 12, 19, 20, 21, 22, 29, 49, 52, 53, 54, 60], "variabl": [1, 2, 6, 7, 9, 49, 83, 85, 86], "ndarrai": [1, 2, 4, 7, 9, 17, 25, 27, 35, 37, 83], "hdfwrite": 1, "write_nd": 1, "arr": [1, 6, 9, 25, 35, 73, 74], "mynam": [1, 9, 11, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43], "write": [1, 9, 11, 15, 16, 17, 19, 21, 25, 27, 31, 42, 43, 44, 48, 60, 66, 73, 83, 89], "prealloc": 1, "content": [1, 9, 11, 83], "must": [1, 2, 9, 15, 16, 17, 20, 24, 25, 31, 35, 43, 48, 53], "alreadi": [1, 9, 14, 15, 16, 17, 19, 21, 24, 25, 27, 31, 42, 43, 48, 78], "been": [1, 2, 6, 9, 15, 16, 17, 19, 21, 25, 27, 31, 42, 43, 83], "alloc": [1, 60, 83], "insid": [1, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43], "g": [1, 2, 4, 6, 9, 15, 16, 19, 20, 21, 24, 25, 26, 29, 31, 35, 43, 44, 48, 53, 78, 83, 85], "modul": [2, 4, 14, 19, 20, 24, 25, 26, 27, 29, 33, 34, 36, 37, 38, 39, 44, 48, 92], "custom": [2, 4, 6, 7, 83], "bcast": [2, 9, 19, 20, 21, 31, 42, 44], "self": [2, 6, 7, 9, 15, 16, 19, 20, 21, 24, 25, 26, 27, 29, 31, 53, 68, 69, 70], "world": [2, 9, 19, 20, 21, 31, 42, 44], "root": [2, 9, 19, 20, 21, 31, 42, 44], "0": [2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 42, 44, 49, 51, 52, 53, 54, 56, 57, 59, 60, 62, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 80, 82, 83, 84, 85, 86, 88, 91, 93], "dtype": [2, 9, 84], "ndim": [2, 7, 9, 31, 36, 37, 39, 40], "shape": [2, 6, 9, 17, 25, 26, 27, 29, 35, 54, 60, 73, 74, 83, 84], "broadcast": [2, 9, 19, 20, 21, 31, 42, 44], "rank": [2, 9, 19, 20, 31], "commun": [2, 9, 19, 20, 31, 42, 48], "call": [2, 4, 7, 9, 15, 16, 17, 19, 21, 24, 25, 27, 31, 42, 43, 48], "collect": [2, 6, 9, 74, 80, 85], "In": [2, 9, 14, 19, 20, 21, 22, 25, 27, 48, 49, 52, 53, 54, 66, 78, 83, 89], "order": [2, 4, 9, 24, 25, 27, 33, 41, 52, 53, 54, 60], "instanti": [2, 9, 20, 24, 25, 27, 33, 36, 43, 52, 60, 68, 69, 70, 73, 74, 84, 85, 86], "everi": [2, 4, 9], "see": [2, 9, 17, 25, 27, 31, 48, 52, 53, 54, 92], "exampl": [2, 6, 9, 17, 20, 25, 27, 33, 35, 49, 51, 52, 53, 54, 56, 57, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 80, 82, 84, 85, 86, 88, 91, 92, 93], "section": [2, 9, 68, 69, 70, 92], "more": [2, 9, 14, 15, 16, 17, 25, 35, 52, 53, 54, 68, 69, 70, 92], "detail": [2, 49, 83], "mpi4pi": [2, 9, 19, 20, 31, 42], "comm": [2, 9, 19, 31], "int": [2, 4, 6, 7, 9, 13, 14, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 39, 42, 63, 64, 65], "default": [2, 4, 6, 7, 9, 15, 16, 17, 19, 20, 21, 24, 25, 31, 49, 63, 64, 65, 83], "same": [2, 6, 9, 15, 16, 24, 25, 26, 27, 29, 35, 48, 83], "rais": [2, 9, 15, 16, 17, 20, 21, 24, 31, 43], "typeerror": [2, 9, 15, 16, 17, 24, 31, 43], "tell": 2, "user": [2, 17, 25, 35, 53, 63, 64, 65, 68, 69, 70, 83], "specif": [2, 19, 20, 21, 33, 38], "bcast_list": 2, "while": [2, 49, 52, 74], "less": [2, 9, 35, 49, 83], "seem": 2, "like": [2, 6, 7, 9, 17, 24, 25, 26, 27, 29, 35, 48, 49, 53, 54, 83], "might": [2, 48, 52], "faster": [2, 9, 31], "actual": [2, 6, 9, 60], "pickl": 2, "binari": [2, 31, 48, 83], "stream": 2, "unpickl": 2, "side": [2, 24, 48, 49, 53], "For": [2, 6, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 29, 31, 36, 37, 43, 44, 48, 49, 52, 53, 54, 78], "number": [2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39, 49, 53, 73, 78, 83, 84, 85, 86], "take": [2, 4, 6, 7, 9, 17, 19, 24, 25, 26, 29, 31, 35, 53, 63, 64, 65, 68, 69, 70, 83, 84, 85, 86], "long": [2, 9], "time": [2, 9, 15, 16, 19, 21, 22, 46, 52, 54, 57, 63, 64, 65, 68, 69, 70, 73, 74, 75, 79, 80, 83, 84, 85, 86, 92], "made": [2, 20, 25, 27, 33], "awar": 2, "benefit": 2, "given": [2, 4, 6, 7, 9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 39, 43, 49, 52, 53, 54, 73, 78, 83], "master": [2, 6, 9, 20], "also": [2, 9, 17, 19, 21, 22, 48, 60, 66, 68, 69, 70, 78, 83, 89], "np": [2, 9, 17, 20, 33, 35, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "mympi": 2, "comm_world": [2, 9, 19, 20, 31, 42], "x": [2, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 39, 42, 43, 44, 49, 52, 53, 54, 60, 64, 69, 70, 73, 74, 75, 79, 80, 83, 84, 85, 86], "statarrai": [2, 6, 10, 11, 14, 15, 16, 17, 19, 21, 24, 25, 26, 27, 31, 35, 36, 42, 43, 52, 53, 54, 57, 60, 73, 74, 75, 78, 79, 80, 84, 85, 86, 88, 89, 93], "arang": [2, 9, 19, 20, 21, 31, 52, 60, 73, 74, 75, 79, 80, 83, 84, 85], "10": [2, 6, 9, 15, 17, 20, 24, 25, 26, 29, 35, 49, 52, 53, 54, 57, 60, 68, 69, 70, 72, 73, 74, 75, 77, 78, 80, 83, 84, 85, 93], "befor": [2, 4, 6, 9, 15, 16, 17, 19, 21, 24, 25, 27, 31, 35, 42, 43, 48, 60], "els": [2, 14, 17, 19, 20, 21, 35, 49, 86], "y": [2, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 42, 43, 44, 52, 53, 60, 69, 70, 74, 75, 79, 80, 83, 85, 86], "some": [2, 52, 53, 54, 60, 68, 69, 70, 74, 75, 79, 80, 84, 85, 86], "input": [2, 9, 24, 29, 60, 63, 64, 65, 83], "product": [2, 7, 48], "bcast_1int": 2, "integ": [2, 4, 7, 25, 26, 27, 53, 83], "scalar": [2, 6, 7, 9, 15, 16, 24, 25, 26, 27, 29, 35, 36], "valu": [2, 4, 6, 7, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 29, 31, 35, 39, 49, 52, 53, 54, 68, 69, 70, 73, 74, 78, 79, 80, 83, 84], "approach": [2, 29, 83], "cast": [2, 9], "1d": [2, 6, 7, 9, 15, 16, 19, 20, 24, 25, 26, 27, 29, 31, 49, 52, 53, 54, 74, 77, 82, 88, 92, 93], "5": [2, 9, 15, 16, 17, 24, 29, 33, 48, 49, 52, 53, 54, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 92], "send": 2, "slower": [2, 49], "than": [2, 9, 15, 16, 17, 24, 25, 29, 52, 53, 54, 83], "uppercas": 2, "irecv": [2, 9], "auto": [2, 9, 19, 20, 21, 52, 53, 54], "data": [2, 3, 6, 8, 9, 13, 14, 15, 16, 17, 20, 21, 22, 23, 25, 27, 29, 31, 38, 42, 43, 44, 48, 49, 51, 52, 53, 54, 60, 67, 68, 69, 70, 83, 92, 93], "accompani": [2, 19, 21, 22], "isend": [2, 9], "irecvfromleft": [2, 9], "wrap": [2, 6, 9, 17, 24, 25, 27, 35, 48, 83], "true": [2, 6, 9, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 29, 31, 35, 42, 43, 49, 52, 53, 54, 63, 64, 65, 68, 69, 70, 73, 74, 78, 83, 84, 85], "left": [2, 9, 24, 25, 85], "irecvfromright": [2, 9], "right": [2, 9, 24, 25], "irecv_1int": 2, "recv": 2, "isend_1int": 2, "receiv": [2, 15, 16, 19, 21, 22, 31, 44, 52, 53, 54], "dest": [2, 9], "isendtoleft": [2, 9], "isendtoright": [2, 9], "sent": [2, 9, 19, 20, 31], "scatterv": [2, 9, 19, 20, 21, 31], "start": [2, 9, 17, 19, 20, 21, 31, 48, 49, 53, 63, 64, 65, 68, 69, 70, 92], "chunk": [2, 9, 19, 20, 21, 31], "axi": [2, 6, 7, 9, 14, 19, 24, 25, 26, 27, 29, 31, 35, 36, 74, 78, 79, 83, 85, 86], "get": [2, 4, 7, 9, 11, 13, 15, 17, 19, 20, 21, 24, 25, 27, 31, 35, 36, 39, 48, 52, 53, 54, 57, 83, 84, 85, 92], "defin": [2, 9, 14, 17, 19, 20, 24, 25, 26, 27, 31, 34, 36, 37, 38, 39, 40, 42, 43, 44, 49, 52, 53, 54, 74, 75, 79, 80, 83], "size": [2, 4, 6, 9, 11, 17, 19, 20, 21, 22, 24, 25, 29, 31, 35, 36, 37, 74, 83], "avail": [2, 9, 24, 25, 48], "equal": [2, 6, 7, 9, 15, 16, 17, 19, 20, 24, 25, 26, 29, 31, 35, 49, 52, 53, 54, 73, 79], "element": [2, 6, 7, 9, 19, 20, 25, 27, 83], "give": [2, 9, 19, 20], "along": [2, 6, 7, 9, 19, 20, 21, 24, 25, 26, 27, 29, 31, 35, 85, 86], "2d": [2, 6, 7, 9, 19, 20, 21, 24, 25, 26, 27, 29, 31, 60, 72, 77, 78, 82, 88, 92, 93], "global": [2, 24, 25, 27, 29], "n": [2, 4, 6, 7, 9, 17, 19, 20, 21, 22, 24, 31, 36, 37, 51, 80, 83, 91], "1000": [2, 9, 49, 73, 83, 84], "On": [2, 48, 53], "comput": [2, 7, 9, 13, 14, 15, 17, 19, 24, 25, 29, 31, 36, 37, 52, 53, 54, 74], "indic": [2, 4, 6, 7, 9, 13, 15, 17, 19, 20, 21, 22, 24, 25, 27, 31, 73], "loadbalance_shrinkingarrai": 2, "scatter": [2, 6, 9, 31, 83], "among": 2, "mychunk": [2, 31], "scatterv_list": 2, "scatterv_numpi": 2, "being": [2, 63, 64, 65], "exist": [2, 4, 19, 21, 22, 24, 29, 63, 64, 65], "banner": 2, "astr": 2, "end": [2, 7, 9, 24, 48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "print": [2, 9, 15, 17, 42, 43, 52, 53, 54, 60, 63, 64, 65, 68, 69, 70, 73, 78, 83, 84], "separ": [2, 9, 31, 53], "abov": [2, 14, 15, 16, 17, 24, 68, 69, 70], "below": [2, 48, 49], "append": [2, 9, 19, 20, 21, 31, 63, 64, 65, 83, 85], "after": [2, 4, 9, 21, 24, 53], "last": [2, 6, 7, 9, 24, 25, 26, 29, 35, 48], "newlin": [2, 24], "bcasttyp": 2, "adapt": 2, "arbitrari": 2, "__class__": 2, "__name__": [2, 68, 69, 70], "includ": [2, 9, 15, 16, 17, 20, 24, 25, 27, 29, 31, 43, 48, 83], "get_prng": [2, 54, 63, 64, 65], "gener": [2, 6, 7, 9, 17, 19, 20, 21, 24, 29, 31, 33, 35, 36, 37, 45, 48, 49, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "randomgen": 2, "xoshiro256": 2, "seed": [2, 52, 53, 54, 57, 63, 64, 65, 68, 69, 70, 73, 78, 83], "jump": [2, 24], "independ": [2, 9], "prng": [2, 24, 29, 33, 36, 37, 39, 40, 52, 53, 54, 57, 63, 64, 65, 68, 69, 70, 73, 78, 83], "bit": [2, 31], "amount": [2, 6, 7, 9, 24, 25, 26, 29, 35, 83], "helloworld": 2, "hello": 2, "loadbalance1d_shrinkingarrai": 2, "nchunk": 2, "length": [2, 6, 9, 14, 15, 16, 17, 19, 29, 49, 53], "load": [2, 92], "balanc": 2, "shrink": 2, "fashion": 2, "up": [2, 35], "remaind": 2, "first": [2, 6, 7, 9, 19, 20, 21, 22, 24, 25, 26, 27, 29, 35, 44, 48, 53, 60, 66, 68, 69, 70, 74, 83, 89], "1": [2, 6, 7, 9, 14, 15, 17, 19, 20, 21, 22, 24, 29, 31, 33, 35, 37, 39, 44, 49, 52, 53, 54, 57, 59, 62, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "3": [2, 4, 6, 9, 17, 24, 25, 27, 31, 35, 48, 49, 52, 53, 54, 56, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 82, 83, 84, 85, 86], "would": [2, 24, 25, 27, 48, 53, 54], "4": [2, 4, 9, 13, 17, 20, 36, 37, 49, 52, 53, 54, 57, 68, 69, 70, 73, 74, 83, 85, 86, 88], "7": [2, 9, 17, 20, 44, 48, 49, 52, 53, 54, 65, 83], "loadbalance3d_shrinkingarrai": 2, "three": [2, 6, 9, 49, 74], "dimens": [2, 6, 7, 9, 17, 24, 25, 26, 27, 29, 31, 35, 36, 39, 53, 74, 78, 86], "honour": 2, "rel": [2, 9, 15, 16, 17, 24, 25, 26, 31, 36, 42, 43, 49, 52, 53, 54, 83], "differ": [2, 7, 9, 13, 17, 19, 24, 35, 49, 57, 83], "600": 2, "300": [2, 68, 69, 70, 83], "larger": [2, 48], "third": [2, 74], "onc": [2, 48, 49], "obtain": [2, 4, 7, 19, 21, 25, 31, 35, 48, 52, 53, 54, 83], "array_lik": [2, 6, 7, 9, 14, 15, 16, 17, 19, 24, 25, 26, 27, 29, 31, 35, 36, 39, 45], "3d": [2, 19, 20, 21, 25, 26, 27, 31, 68, 69, 70, 74, 77, 79, 82, 88, 89, 93], "ordered_print": 2, "titl": [2, 14, 15, 52, 53, 54, 85], "slow": [2, 9, 36], "due": [2, 9, 48, 49], "lot": [2, 83], "illustr": 2, "purpos": 2, "debug": 2, "do": [2, 6, 7, 9, 19, 20, 21, 24, 25, 27, 48, 74, 83], "output": [2, 11, 17, 24, 25, 27, 35, 49, 60, 63, 64, 65, 66, 89], "clear": 2, "what": [2, 6, 19, 21, 22, 48, 53], "sy": [2, 63, 64, 65], "stdout": 2, "flush": 2, "buffer": [2, 9], "immedi": 2, "rankprint": 2, "util": 3, "plot": [3, 9, 13, 14, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 33, 35, 48, 49, 52, 53, 54, 57, 68, 69, 70, 73, 74, 75, 78, 79, 80, 84, 85, 86, 92], "fileio": 3, "interpol": [3, 19, 24, 31], "heirarch": 3, "format": [3, 19, 21, 22, 31, 52, 54, 63, 64, 65, 68, 69, 70], "hdf": [3, 9, 11, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 42, 43, 44, 48, 60, 63, 64, 65, 92], "mpi": [3, 9, 19, 20, 21, 31, 42, 44, 49, 60], "wrapper": [3, 41, 48], "oper": [4, 9, 83], "bytes2read": 4, "nbyte": 4, "convert": [4, 9, 24], "byte": 4, "kb": 4, "mb": [4, 51, 56, 59, 62, 67, 72, 77, 82, 88, 91, 93], "pb": 4, "float": [4, 6, 7, 9, 13, 14, 15, 16, 17, 20, 21, 24, 25, 26, 27, 29, 31, 35, 36, 37, 42, 53, 83], "etc": [4, 6, 9, 24, 31], "deletefil": 4, "delet": [4, 9, 24, 63, 64, 65, 83], "direxist": 4, "dirpath": 4, "check": [4, 7, 9, 24, 25, 48, 63, 64, 65, 83], "directori": [4, 48, 63, 64, 65, 68, 69, 70], "disk": [4, 52, 53, 54, 60], "bool": [4, 6, 7, 9, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 29, 31, 35, 43], "fileexist": 4, "filesexist": 4, "getfileextens": 4, "extens": [4, 9, 20, 36, 83], "getfiles": 4, "getncolumn": 4, "nheader": 4, "column": [4, 6, 9, 19, 20, 21, 22, 44, 49, 53], "line": [4, 6, 14, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 31, 44, 49, 53, 57, 63, 64, 65, 66, 68, 69, 70, 74, 83, 89], "header": [4, 19, 20, 21, 22, 44], "skip": 4, "getnlin": 4, "account": 4, "subtract": [4, 9], "total": [4, 51, 52, 53, 54, 56, 57, 59, 62, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 80, 82, 83, 84, 85, 86, 88, 91, 93], "without": [4, 7, 48], "get_column_nam": 4, "By": [4, 24, 68, 69, 70], "pars": 4, "get_real_numbers_from_lin": 4, "delimit": 4, "strictli": 4, "int2str": 4, "lead": 4, "zero": [4, 6, 7, 9, 14, 17, 19, 24, 25, 26, 29, 31, 35, 53, 74], "maintain": [4, 9, 83], "correct": [4, 7, 48], "system": [4, 8, 14, 15, 16, 17, 19, 20, 21, 22, 42, 43, 49, 52, 53, 54, 60, 63, 64, 65], "maximum": [4, 13, 24, 25, 29, 49, 73, 78], "digit": 4, "0003": 4, "pad": [4, 9, 24, 29, 36, 73], "front": [4, 53], "isfileextens": 4, "ext": 4, "want": [4, 48], "against": [4, 6, 9, 19, 24, 25, 27, 31, 83], "match": [4, 9], "parsestr": 4, "its": [4, 9, 17, 19, 21, 22, 24, 48, 49, 73, 78, 83, 85], "pattern": 4, "comma": 4, "wccount": 4, "count": [4, 20, 25, 35, 85, 86], "wc": 4, "bar": [6, 9, 24, 25, 26, 29, 35, 83, 84], "edg": [6, 9, 24, 25, 27, 36, 39, 52, 53, 54, 73, 74, 78, 83, 84], "chart": [6, 9], "matplotlib": [6, 9, 14, 19, 20, 21, 24, 25, 26, 29, 31, 33, 35, 52, 53, 54, 57, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "ax": [6, 7, 9, 14, 19, 20, 21, 25, 26, 27, 31, 68, 69, 70, 73, 78, 80, 83, 84, 85], "pyplot": [6, 9, 14, 24, 25, 26, 33, 52, 53, 54, 57, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "hist": [6, 9, 83], "addit": [6, 9, 15, 16, 17, 19, 20, 21, 24, 25, 26, 31, 43, 49, 52, 53, 54], "keyword": [6, 9, 14, 19, 20, 21, 24, 25, 26, 31, 68, 69, 70, 83], "clabel": 6, "cb": 6, "label": [6, 9, 24, 53, 83], "colourbar": [6, 83], "fontsiz": 6, "colorbar": [6, 74, 78, 80, 83, 85], "generate_subplot": 6, "subplot": [6, 9, 52, 53, 54, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "depend": [6, 29, 48], "gridspec": [6, 73, 85], "subplotspec": 6, "hillshad": 6, "azimuth": 6, "30": [6, 49, 52, 54, 63, 73, 78], "altitud": [6, 19, 21, 22], "elev": [6, 13, 14, 15, 16, 17, 19, 20, 21, 22, 31, 42, 43, 49, 52, 53], "taken": [6, 31], "http": [6, 53, 54, 83], "github": [6, 53, 54], "com": [6, 53, 54], "royalosyin": 6, "work": [6, 13, 48, 83], "dem": 6, "simpl": [6, 7, 24, 25, 27, 83], "complic": 6, "blob": 6, "ex07": 6, "20from": 6, "20a": 6, "20digit": 6, "20elev": 6, "20model": 6, "20": [6, 49, 53, 64, 74, 75, 80, 84], "ipynb": [6, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "row": [6, 9, 20, 44], "desir": [6, 9], "sun": 6, "angl": 6, "hline": 6, "arg": [6, 19, 21, 22, 29, 33, 34, 63, 64, 65], "automat": [6, 9, 31, 48, 85], "abcissa": [6, 9], "ordin": [6, 14, 15, 16, 17, 19, 20, 21, 22, 25, 26, 27, 31, 83], "upto": [6, 7, 24, 29], "2": [6, 7, 9, 13, 14, 17, 19, 20, 24, 25, 27, 29, 31, 35, 49, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "log": [6, 7, 9, 15, 16, 17, 24, 25, 26, 27, 29, 35, 36, 37, 39, 45, 49, 52, 53, 54, 57, 68, 69, 70, 78, 83], "colour": [6, 7, 9, 24, 25, 26, 29, 31, 35, 68, 69, 70, 73, 83], "c": [6, 9, 24, 25, 26, 27, 29, 31, 35, 48, 83, 86], "mask": [6, 9, 24, 25, 26, 29, 31, 35, 69, 70, 73, 74, 83], "xscale": [6, 9, 24, 25, 26, 29, 35, 53, 54, 78], "scale": [6, 9, 24, 25, 26, 29, 35, 49, 60, 83], "linear": [6, 9, 24, 25, 26, 29, 35, 53], "flipx": [6, 9, 24, 25, 26, 29, 35], "flip": [6, 9, 24, 25, 26, 29, 35, 73, 78, 83], "flipi": [6, 9, 24, 25, 26, 29, 35, 52, 53, 54, 68, 69, 70, 73, 74, 78, 83], "make_colourmap": 6, "seq": 6, "cname": 6, "segment": [6, 53], "colourmap": [6, 9, 24, 25, 26, 29, 35, 83], "sequenc": [6, 9, 21, 22, 31, 37], "regist": 6, "hex": 6, "000000": 6, "00fcfd": 6, "color": [6, 9, 85], "linearsegmentedcolormap": [6, 9], "paus": 6, "interv": [6, 9, 24, 25, 35, 74, 85], "command": [6, 7, 49, 63, 64, 65, 66, 89], "overrid": [6, 24], "keep": [6, 9, 63, 64, 65, 68, 69, 70], "figur": [6, 9, 14, 24, 25, 26, 29, 33, 35, 52, 53, 54, 57, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "when": [6, 9, 15, 16, 17, 24, 29, 31, 43, 48, 49, 68, 69, 70, 83], "interactv": 6, "mode": [6, 35], "second": [6, 9, 24, 25, 27, 29, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "pcolor": [6, 9, 21, 24, 25, 26, 29, 35, 52, 53, 54, 68, 69, 70, 73, 74, 78, 79, 80, 83, 84, 85, 86], "pseudocolour": [6, 9, 24, 25, 26], "pcolormesh": [6, 9, 24, 25, 26, 27, 69, 70], "speed": [6, 9, 83], "cmap": [6, 9, 24, 68, 69, 70, 78, 83, 85, 86], "horizont": [6, 9, 19, 21, 22, 25, 26, 27, 74], "coordin": [6, 9, 31, 74], "vertic": [6, 7, 9, 14, 15, 16, 25, 26, 27, 31, 53, 73, 78], "alpha": [6, 9, 24, 25, 26, 29, 35, 83], "behav": [6, 9, 24, 25, 26, 29, 35, 83], "standard": [6, 9, 14, 17, 19, 24, 25, 26, 27, 29, 35, 48, 49, 52, 53, 57], "opac": [6, 9, 24, 25, 26, 29, 35, 83, 85, 86], "appli": [6, 9, 14, 24, 25, 26, 29, 35, 83, 92], "pixel": [6, 9, 24, 25, 26, 29, 35, 83], "individu": [6, 9, 15, 16, 17, 24, 25, 26, 29, 31, 35, 43, 53], "histogram": [6, 7, 9, 24, 25, 26, 29, 41, 78, 88, 89, 93], "nbin": [6, 7, 9, 24, 25, 26, 29, 35, 36, 37, 39], "bin": [6, 7, 9, 24, 25, 26, 29, 35, 36, 37, 39, 40, 48, 57, 78, 83, 85, 86], "grid": [6, 9, 24, 25, 26, 27, 29, 31, 35, 73, 74, 75, 78, 79, 80, 83, 84], "nocolorbar": [6, 9, 24, 25, 26, 29, 35, 78], "turn": [6, 9, 24, 25, 26, 29, 35, 49], "off": [6, 9, 19, 21, 22, 24, 25, 26, 29, 35, 49, 53], "reciprocatex": [6, 24], "reciproc": [6, 7, 17, 19, 24, 35, 78], "transform": [6, 68, 69, 70], "reciprocatei": 6, "trim": [6, 7, 9, 24, 25, 26, 27, 29, 35, 83, 84], "limit": [6, 9, 24, 25, 26, 29, 35], "non": [6, 7, 9, 17, 19, 24, 25, 26, 29, 35, 69, 70], "dict": [6, 9], "dictionari": [6, 9], "id": [6, 9, 19, 20, 21, 22, 83], "should": [6, 9, 14, 15, 16, 17, 19, 20, 21, 22, 43, 48, 83], "ignor": [6, 9, 19, 21, 22], "pcolor_1d": 6, "show": [6, 9, 33, 52, 53, 54, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "transpos": [6, 52, 54, 73, 74, 78, 84, 85], "imag": [6, 29, 35, 48, 83], "pcolor_as_bar": 6, "alphacolour": 6, "tran": 6, "low": [6, 9, 35, 53, 68, 69, 70], "map": [6, 21, 31, 35, 85, 86], "transpar": [6, 35, 68, 69, 70, 85, 86], "rgb": 6, "white": [6, 83], "don": [6, 49], "t": [6, 15, 16, 20, 44, 49, 83], "pretti": 6, "make": [6, 48, 63, 64, 65, 68, 69, 70, 73, 78], "nice": [6, 11], "remov": [6, 9, 24, 48, 49, 73, 78], "fluff": 6, "plt": [6, 9, 25, 26, 27, 33, 52, 53, 54, 57, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "111": 6, "gca": 6, "scatter2d": [6, 9, 31], "markers": [6, 9, 31, 83], "point": [6, 9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 25, 26, 27, 29, 32, 42, 43, 45, 48, 49, 52, 53, 54, 63, 64, 65, 68, 69, 70, 83], "geobipy_kwarg": 6, "setalphaperpcolormeshpixel": 6, "pcmesh": 6, "alphaarrai": 6, "quadmesh": [6, 74, 80, 85], "per": [6, 15, 19, 20, 35, 49, 53], "between": [6, 7, 9, 13, 17, 19, 20, 24, 25, 27, 31, 33, 35, 48, 52, 53, 85], "sizelegend": [6, 83], "add": [6, 9, 19, 29, 44, 83], "legend": [6, 19, 20, 21, 85], "stackplot2d": 6, "ffff00": 6, "1ce6ff": 6, "ff34ff": 6, "ff4a46": 6, "008941": 6, "006fa6": 6, "a30059": 6, "ffdbe5": 6, "7a4900": 6, "0000a6": 6, "63ffac": 6, "b79762": 6, "004d43": 6, "8fb0ff": 6, "997d87": 6, "5a0007": 6, "809693": 6, "feffe6": 6, "1b4400": 6, "4fc601": 6, "3b5dff": 6, "4a3b53": 6, "ff2f80": 6, "61615a": 6, "ba0900": 6, "6b7900": 6, "00c2a0": 6, "ffaa92": 6, "ff90c9": 6, "b903aa": 6, "d16100": 6, "ddefff": 6, "000035": 6, "7b4f4b": 6, "a1c299": 6, "300018": 6, "0aa6d8": 6, "013349": 6, "00846f": 6, "372101": 6, "ffb500": 6, "c2ffed": 6, "a079bf": 6, "cc0744": 6, "c0b9b2": 6, "c2ff99": 6, "001e09": 6, "00489c": 6, "6f0062": 6, "0cbd66": 6, "eec3ff": 6, "456d75": 6, "b77b68": 6, "7a87a1": 6, "788d66": 6, "885578": 6, "fad09f": 6, "ff8a9a": 6, "d157a0": 6, "bec459": 6, "456648": 6, "0086ed": 6, "886f4c": 6, "34362d": 6, "b4a8bd": 6, "00a6aa": 6, "452c2c": 6, "636375": 6, "a3c8c9": 6, "ff913f": 6, "938a81": 6, "575329": 6, "00fecf": 6, "b05b6f": 6, "8cd0ff": 6, "3b9700": 6, "04f757": 6, "c8a1a1": 6, "1e6e00": 6, "7900d7": 6, "a77500": 6, "6367a9": 6, "a05837": 6, "6b002c": 6, "772600": 6, "d790ff": 6, "9b9700": 6, "549e79": 6, "fff69f": 6, "201625": 6, "72418f": 6, "bc23ff": 6, "99adc0": 6, "3a2465": 6, "922329": 6, "5b4534": 6, "fde8dc": 6, "404e55": 6, "0089a3": 6, "cb7e98": 6, "a4e804": 6, "324e72": 6, "6a3a4c": 6, "stack": [6, 9, 83], "cumul": [6, 7, 19, 20, 21, 25, 26, 27, 31, 39, 84], "sum": [6, 15, 16, 17, 19, 25, 49], "assign": [6, 9, 14, 15, 16, 17, 19, 31, 43, 49, 73, 78, 83], "scatterplot": [6, 9], "step": [6, 24, 60], "piecewis": [6, 24, 53], "constant": [6, 7, 24, 36, 52], "yscale": [6, 9, 24, 25, 26, 29, 35, 53], "nolabel": [6, 24], "vline": 6, "matrix": [7, 14, 15, 29, 52, 53, 54], "vector": [7, 15, 16], "represent": 7, "assum": [7, 9, 15, 16, 17, 19, 20, 21, 22, 25, 27, 31, 42, 43], "repres": [7, 9, 14, 19, 21, 22, 25, 83], "diagon": 7, "wise": 7, "multipli": [7, 15, 16, 35, 49, 52, 53, 54], "dot": 7, "result": [7, 9, 24, 31, 48, 49, 83, 92], "det": 7, "linalg": 7, "lu": 7, "factor": [7, 14, 29, 49], "power": 7, "inv": 7, "invers": [7, 29, 38, 48, 49], "invert": [7, 49, 67, 89, 93], "logdet": 7, "natur": 7, "logarithm": [7, 15, 16, 84], "cossin1": 7, "p": [7, 24, 31, 68, 69, 70, 73, 74, 83], "test": [7, 9, 24, 48, 73, 74, 75, 78, 80, 83, 85, 86], "expreal": 7, "exponenti": [7, 83], "allow": [7, 9, 24, 25, 27, 29, 49, 52, 53, 54, 60, 74, 83, 84, 85, 86], "neg": [7, 17, 24, 25, 27, 35], "expon": 7, "overflow": 7, "truncat": 7, "warn": [7, 63, 64, 65, 70], "messag": 7, "real": 7, "exp": [7, 53], "findfirstlastnotvalu": 7, "invalid_v": [7, 9], "axisgg": 7, "findfirstnonzero": 7, "findlastnonzero": 7, "findnan": 7, "indici": [7, 9], "nan": [7, 9, 13, 17, 19, 20, 24, 25, 31, 74], "findnotnan": 7, "getnam": 7, "tri": [7, 24], "preced": [7, 19], "doe": [7, 9, 31, 49, 92], "sought": 7, "fail": [7, 24, 63, 64, 65], "getnameunit": [7, 9], "defaultnam": 7, "defaultunit": 7, "unit": [7, 9, 17, 19, 31, 60, 73, 74, 83, 84, 85], "surround": [7, 9], "round": 7, "bracket": [7, 19, 20, 21, 22], "getunit": 7, "histogramequ": 7, "256": 7, "re": 7, "cdf": [7, 37, 39, 84, 85], "densiti": [7, 9, 57, 73, 83, 84], "interleav": [7, 9], "b": [7, 9, 49, 83, 85, 86], "togeth": [7, 9, 19, 20, 21, 31], "zip": [7, 9, 89], "isint": 7, "subtyp": 7, "isintorslic": 7, "isnumpi": 7, "compat": 7, "built": [7, 83], "ins": 7, "anyth": 7, "mergecomplex": 7, "merg": 7, "concaten": [7, 15, 16], "imaginari": 7, "compon": [7, 13, 15, 16, 17, 19, 21, 24, 29, 31, 43, 45], "complex": [7, 83], "float64": [7, 9, 13, 15, 16, 17, 19, 24, 27, 29, 31, 43, 52, 53, 54, 74, 83, 84], "concatent": 7, "combin": [7, 85], "complex128": 7, "rosenbrock": 7, "smooth": [7, 9, 31], "lti": 7, "gaussian": [7, 9, 17], "filter": [7, 31, 53], "forward": [7, 14, 15, 29, 52, 53, 54, 92], "backward": 7, "pass": [7, 9, 29, 53, 68, 69, 70], "signal": 7, "process": [7, 24, 68, 69, 70, 78], "weight": [7, 9, 25, 83], "splitcomplex": 7, "str_to_raw": 7, "helper": 7, "latex": 7, "special": 7, "charact": 7, "tanh": 7, "hyperbol": 7, "tangent": 7, "trim_by_percentil": 7, "percent": [7, 35, 68, 69, 70, 84, 85], "percentil": [7, 35], "100": [7, 13, 33, 83, 84, 85], "mesh": [8, 24, 25, 26, 27, 29, 31, 35, 52, 54, 68, 77, 78, 79, 80, 83, 84, 85, 86, 92, 93], "model": [8, 9, 13, 14, 15, 24, 31, 35, 49, 52, 53, 54, 63, 64, 65, 68, 69, 70, 82, 92, 93], "pointcloud": [8, 13, 14, 15, 16, 17, 19, 20, 21, 22, 31, 42, 43], "statist": [8, 9, 24, 25, 33, 34, 35, 36, 37, 39, 40, 52, 57, 74, 83, 88, 92, 93], "myobject": [9, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45], "abc": [9, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45], "verbos": [9, 15, 16, 17, 31, 43, 49], "fals": [6, 9, 11, 15, 19, 21, 24, 25, 26, 27, 29, 31, 35, 36, 37, 39, 49, 57, 68, 69, 70, 78, 83, 84, 85], "subclass": [9, 15, 16, 17, 33], "attribut": [9, 31, 83], "describ": [9, 14, 19, 20, 21, 22, 24, 25, 26, 27, 29, 33, 44, 48, 53, 83], "One": 9, "prior": [9, 15, 16, 17, 24, 29, 31, 43, 49, 52, 53, 54, 73, 78], "propos": [9, 15, 16, 17, 24, 29, 31, 43, 49, 52, 53, 54, 73, 78], "distribut": [9, 15, 16, 17, 19, 20, 24, 29, 31, 35, 36, 40, 41, 43, 48, 49, 52, 53, 54, 59, 60, 78, 92, 93], "mcmc": [9, 24, 49], "algorithm": [9, 60], "easili": [9, 83], "becaus": [9, 48, 60, 83], "method": [9, 17, 24, 31, 49, 60, 83, 92], "place": [9, 24, 36, 37, 39, 40], "inform": [9, 19, 20, 21, 22, 24, 25, 44, 49, 52, 53, 54, 60, 68, 69, 70, 92], "new": [9, 15, 16, 17, 24, 25, 29, 31, 43, 48, 49, 53, 54, 73, 78, 84], "expos": 9, "interfac": [9, 24, 48, 49, 68, 69, 70, 73, 78], "whose": [9, 25, 27, 31, 74], "__array__": 9, "nest": 9, "properi": 9, "could": [9, 83], "too": [9, 20, 49, 83], "atest": 9, "someunit": 9, "deepcopi": [9, 14, 20, 40, 73, 78], "thei": [9, 24, 25, 27, 49, 68, 69, 70, 83], "replac": [9, 48, 49], "copi": [9, 20, 24, 29, 33, 48, 73, 78], "anothertest": 9, "fill": [9, 17], "offset": [9, 20, 44, 52, 53], "stride": 9, "tupl": [9, 17, 25, 27, 29, 35, 83, 86], "f": [9, 48, 52, 60, 73, 74, 75, 79, 80, 83, 84, 85], "contigu": [9, 60], "rightmost": 9, "vari": 9, "fastest": 9, "fortran": [9, 48], "leftmost": 9, "even": 9, "discontigu": 9, "unless": [9, 24], "case": [9, 24, 25, 27, 48, 49, 66, 78, 83, 89], "note": [9, 15, 16, 17, 19, 20, 21, 22, 31, 43, 48, 52, 53, 54, 85], "kept": 9, "reason": [9, 63, 64, 65], "overhead": 9, "possibl": [9, 24, 29], "chang": [9, 24, 29, 45, 49, 73, 78, 83], "mean": [9, 17, 24, 25, 35, 36, 37, 49, 52, 53, 54, 57, 74, 83, 85, 86], "warrant": 9, "sinc": [9, 24, 25, 27, 36, 48, 78, 83], "oppos": 9, "6": [9, 17, 20, 49, 52, 53, 54, 64, 68, 69, 70, 74, 78, 83], "8": [9, 52, 53, 68, 69, 70, 74, 78, 83, 86], "9": [9, 52, 53, 54, 74, 83, 85], "howev": [9, 31, 83], "NOT": [9, 20], "classmethod": [9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 26, 27, 29, 31, 35, 42, 43, 44], "amongst": [9, 19, 20, 31], "ab": [9, 52, 53, 54, 83], "absolut": [9, 15, 16, 25, 26], "properti": [9, 13, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 36, 37, 39, 40, 42, 43, 44, 45, 68, 69, 70, 92], "addressof": [9, 15, 17], "Be": 9, "care": 9, "repeat": [9, 73, 74, 75, 80], "realloc": 9, "argmax_multiple_to_nan": 9, "perform": [9, 31, 52, 53, 54, 74, 83], "argmax": 9, "max": [9, 13, 24, 25, 31, 39, 52, 53, 54, 68, 69, 70, 83, 84], "nan_multipl": 9, "It": [9, 35, 48, 49, 74], "height": [9, 14, 15, 16, 17, 21, 22, 31, 43, 49, 52, 53, 54, 80], "ith": [9, 19, 20, 21, 24, 29], "bound": [9, 21, 24, 29, 31, 49, 68, 69, 70], "centred_grid_nod": [9, 31], "space": [9, 13, 24, 31, 35, 45, 52, 53, 54, 60, 83], "node": [9, 25, 27, 31], "centr": [9, 24, 25, 27, 31, 35, 73, 74, 75, 78, 79, 80, 84, 86], "distanc": [9, 19, 20, 21, 24, 25, 26, 27, 31, 73, 74, 83], "confidence_interv": 9, "k": [9, 24, 29, 31, 63, 64, 65, 83], "control": 9, "layout": 9, "otherwis": [9, 24, 29], "close": [9, 53, 85], "veri": [9, 48, 49], "similar": [9, 17, 66, 89], "alwai": [9, 49], "behavior": 9, "copyto": 9, "prefer": 9, "flag": 9, "c_contigu": 9, "copystat": 9, "extended_summari": 9, "descript": [9, 19, 20, 21, 22, 24, 25, 27, 29, 31, 44, 53, 63, 64, 65, 83], "withposterior": [9, 11, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43, 52, 73, 83], "add_axi": [9, 14, 15, 16, 17, 24, 25, 26, 27, 31, 42, 43, 52, 73, 74, 83, 84, 85], "fillvalu": [9, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43], "upcast": [9, 24, 25, 26, 27], "metadata": [9, 14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43], "under": [9, 19, 21, 22], "heirarchi": 9, "mynamedata": 9, "mynameprior": 9, "mynamepropos": 9, "environ": [9, 48], "mpio": 9, "driver": 9, "empti": [9, 20, 25], "extend": [9, 83], "creation": [9, 73], "posterior": [9, 13, 14, 15, 16, 17, 29, 52, 53, 54, 72, 73, 78, 89, 92, 93], "insert": [9, 24, 25, 49, 83], "respect": [9, 24], "part": [9, 48, 83], "initi": [9, 14, 15, 16, 17, 45, 49, 52, 53, 57, 68, 69, 70], "serial": [9, 49, 92], "As": [9, 83], "10x10": 9, "rather": 9, "becom": 9, "cumbersom": 9, "done": [9, 83], "mani": 9, "w": [9, 17, 19, 52, 60, 73, 74, 75, 79, 80, 83, 84, 85], "barrier": 9, "region": [9, 68, 69, 70], "we": [9, 24, 48, 49, 52, 53, 54, 57, 60, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 92], "fake": 9, "def": [9, 63, 64, 65, 68, 69, 70], "noncollectivewrit": 9, "carri": [9, 13, 68, 69, 70, 83], "create_posterior_hdf": 9, "grp": [9, 14, 15, 16, 17, 19, 20, 21, 22, 24, 26, 27, 29, 31, 35, 42, 43, 44], "subarrai": 9, "obj": [9, 48], "flatten": [9, 25, 27, 74], "diff": [9, 49], "min": [9, 13, 24, 25, 31, 39, 52, 53, 54, 68, 69, 70, 83, 84], "midpoint": 9, "project": 9, "fix": [9, 53, 78], "calcul": [9, 25, 27], "firstnonzero": [9, 83], "fit_mixtur": 9, "mixture_typ": 9, "mean_bound": 9, "variance_bound": 9, "toler": 9, "05": [9, 49, 52, 53, 54, 68, 69, 70], "mixtur": [9, 35], "fit": [9, 13, 52, 53, 54], "minimum": [9, 13, 24, 25, 29, 31, 48, 49, 73, 78], "cluster": 9, "until": 9, "bic": 9, "decreas": 9, "nsampl": [9, 13, 35], "skip_posterior": [9, 24, 26, 27, 29, 83], "posterior_index": 9, "gaussianmixtur": 9, "clusterid": 9, "trainperc": 9, "75": [9, 53, 54], "covtyp": 9, "spheric": 9, "mix": 9, "classifi": 9, "present": [9, 14], "parenthes": 9, "haslabel": 9, "hasposterior": 9, "hasprior": 9, "haspropos": 9, "hdf_name": 9, "attr": 9, "repr": 9, "evalu": [9, 15, 16, 17, 24, 29, 31, 36, 43, 52, 53, 54, 73, 78, 83], "via": [9, 24, 29, 66, 89], "rang": [9, 24, 27, 35, 36, 37, 39, 49, 52, 53, 54, 68, 69, 70, 73, 74, 78, 83, 85, 86], "norm": [9, 17, 19, 31], "estim": [9, 14, 17, 19, 21, 22, 29, 35, 49, 52, 53, 85, 86], "deviat": [9, 14, 17, 19, 49, 52, 53, 57, 73], "overlai": [9, 35, 52, 53, 85], "pdf": [9, 24, 34, 57, 84, 85], "normal": [9, 17, 24, 25, 27, 33, 34, 36, 41, 49, 52, 53, 54, 84], "relat": 9, "random": [9, 17, 24, 29, 33, 35, 36, 37, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 74, 83, 84, 85, 86], "randn": [9, 17, 60, 73, 74, 83, 84, 85, 86], "monoton": 9, "increas": [9, 78], "scalara": 9, "legal": 9, "internaledg": [9, 83], "isregular": 9, "regularli": [9, 45, 84], "kmean": 9, "ncluster": 9, "niter": 9, "lastnonzero": [9, 83], "mahalanobi": 9, "n_posterior": 9, "nanmax": 9, "nanmin": 9, "everyth": 9, "arrya_lik": 9, "perturb": [9, 15, 16, 17, 24, 29, 31, 43, 49, 52, 53, 54, 83], "imposeprior": 9, "had": [9, 24], "setpropos": [9, 24], "updat": [9, 13, 14, 15, 16, 24, 29, 49, 78, 83, 84, 85, 86], "current": [9, 17, 24, 29, 49, 53, 83, 92], "sampl": [9, 17, 35, 36, 37, 49, 57, 83, 92], "plot_posterior": [9, 52, 53, 73, 78], "posteriors_from_hdf": 9, "prepend": [9, 83], "often": [9, 49, 52, 53, 54], "quit": [9, 31], "priorderiv": 9, "deriv": [9, 29, 48, 92], "probabl": [9, 15, 16, 17, 24, 29, 31, 33, 36, 37, 43, 49, 57, 68, 69, 70, 73, 78, 83], "activ": [9, 13, 15, 17, 19, 20, 48, 49, 52, 53, 54], "arg1": 9, "Will": 9, "proposal_deriv": 9, "continu": 9, "infin": 9, "impos": [9, 29, 49], "values": 9, "rescal": 9, "lower": [9, 35, 49, 68, 69, 70, 83], "upper": [9, 15, 16, 17, 19, 21, 25, 27, 31, 35, 42, 43], "reset_posterior": 9, "resiz": [9, 83], "new_shap": 9, "roll": [9, 19, 21, 22, 42, 43, 52], "numpyfunct": 9, "window": [9, 15, 19, 21, 22, 45], "subset": [9, 31], "stackedareaplot": [9, 83], "area": [9, 83], "where": [9, 15, 16, 17, 19, 20, 24, 44, 48, 49, 63, 64, 65, 83], "divid": [9, 53], "strip_nan": 9, "summari": [9, 15, 17, 19, 21, 24, 25, 26, 27, 29, 31, 42, 43, 44, 83, 84], "screen": 9, "summaryplot": [9, 83], "update_posterior": [9, 13, 14, 15, 29, 52, 53, 54, 73, 78, 83], "explicit": 9, "unlik": 9, "try": [9, 48, 49, 63, 64, 65, 68, 69, 70], "previous": 9, "write_posterior_hdf": 9, "o": [11, 48, 52, 53, 54, 63, 64, 65], "getsizeof": 11, "tohdf": [11, 44, 60, 73, 74, 75, 79, 80, 83, 84, 85], "datapoint": [12, 13, 14, 15, 16, 19, 20, 21, 29, 56, 92, 93], "z": [13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 31, 42, 43, 44, 45, 52, 53, 54, 74, 75, 80, 86], "channels_per_system": [13, 19], "std": [13, 14, 15, 16, 17, 19, 20, 21, 29, 48, 52, 53, 54], "predicteddata": [13, 14, 15, 16, 17, 19, 52, 53, 54], "channelnam": [], "linenumb": [13, 14, 15, 16, 17, 19, 52, 53], "fiduci": [13, 14, 15, 16, 17, 19, 20, 21, 52], "abstract": [13, 40, 43], "tdemdatapoint": [13, 16, 18, 21, 53], "fdemdatapoint": [13, 18, 20, 21, 52], "observ": [13, 14, 15, 16, 17, 19, 20, 29, 42, 44, 52, 53, 54], "find_best_halfspac": [13, 52, 53, 54], "minconduct": 13, "0001": 13, "maxconduct": 13, "10000": [13, 49, 84], "best": [13, 35, 52, 53, 54, 68, 69, 70, 78], "half": [13, 52, 53, 54, 86], "brute": 13, "forc": [13, 73, 83], "search": [13, 52, 53, 54], "halfspac": [13, 29, 52, 53, 54, 82, 89, 93], "conduct": [13, 52, 53, 54, 78], "profil": [13, 29], "misfit": [13, 17, 19, 49, 52, 53, 54], "v": [13, 83], "quadrat": 13, "bisect": 13, "log10": [13, 68, 69, 70, 83], "plothalfspacerespons": [13, 52, 53, 54], "repons": 13, "ninc": 13, "increment": [13, 31], "predict": [13, 14, 15, 16, 17, 19, 21, 52, 53, 54], "emdatapoint": [14, 15, 16, 17, 18], "fdemdatapoint_class": 14, "frequenc": [14, 20, 46, 48, 53, 56, 84, 89, 92, 93], "domain": [14, 15, 16, 19, 20, 21, 22, 31, 46, 56, 89, 92, 93], "emdata": [14, 15, 20], "measur": [14, 15, 16, 19, 20, 21, 22, 44, 45, 49, 53, 92], "electromagnet": [14, 44, 92], "east": [14, 15, 16, 17, 19, 20, 21, 22, 73, 74, 75, 79, 80, 85], "north": [14, 15, 16, 17, 19, 20, 21, 22, 74, 75, 79, 80], "uncertainti": [14, 17, 19, 49], "co": [14, 15, 16, 17, 19, 20, 21, 22, 25, 27, 31, 83], "ground": [14, 15, 16, 17, 19, 21, 22, 53, 54], "sea": [14, 17], "level": [14, 17, 49], "ones": [14, 17, 19, 35, 83], "fdemsystem": [14, 20, 44, 52], "acquisit": [14, 17, 19, 42, 44, 52], "loop": [14, 15, 16, 19, 20, 21, 22, 43, 44, 46, 52, 53], "orient": [14, 19, 20, 21, 22, 42, 43, 44, 48, 52], "associ": [14, 15, 16, 17, 19, 20, 31, 43], "calibr": [14, 15, 16, 17, 31, 43, 49], "parent": [14, 15, 16, 17, 19, 20, 21, 24, 25, 26, 27, 31, 42, 43, 63, 64, 65], "mod": [14, 52, 53, 54, 78, 79], "getfrequ": [14, 20], "channel": [14, 15, 16, 17, 19, 20, 21, 22], "getmeasurementtyp": [14, 20], "phase": [14, 20, 52], "quadratur": [14, 15, 16, 20, 52], "em": [14, 15, 16, 17, 31, 38, 42, 43, 44, 52, 53, 54], "with_error_bar": [14, 15], "inphas": [14, 15, 16], "select": 14, "errorbar": 14, "arguement": 14, "plot_predict": [14, 19, 21, 22, 52, 53, 54], "semilogx": 14, "sensit": [14, 15, 52, 53, 54], "sensitivti": [14, 15], "updatesensit": 14, "containin": 14, "primary_field": [15, 16, 21, 54], "secondary_field": [15, 16, 21, 54], "relative_error": [15, 16, 19, 22, 52, 53, 54], "additive_error": [15, 16, 19, 22, 52, 53, 54], "predicted_primary_field": [15, 16, 21], "predicted_secondary_field": [15, 16, 21], "transmitter_loop": [15, 16], "receiver_loop": [15, 16], "error": [15, 16, 17, 19, 21, 22, 25, 31, 43, 49, 52, 53, 54, 63, 64, 65, 70], "tdemsystem": [15, 16, 45, 53], "emloop": [15, 16, 42, 46], "transmitt": [15, 16, 19, 20, 21, 22, 43, 44, 52, 53], "sound": [15, 16, 21, 22, 53], "These": [15, 16, 48, 49, 60, 73, 78, 83], "unpack": [15, 16], "_data": [15, 16], "gate": [15, 16, 21, 22, 53], "dualmoment": 15, "iplotact": 15, "off_tim": [15, 21, 45, 53], "propsal": [15, 16, 17, 31, 43], "newheight": [15, 16, 17], "newrelativeerror": [15, 16, 17], "newadditiveerror": [15, 16, 17], "newcalibr": [15, 16, 17], "boolean": [15, 16, 17, 31, 43], "request": [15, 16, 17, 31, 33, 35, 43], "reerr": [15, 16, 17, 31, 43], "aeerr": [15, 16, 17, 31, 43], "datafilenam": [15, 19, 20, 21, 22], "moment": [15, 20, 40, 42, 43, 44, 52], "ix": 15, "model_chang": 15, "set_posterior": [15, 16, 17, 52, 53, 54, 73, 78], "set_propos": [15, 16, 17, 24, 29, 52, 53, 54, 73, 78], "relative_error_propos": [15, 16, 17, 54], "additive_error_propos": [15, 16, 17], "heightpropos": [15, 16, 17], "basedistribut": [15, 16, 17, 33, 36, 37, 38, 39, 41], "univari": [15, 16, 17, 37, 83], "relativeerrorpropos": [15, 16, 17], "multivari": [15, 16, 17, 36, 52, 53, 54], "additiveerrorpropos": [15, 16, 17], "behaviour": [15, 16], "averag": [15, 16], "v0": [15, 16], "ln": [15, 16], "1m": [15, 16, 21], "relativeerr": [15, 16], "fraction": [15, 16], "percentag": [15, 16, 35, 49], "additiveerr": [15, 16], "valueerror": [15, 16, 31], "well": [15, 16, 17, 19, 21, 24, 25, 27, 29, 31, 42, 43, 48], "tempest": [16, 56, 63, 64, 67, 72, 89, 93], "set_additive_error_posterior": [16, 17], "set_relative_error_posterior": [16, 17], "nchannel": [17, 19, 21], "nchannelspersystem": [17, 19, 21], "ppm": 17, "data_misfit": [17, 19, 52, 53, 54], "l_": [17, 19], "squar": [17, 19], "mathbf": [17, 19], "_": [17, 19, 52, 53, 54, 63, 64, 65, 68, 69, 70, 73, 74, 83, 84, 85, 86], "d": [17, 19, 20, 31, 33, 52, 57], "ob": [17, 19], "pre": [17, 19], "deltad": [17, 19], "delta": [17, 19, 24], "residu": [17, 19, 54], "likelihood": [17, 52, 53, 54], "d0": [17, 35], "d1": [17, 35], "dn": [17, 35], "conveni": [17, 35], "port": [17, 35], "matlab": [17, 35], "standard_norm": 17, "That": [17, 35], "consist": [17, 35, 53], "default_rng": 17, "instanc": 17, "pleas": [17, 48], "quick": [17, 52, 53, 54, 83], "posit": [17, 52, 53, 84], "int_lik": 17, "varianc": [17, 24, 29, 36, 37, 49, 52, 53, 54, 83], "randomli": [17, 49, 78], "were": 17, "suppli": 17, "accept": [17, 53, 54], "mu": 17, "sigma": [17, 24, 29], "1923875335537315": 17, "four": [17, 24, 49], "25": [17, 24, 29, 73, 78, 83], "49401501": 17, "00950034": 17, "81814867": 17, "29718677": 17, "39924804": 17, "68456316": 17, "99394529": 17, "84057254": 17, "data_class": 19, "xyz": [19, 20], "dataunit": 19, "npoint": [19, 20, 21, 22, 31], "statarrayor": 19, "logic": 19, "inact": 19, "addtovtk": 19, "vtk": [19, 27, 31, 75, 79, 80, 85, 86], "prop": 19, "member": 19, "pyvtk": [19, 31], "vtkdata": [19, 31], "vtkstructur": [19, 31], "pointcloud3d": [19, 20, 21, 31], "channel_index": 19, "mapdata": 19, "mappredicteddata": 19, "mapstd": 19, "npointsperlin": 19, "plot_data": [19, 20, 21, 22], "xaxi": [19, 20, 21, 22, 25, 26, 27, 31, 74], "r2d": [19, 20, 21, 31], "r3d": [19, 20, 21, 31], "arraylik": 19, "chosen": [19, 29], "nolegend": [19, 21], "read_csv": [19, 20, 21, 22, 31, 52], "data_filenam": [19, 21, 22, 49, 63, 64, 65], "systemfilenam": [19, 20, 21, 22, 45], "accord": [19, 21, 22], "least": [19, 21, 22, 49], "follow": [19, 20, 21, 22, 24, 25, 48, 49, 53, 74], "altern": [19, 21, 22, 25], "fid": [19, 20, 21, 22], "uniqu": [19, 21, 22], "dtm": [19, 20, 21, 22], "dem_elev": [19, 20, 21, 22], "dem_np": [19, 21, 22], "topo": [19, 21, 22], "alt": [19, 20, 21, 22], "laser": [19, 20, 21, 22], "bheight": [19, 20, 21, 22], "coil": [19, 21, 22, 44], "nwindow": [19, 21, 22], "omit": [19, 21, 22], "txpitch": [19, 21, 22], "pitch": [19, 21, 22, 42, 43, 52, 54], "txroll": [19, 21, 22], "txyaw": [19, 21, 22], "yaw": [19, 21, 22, 42, 43, 52], "rxpitch": [19, 21, 22], "rxroll": [19, 21, 22], "rxyaw": [19, 21, 22], "offerr": [19, 21, 22], "erroff": [19, 21, 22], "displai": [19, 21, 25, 26, 27, 49, 68, 69, 70, 85], "fdemdata_class": 20, "fourier": 20, "electro": [20, 21, 22], "magnet": [20, 21, 22, 53], "nfrequenc": 20, "fd": [20, 52], "structur": [20, 24, 29, 31, 44, 49, 78], "q": [20, 29], "subsequ": [20, 44], "freq": [20, 44], "tor": [20, 44], "tmom": [20, 44], "tx": [20, 44], "ty": [20, 44, 68, 69, 70], "tz": [20, 44], "ror": [20, 44], "rmom": [20, 44], "rx": [20, 44], "ry": [20, 44], "rz": [20, 44], "378": [20, 44], "93": [20, 44], "1776": [20, 44, 52], "91": [20, 44, 52, 84], "reciev": [20, 43, 44], "datafil": [20, 52, 53, 54], "systemfil": [20, 52, 53, 54], "d2": 20, "asarrai": [20, 52, 83, 86], "except": [20, 21, 24, 63, 64, 65, 68, 69, 70], "neither": [20, 21], "fileinform": [20, 21, 31, 44], "nactivedata": 20, "plotlin": 20, "readaarhusfil": 20, "aarhu": 20, "workbench": 20, "both": [20, 24, 27, 45, 48, 49, 52, 53, 66, 89], "fdem": 20, "alia": [20, 21, 22], "ntime": [21, 22], "nsystem": [21, 22], "nsystemsx1": [21, 22], "estimateadditiveerror": 21, "late": 21, "static": 21, "mapchannel": 21, "yaxi": [21, 25], "system_filenam": [21, 22, 45, 49, 63, 64, 65], "tdemdata": [22, 23, 49, 53], "read_netcdf": 22, "tempest_datapoint": 22, "fdemdata": [23, 49, 52], "tempestdata": [23, 54], "rectilinearmesh1d_class": 24, "rectilinear": [24, 25, 26, 27, 77, 82, 89, 93], "width": [24, 25, 27, 73, 78], "relativeto": [24, 25, 26, 27, 84], "cell": [24, 25, 26, 27, 29, 31, 73, 74, 75, 78, 79, 80, 84], "edgesmin": [24, 25], "edgesmax": [24, 25], "outermost": [24, 25, 27], "intern": [24, 35, 38, 49], "cellindex": [24, 25], "clip": [24, 25, 27, 31, 49], "fall": 24, "negat": [24, 25, 27], "wont": [24, 25, 27], "delete_edg": 24, "froma": 24, "gradient": [24, 29, 73, 78], "nabla_": [24, 29], "layer": [24, 29, 49, 52, 53, 54, 73, 78], "frac": [24, 52, 53, 54, 78, 83], "sigma_": 24, "h_": 24, "thick": [24, 29, 49], "z_": 24, "k_": 24, "far": 24, "greater": [24, 29], "expect": [24, 68, 69, 70], "final": [24, 29, 31, 48, 49], "solut": 24, "hdfname": 24, "reprodic": 24, "in_bound": [24, 25], "insert_edg": 24, "map_to_pdf": 24, "hitmap": [24, 29, 35, 78], "depth": [24, 29, 35, 49, 52, 68, 69, 70, 73, 74, 75, 78, 80, 83], "correctli": [24, 48], "mask_cel": [24, 25, 73, 74], "further": [24, 25], "awai": [24, 25, 31], "remap": [24, 25, 29, 78], "origin": [24, 25, 35], "expand": [24, 25, 73, 74], "out_valu": [24, 25], "mesg": 24, "correspond": [24, 35], "birth": [24, 29], "death": [24, 29], "No": 24, "noth": 24, "set_prior": [24, 29, 52, 53, 54, 73, 78], "again": 24, "cycl": [24, 29], "begin": 24, "thu": 24, "prevent": [24, 49], "never": [24, 83], "piecewise_constant_interpol": 24, "anoth": [24, 83], "rectilinearmesh": 24, "manner": 24, "ncell": [24, 25, 26, 27, 52, 73, 74, 75, 78, 80], "rectilinearmeshnd": 24, "plotgrid": [24, 25, 27, 73, 74, 75, 78], "equat": [24, 83], "model1d": [24, 29, 78], "boldsymbol": [24, 29], "here": [24, 48, 53, 60, 73, 83, 92], "summat": 24, "comon": [24, 29], "n_cells_prior": 24, "edges_prior": 24, "setup": [24, 29, 48], "explictli": 24, "uninform": 24, "uniform": [24, 33, 35, 41, 52, 53, 54, 57, 83], "quad": 24, "leq": 24, "prod_": 24, "e_": 24, "numer": [24, 25, 29], "min_edg": [24, 29, 73, 78], "max_edg": [24, 29, 73, 78], "max_cel": [24, 26, 29, 73, 78], "min_width": [24, 29], "recommend": [24, 29, 48, 49], "randomst": [24, 29, 33, 36], "edge_prior": 24, "distibut": 24, "15": [24, 29, 52, 54, 56, 74, 75, 80], "parameterpropos": [24, 29], "unperturb": 24, "back": [24, 48, 60], "previou": 24, "state": [24, 36, 78], "revers": [24, 29], "rectilinearmesh2d_class": [25, 26, 27], "There": [25, 27, 48, 49, 60, 66, 89, 92], "abscissa": [25, 27], "specifyin": [25, 27], "plane": [25, 27, 53, 74], "typic": [25, 27, 49, 83], "x_centr": [25, 27, 74], "x_edg": [25, 27, 74, 75, 79, 80, 85, 86], "y_centr": [25, 27, 74], "y_edg": [25, 26, 27, 68, 74, 75, 79, 80, 85, 86], "z_centr": [25, 27], "z_edg": [25, 27, 75, 80, 86], "rectilinearmesh1d": [25, 27, 28, 52, 53, 54, 73, 74, 78, 83, 84], "text": [25, 53, 54], "direct": [25, 27, 53, 83], "cellindic": [25, 27], "axis0": [25, 27], "axis1": [25, 27], "ravel": [25, 27], "hassames": 25, "intervalstatist": [25, 74], "dim": [25, 36, 39], "callabl": 25, "median": [25, 31, 35, 84, 85, 86], "ident": 25, "unweight": 25, "referenc": 25, "scipi": [25, 36], "stat": 25, "binned_statist": 25, "x_distanc": [25, 74], "y_distanc": [25, 74], "nedg": [25, 27], "x_indic": [25, 74], "y_indic": 25, "nnode": [25, 27], "r": [25, 26, 27, 52, 60, 73, 74, 75, 79, 80, 83, 84, 85], "zaxi": [25, 26], "plu": [25, 26], "sqrt": [25, 27, 49, 74, 75, 79, 80, 86], "plot_relative_to": 25, "ravelindic": [25, 27], "ixi": 25, "cloud": [25, 26, 27, 31], "unravelindex": [25, 27], "version": [25, 27, 49, 92], "unraveled_coord": [25, 27], "suitabl": [25, 26, 27, 49], "rectilinearmesh2d": [26, 27, 28, 73, 74, 79, 85], "stitch": 26, "relativetocentr": 27, "relativetoedg": 27, "pyvista_mesh": [27, 75, 80, 85], "pyvista": 27, "link": [27, 48], "show_edg": 27, "show_grid": 27, "local": [27, 29, 48], "xrang": 27, "zrang": 27, "rectilinearmesh2d_stitch": [28, 73], "rectilinearmesh3d": [28, 74, 75, 80, 86], "model_class": 29, "compute_local_inverse_hessian": 29, "hessian": 29, "realiz": [29, 36, 37], "gradient_prob": 29, "hmin": 29, "local_precis": 29, "local_vari": 29, "stochast": 29, "newtown": 29, "par": [29, 52, 53, 54, 78], "newton": 29, "remappedmodel": 29, "onto": 29, "perturbedmodel": 29, "solve_valu": [29, 78], "solve_gradi": [29, 49, 78], "spar": 29, "sgradient": 29, "proposal_prob": 29, "remapped_model": 29, "denomin": [29, 38], "ratio": [29, 35, 49], "m": [29, 31, 49, 52, 53, 54, 63, 64, 65, 73, 74, 75, 78, 79, 80, 83, 84, 85], "event": 29, "dure": [29, 31, 48, 49, 60], "values_prior": 29, "gradient_prior": 29, "halfspacevalu": [29, 73, 78], "parameterprior": 29, "gradientprior": 29, "parameterlimit": 29, "tune": 29, "pwheel": 29, "update_parameter_posterior": 29, "accumul": [29, 35], "minimumratio": 29, "mystart": 31, "block_indic": 31, "dx": 31, "dy": 31, "x_grid": 31, "y_grid": 31, "ly": 31, "block": 31, "across": 31, "extract": 31, "idea": 31, "pygmt": 31, "block_median": 31, "juxtapos": 31, "geobipt": 31, "block_median_indic": 31, "box": 31, "lp": 31, "getxaxi": 31, "interpcloughtoch": 31, "mc": 31, "ct": 31, "clough": 31, "tocher": 31, "curvatur": 31, "instal": [31, 47, 49, 92], "overshot": 31, "inherr": 31, "allevi": 31, "alias": 31, "move": 31, "dz": 31, "nearest": 31, "ep": 31, "radiu": [31, 42, 52], "inf": [31, 52, 53, 54, 78], "neighbour": 31, "ascii": 31, "csv": [31, 53, 54, 63, 64, 65], "set_kdtre": 31, "tree": 31, "exclud": 31, "set_x_posterior": 31, "set_y_posterior": 31, "set_z_posterior": 31, "tovtk": 31, "pointdata": 31, "save": [31, 49, 75, 80, 84, 85, 86], "readabl": 31, "smaller": 31, "distribution_class": 33, "distributiontyp": 33, "choos": [33, 49, 63, 64, 65, 68, 69, 70], "mvnormal": [33, 41, 52, 53, 54, 57, 83], "gamma": [33, 41], "categor": 33, "linspac": [33, 52, 54, 78, 83, 84, 85, 86], "To": [33, 48, 52, 73, 78], "pseudo": 33, "normaldistribut": [33, 37, 83], "mvnormaldistribut": [33, 36], "uniformdistribut": [33, 39, 83], "gammadistribut": [33, 34], "orderstatist": [33, 38], "categoricaldistribut": 33, "credible_interv": [35, 84], "90": [35, 85], "credibl": [35, 85, 86], "confid": [35, 68, 69, 70, 84], "med": 35, "high": [35, 53], "credible_rang": [35, 85], "margin": [35, 85, 86], "fit_mixture_to_pdf_1d": 35, "peak": 35, "inverv": 35, "histogram1d": 35, "95": [35, 68, 69, 70, 84, 85], "higher": [35, 83], "opaqu": [35, 68, 69, 70], "opacity_level": 35, "bottom": [35, 68, 69, 70, 85], "n_sampl": 35, "rand": 35, "random_sampl": 35, "popul": 35, "14022471": 35, "96360618": 35, "37601032": 35, "25528411": 35, "49313049": 35, "94909878": 35, "99": [36, 37, 39], "nstd": [36, 37], "discret": [36, 37, 39, 74], "holder": [36, 37, 39, 40], "children": [36, 37, 39, 40], "rng": [37, 57], "modifi": [38, 48, 53], "malinverno2002parsimoni": 38, "bayesian": 38, "markov": [38, 49, 92], "chain": [38, 49, 92], "mont": [38, 92], "carlo": [38, 92], "nonlinear": 38, "geophys": 38, "problem": 38, "journal": 38, "applic": [38, 92], "circularloop": [42, 52, 53], "set_pitch_posterior": 43, "set_roll_posterior": 43, "set_yaw_posterior": 43, "fdemsystem_class": 44, "n_frequenc": 44, "component_id": 44, "pair": 44, "appropri": [44, 83], "caus": 44, "ad": [44, 68, 69, 70], "xx": [44, 74, 75, 79, 80, 86], "tensor_id": 44, "tdemsystem_gaaem": 45, "gatdaem1d": 45, "tdaemsystem": 45, "offtim": 45, "transmitterloop": 45, "receiverloop": 45, "loopoffset": 45, "waveform": [45, 53], "offtimefilt": 45, "get_modellingtim": 45, "cover": 45, "waveformtim": 45, "measurementtim": 45, "span": 45, "measrement": 45, "circular": 46, "run": [47, 48, 52, 53, 54, 57, 66, 67, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89, 92, 93], "thing": 48, "few": [48, 63, 64, 65], "implement": [48, 92], "enabl": [48, 60, 92], "tradit": 48, "pip": 48, "io": [48, 53, 54], "clean": 48, "easier": 48, "backend": 48, "sure": [48, 63, 64, 65], "program": [48, 60, 83], "easiest": 48, "access": [48, 83], "simpli": [48, 78, 92], "clone": 48, "git": 48, "repositori": [48, 53], "navig": 48, "folder": [48, 49, 53, 66, 68, 69, 70, 89], "py": [48, 52, 53, 54, 56, 57, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 80, 82, 83, 84, 85, 86, 88, 89, 93], "abl": 48, "suffic": 48, "fine": 48, "let": [48, 68, 69, 70, 83], "sai": 48, "ran": 48, "machin": [48, 49], "capabl": 48, "your": [48, 49], "littl": 48, "trickier": 48, "openmpi": 48, "how": [48, 49, 68, 69, 70, 83], "around": [48, 78, 83], "think": 48, "prebuilt": 48, "laptop": 48, "At": 48, "worri": 48, "about": [48, 49, 52, 53, 54, 68, 69, 70, 83], "just": [48, 83], "mpicc": 48, "next": 48, "cach": 48, "dir": 48, "own": [48, 83], "mpich2": 48, "avoid": 48, "know": [48, 83], "dai": 48, "seen": 48, "configur": 48, "hdf5_dir": 48, "cc": [48, 83], "hdf5_mpi": 48, "ON": 48, "ross": [48, 53, 54], "brodi": [48, 53, 54], "geoscienc": [48, 53, 54], "australia": [48, 53, 54], "great": 48, "ga": [48, 53, 54], "go": [48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "ahead": 48, "instruct": 48, "hi": [48, 53, 54], "fftw": 48, "mac": 48, "easi": [48, 83], "manag": 48, "homebrew": 48, "brew": 48, "gcc": 48, "download": [48, 52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "tar": 48, "gz": 48, "untar": 48, "zxvf": 48, "cd": 48, "mkdir": [48, 63, 64, 65], "build": 48, "prefix": 48, "thread": 48, "makefil": 48, "gatdaem1d_python": 48, "shell": 48, "sh": 48, "suffix": 48, "cpp": 48, "cxx": 48, "cxxflag": 48, "11": [48, 53, 54, 73, 79, 83, 86], "o3": 48, "wall": 48, "fpic": 48, "fftw_dir": 48, "ldflag": 48, "bindir": 48, "srcdir": 48, "objdir": 48, "lib": [48, 68, 69, 70], "l": 48, "lfftw3": 48, "info": 48, "someth": 48, "usr": 48, "cellar": 48, "now": [48, 52, 68, 69, 70, 78], "geobipyseri": 49, "userparameterfil": 49, "redirect": 49, "whatev": [49, 83], "mpirun": 49, "geobipyparallel": 49, "script": [49, 52, 53, 54, 57, 63, 64, 65, 66, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "customiz": 49, "scipt": 49, "initialrelativeerror": 49, "minimumrelativeerror": 49, "maximumrelativeerror": 49, "initialadditiveerror": 49, "minimumadditiveerror": 49, "maximumadditiveerror": 49, "relativeerrorproposalvari": 49, "additiveerrorproposalvari": 49, "data_directori": 49, "supplementari": [49, 52, 53, 54, 63, 64, 65], "multi": 49, "skytem": [49, 56, 67, 72, 89, 93], "encompass": 49, "resolve_singl": 49, "txt": [49, 52], "fdemsystem2": [49, 52, 63], "stm": [49, 52, 53, 54, 63, 64, 65], "data_typ": [49, 63, 64, 65, 68, 69, 70], "n_markov_chain": [49, 63, 64, 65], "interact": 49, "progress": 49, "interactive_plot": 49, "update_plot_everi": 49, "png": [49, 68, 69, 70], "save_png": 49, "save_hdf5": 49, "solvabl": [49, 52, 53, 54], "solveparamet": 49, "explod": 49, "small": 49, "solvegradi": 49, "occur": [49, 83], "recov": 49, "earth": [49, 52, 53, 54], "implicit": 49, "constraint": 49, "feel": 49, "conserv": 49, "highli": 49, "magnitud": 49, "solve_paramet": 49, "solve_relative_error": 49, "solve_additive_error": [49, 54], "solve_height": 49, "solve_calibr": 49, "maximum_number_of_lay": 49, "metr": 49, "minimum_depth": 49, "maximum_depth": 49, "150": [49, 73, 78], "minimumthick": 49, "autocalcul": 49, "minimum_thick": 49, "aspect": 49, "solverelativeerror": 49, "solveadditiveerror": 49, "initial_relative_error": 49, "minimum_relative_error": 49, "001": [49, 54, 78], "maximum_relative_error": 49, "initial_additive_error": 49, "minimum_additive_error": 49, "maximum_additive_error": 49, "maximum_height_chang": 49, "relative_error_proposal_vari": 49, "5e": [49, 52, 53, 54], "additive_error_proposal_vari": [49, 54], "0e": 49, "height_proposal_vari": 49, "01": [49, 52, 53, 54, 63, 64, 65, 67, 78, 88, 93], "evolut": 49, "manipul": 49, "probability_of_birth": 49, "probablitii": 49, "probability_of_death": 49, "probability_of_perturb": 49, "probability_of_no_chang": 49, "rho": 49, "resist": 49, "gradient_standard_devi": 49, "covari": 49, "covariance_sc": 49, "contrast": 49, "clip_ratio": 49, "ignore_likelihood": 49, "parameter_limit": 49, "reciprocate_paramet": 49, "timedomain": 49, "datainit": 49, "00": [51, 56, 59, 62, 63, 64, 65, 67, 72, 77, 82, 88, 91, 93], "000": [51, 62, 67, 91, 93], "execut": [51, 56, 59, 60, 62, 67, 72, 77, 82, 88, 91, 93], "mem": [51, 56, 59, 62, 67, 72, 77, 82, 88, 91, 93], "full": [52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "join": [52, 53, 54, 63, 64, 65], "characterist": 52, "hz": [52, 53], "geometeri": 52, "380": 52, "3345": 52, "8171": 52, "41020": 52, "129550": 52, "usual": 52, "r_": [52, 53, 54], "03": [52, 53, 56, 77, 82, 88, 93], "89": 52, "And": [52, 57, 78, 83], "145": 52, "435": 52, "260": 52, "875": 52, "1502": 52, "1516": 52, "217": 52, "412": 52, "178": 52, "516": 52, "405": 52, "255": 52, "fdp": 52, "our": [52, 53, 54], "store": [52, 53, 54, 60, 63, 64, 65, 68, 69, 70], "pull": [52, 53, 54], "ref": [52, 53, 54], "datafold": [52, 53, 54], "resolve2": 52, "prepar": [52, 53, 54], "_initialize_sequential_read": [52, 53, 54, 63, 64, 65], "_read_record": [52, 53, 54], "resolv": [52, 64, 65, 67, 72, 89, 93], "19": [52, 78], "121": [52, 53, 54, 73, 74, 78, 79, 83, 85], "122": [52, 53, 54, 73, 74, 78, 79, 83, 85], "tight_layout": [52, 53, 54, 83], "j": [52, 53, 54], "descriptor": [52, 83], "pcg64dxsm": [52, 53, 54, 57, 68, 69, 70, 73, 78, 83], "mvlognorm": [52, 53, 54], "u": [52, 53, 54, 74, 83], "Or": [52, 53, 54, 73, 78, 83], "200": [52, 53, 54, 83], "respons": [52, 53, 54], "nois": [52, 53, 54], "floor": [52, 53, 54], "zprior": 52, "relativeprior": [52, 53], "additiveprior": [52, 53], "z_prior": [52, 53], "relative_error_prior": [52, 53, 54], "additive_error_prior": [52, 53], "z_propos": [52, 53], "relativepropos": [52, 53], "additivepropos": [52, 53], "1e": [52, 53, 54], "With": [52, 53, 54], "record": [52, 53, 54, 78], "fig": [52, 68, 69, 70, 73, 78], "h5": [52, 60, 68, 69, 70, 73, 74, 75, 79, 80, 83, 84, 85], "fdp1": 52, "fdp2": 52, "733": 52, "5454886696688": 52, "1367": 52, "81945885548": 52, "097701": 52, "45286": 52, "828623928755": 52, "minut": [52, 53, 54, 57, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86], "395": [52, 56], "jupyt": [52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "notebook": [52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "plot_resolve_datapoint": [52, 56, 93], "galleri": [52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89, 93], "sphinx": [52, 53, 54, 57, 60, 63, 64, 65, 68, 69, 70, 73, 74, 75, 78, 79, 80, 83, 84, 85, 86, 89], "credit": [53, 54], "thank": [53, 54], "airborn": [53, 54], "geoscienceaustralia": [53, 54], "aem": [53, 54], "dieter": [53, 54], "werthmul": [53, 54], "empymod": [53, 54], "help": [53, 54, 63, 64, 65], "readi": [53, 54], "incorpor": [53, 54], "squareloop": 53, "butterworth": 53, "skytem_512_saline_clai": 53, "skytemhm_512": [53, 64], "skytemlm_512": [53, 64], "tdp": [53, 54], "_file": 53, "500": 53, "nfok": [53, 68, 69, 70], "354": 53, "runtimewarn": [53, 68, 69, 70], "encount": [53, 68, 69, 70], "plotdataresidu": [53, 54], "14": [53, 83, 85, 88], "13": [53, 54, 73, 78, 83], "324824": 53, "70759632764": 53, "652129": 53, "2354668385": 53, "01047616": 53, "19992": 53, "94964076136": 53, "16": [53, 54, 68, 69, 70, 93], "linearspac": [53, 78], "priorss": 53, "reject": [53, 54], "aarhusinv": 53, "tem": 53, "reflect": 53, "semicolon": 53, "xutm": 53, "yutm": 53, "stationnumb": 53, "sourcetyp": 53, "rectangular": 53, "polar": 53, "field": [53, 54], "utm": 53, "center": 53, "definit": 53, "amplitud": 53, "333e": 53, "033e": 53, "4e": 53, "06": [53, 63, 67, 93], "Not": 53, "12": [53, 54, 70, 72, 74, 83, 93], "cutoff": 53, "5e5": 53, "pertain": 53, "346": [53, 56], "plot_skytem_datapoint": [53, 56, 93], "temdatapoint": 54, "tempest_saline_clai": 54, "146100583096709124601953385843316024947": [54, 63, 64, 65], "50": [54, 63, 68, 69, 70, 83], "logspac": [54, 73, 74, 84], "350": 54, "31": [54, 86], "primari": 54, "sx": 54, "sz": 54, "suptitl": [54, 68, 69, 70, 85, 86], "fm_dlogc": 54, "sensitivity_matrix": 54, "34": 54, "27253219": 54, "17": [54, 64], "55503397": 54, "50040745": 54, "57068627": 54, "01534336": 54, "33251557": 54, "29674627": 54, "15444462": 54, "46667394": 54, "43233932": 54, "84850348": 54, "04330666": 54, "76773288": 54, "54604945": 54, "13463137e": 54, "49920887e": 54, "76789170e": 54, "01809840e": 54, "09": 54, "13341751e": 54, "27489718e": 54, "09383016e": 54, "02": [54, 67, 77, 78], "20412212e": 54, "74815387e": 54, "02489023e": 54, "15994185e": 54, "25910166e": 54, "04188675e": 54, "61552555e": 54, "45575508e": 54, "03167228e": 54, "18645190e": 54, "24296662e": 54, "20880061e": 54, "13758034e": 54, "04": [54, 56, 59, 77, 82], "79138645e": 54, "62044639e": 54, "91310127e": 54, "83737910e": 54, "95655826e": 54, "25753935e": 54, "87713313e": 54, "33418159e": 54, "26727066e": 54, "05451995e": 54, "60007270e": 54, "08385747e": 54, "05626410e": 54, "28316523e": 54, "11041966e": 54, "41585978e": 54, "secondari": 54, "hstack": [54, 84], "011474": 54, "012810": 54, "008507": 54, "005154": 54, "004742": 54, "004477": 54, "004168": 54, "003539": 54, "003352": 54, "003213": 54, "003161": 54, "003122": 54, "002587": 54, "002038": 54, "002201": 54, "007383": 54, "005693": 54, "005178": 54, "003659": 54, "003426": 54, "003046": 54, "003095": 54, "003247": 54, "002775": 54, "002627": 54, "002460": 54, "002178": 54, "001754": 54, "001405": 54, "001283": 54, "35698": 54, "4834358605": 54, "71558": 54, "40557872524": 54, "plot_secondary_field": 54, "plot_predicted_secondary_field": 54, "relative_prior": 54, "receiver_x_prior": 54, "receiver_z_prior": 54, "receiver_pitch_prior": 54, "01830738": 54, "relative_propos": 54, "receiver_x_propos": 54, "receiver_z_propos": 54, "receiver_pitch_propos": 54, "060": [54, 56], "plot_tempest_datapoint": [54, 56, 93], "801": 56, "08": [56, 88], "cp": 57, "grab": 57, "line2d": 57, "0x7fbf52a35c00": 57, "64050649": 57, "77177243": 57, "34500474": 57, "01010101": 57, "02020202": 57, "03030303": 57, "04040404": [57, 85], "05050505": 57, "06060606": 57, "07070707": 57, "08080808": 57, "09090909": 57, "1010101": 57, "11111111": 57, "12121212": 57, "13131313": 57, "14141414": 57, "15151515": 57, "16161616": 57, "17171717": 57, "18181818": 57, "19191919": 57, "2020202": 57, "21212121": 57, "22222222": 57, "23232323": [57, 85], "24242424": 57, "25252525": [57, 85], "26262626": 57, "27272727": 57, "28282828": 57, "29292929": 57, "3030303": 57, "31313131": [57, 85], "32323232": 57, "33333333": 57, "34343434": 57, "35353535": 57, "36363636": 57, "37373737": 57, "38383838": 57, "39393939": [57, 85], "4040404": 57, "41414141": 57, "42424242": 57, "43434343": 57, "44444444": 57, "45454545": 57, "46464646": 57, "47474747": 57, "48484848": 57, "49494949": 57, "50505051": 57, "51515152": 57, "52525253": 57, "53535354": 57, "54545455": 57, "55555556": 57, "56565657": 57, "57575758": 57, "58585859": 57, "5959596": 57, "60606061": 57, "61616162": 57, "62626263": 57, "63636364": 57, "64646465": 57, "65656566": 57, "66666667": 57, "67676768": 57, "68686869": 57, "6969697": 57, "70707071": 57, "71717172": 57, "72727273": 57, "73737374": 57, "74747475": 57, "75757576": 57, "76767677": [57, 85], "77777778": 57, "78787879": 57, "7979798": [57, 85], "80808081": 57, "81818182": 57, "82828283": 57, "83838384": 57, "84848485": 57, "85858586": 57, "86868687": 57, "87878788": 57, "88888889": 57, "8989899": 57, "90909091": 57, "91919192": 57, "92929293": 57, "93939394": 57, "94949495": 57, "95959596": [57, 85], "96969697": 57, "97979798": 57, "98989899": 57, "664": [57, 59], "plot_distribut": [57, 59, 93], "infer": [60, 63, 64, 65, 72, 78, 93], "common": 60, "bottleneck": 60, "leverag": 60, "capabililti": 60, "api": [60, 92], "create_hdf": 60, "write_hdf": 60, "read_hdf": 60, "later": [60, 68, 69, 70], "perhap": 60, "duplic": 60, "similarli": [60, 83], "pathlib": [63, 64, 65], "datetim": [63, 64, 65], "timedelta": [63, 64, 65], "inference3d": [63, 64, 65], "user_paramet": [63, 64, 65], "checkcommandargu": [63, 64, 65], "argpars": [63, 64, 65, 69, 70], "filterwarn": [63, 64, 65, 70], "parser": [63, 64, 65], "argumentpars": [63, 64, 65], "formatter_class": [63, 64, 65], "argumentdefaultshelpformatt": [63, 64, 65], "add_argu": [63, 64, 65], "job": [63, 64, 65], "18": [63, 64, 65], "skytem_512": [63, 64, 65, 69], "glacial": [63, 64, 65, 68, 69, 70], "saline_clai": [63, 64, 65, 68, 69, 70], "resistive_dolomit": [63, 64, 65, 68, 69, 70], "resistive_bas": [63, 64, 65, 68, 69, 70], "coastal_salt_wat": [63, 64, 65, 68, 69, 70], "ice_over_salt_wat": [63, 64, 65, 68, 69, 70], "parse_arg": [63, 64, 65], "getcwd": [63, 64, 65], "model_typ": [63, 64, 65, 68, 69, 70], "file_path": [63, 64, 65], "exist_ok": [63, 64, 65], "listdir": [63, 64, 65], "isfil": [63, 64, 65], "islink": [63, 64, 65], "unlink": [63, 64, 65], "output_directori": [63, 64, 65], "parameter_fil": [63, 64, 65], "options_fil": [63, 64, 65], "_option": [63, 64, 65], "inputfil": [63, 64, 65], "assert": [63, 64, 65], "cannot": [63, 64, 65, 69, 70], "produc": [63, 64, 65, 68, 69, 70, 83], "5000": [63, 64, 65], "everyon": [63, 64, 65], "earli": [63, 64, 65], "track": [63, 64, 65], "t0": [63, 64, 65], "create_hdf5": [63, 64, 65], "h": [63, 64, 65, 84, 85, 86], "resolve_opt": 63, "resolve_glaci": 63, "79": [63, 64, 65], "110918": [], "acc": [63, 64, 65], "007": 63, "35": [], "769": [], "elaps": [63, 64, 65], "remain": [63, 64, 65], "36": 83, "881318": [], "eta": [63, 64, 65], "293773": [], "37": 63, "plot_inference_1d_resolv": [63, 67, 93], "skytem_512_opt": 64, "skytem_512_glaci": 64, "194163": [], "440": 64, "012": 64, "59": [], "005": [], "175189": [], "725063": [], "425": [], "plot_inference_1d_skytem": [64, 67, 93], "tempest_opt": 65, "tempest_glaci": 65, "288962": [], "27": [65, 88], "680": 65, "015": [65, 74, 77], "76": 65, "332740": [], "777580": [], "020": [], "plot_inference_1d_tempest": [65, 67, 93], "coupl": [66, 89], "skytem_opt": [66, 89], "shown": [66, 89], "54": [], "857": [], "inference_1d": [67, 93], "miniconda3": [68, 69, 70], "python3": [68, 69, 70], "site": [68, 69, 70], "2039": [68, 69, 70], "invalid": [68, 69, 70], "double_scalar": [68, 69, 70], "_mtx": [68, 69, 70], "372": [68, 69, 70], "x0": [68, 69, 70], "y0": [68, 69, 70], "x1": [68, 69, 70], "y1": [68, 69, 70], "inference2d": [68, 69, 70], "plot_2d_summari": [68, 69, 70], "handler": [68, 69, 70], "inferecexd": [68, 69, 70], "longer": [68, 69, 70], "precomput": [68, 69, 70], "expens": [68, 69, 70], "results_2d": [68, 69, 70], "jet": [68, 69, 70, 83], "figsiz": [68, 69, 70, 78, 85], "gs0": [68, 69, 70], "add_gridspec": [68, 69, 70, 78], "ax1": [68, 69, 70, 83], "add_subplot": [68, 69, 70], "true_model": [68, 69, 70], "create_synthetic_model": [68, 69, 70], "vmin": [68, 69, 70], "vmax": [68, 69, 70], "plot_data_elev": [68, 69, 70], "linewidth": [68, 69, 70, 74, 83], "plot_elev": [68, 69, 70], "ylim": [68, 69, 70], "240": [], "60": [64, 68, 69, 70], "plot_mean_model": [68, 69, 70], "usevari": [68, 69, 70], "plot_mode_model": [68, 69, 70], "use_vari": [68, 69, 70], "doi": [68, 69, 70], "compute_doi": [68, 69, 70], "313": [68, 69, 70, 74], "mask_below_doi": [68, 69, 70], "plot_k_lay": [68, 69, 70], "sharex": [68, 69, 70, 83, 85], "plot_best_model": [68, 69, 70], "del": [68, 69, 70], "plot_percentil": [68, 69, 70], "interest": [68, 69, 70], "plot_confid": [68, 69, 70], "cross": [68, 69, 70], "wash": [68, 69, 70], "clim_scal": [68, 69, 70], "me": [68, 69, 70], "satur": [68, 69, 70], "plot_interfac": [68, 69, 70], "grei": [68, 69, 70], "plot_entropi": [68, 69, 70], "savefig": [68, 69, 70], "dpi": [68, 69, 70], "__main__": [68, 69, 70], "parallel_infer": [68, 69, 70], "24": [68, 72, 83, 93], "010": [], "plot_inference_2d_resolv": [68, 72, 93], "550": [69, 70], "693": [], "plot_inference_2d_skytem": [69, 72, 93], "364": [], "plot_inference_2d_tempest": [70, 72, 93], "48": 72, "066": [], "inference_2d": [72, 93], "analysi": [72, 89, 93], "cumsum": [73, 74, 83, 84], "rm": [73, 74, 75, 79], "rm_mask": [73, 74], "arr2": [73, 74], "rm1d": 73, "rm1": [73, 75], "rm2": [73, 74, 75], "131": [73, 74, 78, 83, 85], "132": [73, 74, 78, 83, 85], "133": [73, 74, 78, 83, 85], "n_cell": 73, "fill_valu": [73, 78], "338200594791775": [73, 78], "rm0": 73, "_init_posterior_plot": 73, "xlabel": [68, 69, 70, 73, 74, 80, 84, 85], "ylabel": [68, 69, 70, 73, 74, 80, 84, 85], "tmp": [73, 83], "711": [73, 77], "plot_rectilinear_mesh_1d": [73, 77, 93], "straight": [74, 75, 79, 80], "boundari": [74, 75, 79, 80], "emb": 74, "horiztont": 74, "cartesian": 74, "character": 74, "intersect": 74, "multiseg": 74, "line_indic": 74, "0x7fbfa25ab9d0": 74, "0x7fbfa25a9480": 74, "yy": [74, 75, 79, 80, 86], "meshgrid": [74, 75, 79, 80, 86], "sin": [74, 75, 79, 80, 86], "xg": 74, "xgradientmatrix": 74, "zg": 74, "ygradientmatrix": 74, "dax": 74, "reshap": 74, "z_indic": 74, "newaxi": 74, "40": [74, 83], "retriev": 74, "rm3": [74, 75], "rm4": [74, 75], "resampl": [74, 79], "values2": 74, "0x7fbf62976530": 74, "0x7fbf629765c0": 74, "x_log": 74, "y_log": 74, "rm2d": 74, "211": [74, 83, 84], "212": [74, 83, 84], "0x7fbf629922f0": 74, "0x7fbf629916c0": 74, "x_relative_to": [74, 75, 80, 85, 86], "y_relative_to": [74, 75, 80, 85, 86], "311": 74, "312": 74, "plot_rectilinear_mesh_2d": [74, 77, 93], "231": [75, 80], "232": [75, 80], "233": [75, 80], "234": [75, 80], "235": [75, 80], "236": [75, 80], "rm3d": 75, "z_re": [75, 80, 86], "z_relative_to": [75, 80, 86], "pv": [75, 79, 80], "pyvista_plott": [75, 79, 80], "rm3d_re1": 75, "x_re": [75, 80, 86], "rm3d_re2": 75, "y_re": [75, 80, 86], "rm3d_re3": 75, "rm3d_read": 75, "318": [75, 77], "plot_rectilinear_mesh_3d": [75, 77, 93], "044": 77, "nlayer": 78, "thk": 78, "value_mean": 78, "780269280707714": 78, "ppropos": 78, "lognorm": 78, "03751254813826": 78, "stochasit": 78, "mod0": 78, "1001": 78, "rememb": 78, "gray_r": [78, 85, 86], "logx": 78, "sharei": [68, 69, 70, 78, 83, 85], "credible_interval_kwarg": 78, "plotcredibleinterv": [78, 84, 85], "nrow": 78, "ncol": 78, "edges_kwarg": 78, "parameter_kwarg": 78, "092": [78, 82], "plot_model_1d": [78, 82, 93], "mod2": 79, "mod3": 79, "to_vtk": [79, 86], "model3d": [79, 80], "model2d": 79, "249": [79, 82], "plot_model_2d": [79, 82, 93], "n3d": 80, "nthi": 80, "model1": 80, "model2": 80, "model3": 80, "model4": 80, "0x7fbf544e80a0": 80, "0x7fbf544eb100": 80, "0x7fbf531d48e0": 80, "0x7fbf531d5f30": 80, "model3d_re1": 80, "0x7fbf62995a50": 80, "0x7fbf62995930": 80, "model3d_re2": 80, "0x7fbf62977460": 80, "0x7fbf629755d0": 80, "model3d_re3": 80, "mesh3d": 80, "mesh2": 80, "mesh3d_read": 80, "908": [80, 82], "plot_model_3d": [80, 82, 93], "infinit": [82, 89, 93], "style": 83, "seaborn": 83, "pastel": 83, "45": 83, "454": 83, "0x7fbf40481ac0": 83, "has_posterior": [83, 84], "0x7fbf52997540": 83, "0x7fbf52997f40": 83, "57912126": 83, "5791212563194518": 83, "won": 83, "much": 83, "better": 83, "believ": 83, "standpoint": 83, "en": 83, "wikipedia": 83, "org": 83, "wiki": 83, "prior_prob": 83, "metropoli": 83, "e2": 83, "80": 83, "93hastings_algorithm": 83, "consider": 83, "therefor": 83, "itself": 83, "1375024404290368": 83, "stand": 83, "simultan": 83, "satisfi": 83, "04095499": 83, "draw": 83, "38188467": 83, "38188466718060166": 83, "sens": 83, "3912195449832787": 83, "essenti": 83, "28": [67, 83], "999": [70, 72, 83, 93], "998": 83, "21": [83, 86, 93], "32": 83, "49": 83, "997": 83, "simplest": 83, "marker": 83, "quickli": 83, "graph": 83, "neat": 83, "trick": 83, "distort": 83, "realli": 83, "highlight": 83, "log2": 83, "edgecolor": 83, "notic": 83, "affect": 83, "explicitli": 83, "ceil": 83, "legend_s": 83, "Of": 83, "cours": 83, "still": 83, "221": [83, 84], "222": [83, 84], "223": [83, 84], "224": [83, 84], "compress": 83, "1dtest": 83, "wrote": 83, "pointer": 83, "0x7fbf53e697c0": 83, "nshape": 83, "nvalu": 83, "09261046": 83, "62871503": 83, "44062655": 83, "85936645": 83, "70901278": 83, "25472331": 83, "26548023": 83, "10173015": 83, "75511239": 83, "10859768": 83, "02367524": 83, "46045955": 83, "19867799": 83, "05990528": 83, "25505206": 83, "09695121": 83, "36113261": 83, "77678945": 83, "15214478": 83, "27318879": 83, "40283027": 83, "17158128": 83, "43057124": 83, "32814672": 83, "61189822": 83, "6826707": 83, "77990983": 83, "21618644": 83, "82026928": 83, "0003221": 83, "65143168": 83, "01615216": 83, "77440758": 83, "92409722": 83, "1278735": 83, "37382774": 83, "nmin": 83, "701988729724111": 83, "nmax": 83, "7179942041156253": 83, "nhas_posterior": 83, "come": [83, 92], "101": [83, 84], "mm": 83, "51": 83, "eleph": 83, "potenti": 83, "s_": [83, 86], "186": [83, 88], "plot_statarrai": [83, 88, 93], "effici": [84, 85, 86], "pmf": [84, 85], "plotmean": [84, 85], "plotmedian": [84, 85], "030000000000000027": 84, "9499999999999997": 84, "irregularli": 84, "irregularbin": 84, "h1d": 84, "h1": [84, 85], "h2": [84, 85], "h3": 84, "h4": 84, "0x7fbfa200e340": 84, "97": 84, "85": 84, "9699999999999998": 84, "0x7fbfa200d6c0": 84, "94": 84, "88": 84, "0x7fbfa1fb06c0": 84, "0x7fbfa200f2c0": 84, "87": 84, "293": [84, 88], "plot_histogram_1d": [84, 88, 93], "105": 85, "1000000": 85, "0x7fbf619a2110": 85, "0x7fbf619a2680": 85, "overlain": 85, "sphinx_gallery_thumbnail_numb": 85, "wspace": 85, "hspace": [68, 69, 70, 85], "xtick": 85, "ytick": 85, "spine": 85, "set_vis": 85, "0x7fbf71b42410": 85, "anim": [85, 86], "mp4": [85, 86], "h2d": 85, "0x7fbfa24cac80": 85, "0x7fbfa24c9b70": 85, "0x7fbf53b9a650": 85, "h3d_read": 85, "930": [85, 88], "plot_histogram_2d": [85, 88, 93], "100000": 86, "h3d": 86, "325": [86, 88], "plot_histogram_3d": [86, 88, 93], "735": 88, "examples_python": 89, "examples_jupyt": 89, "formul": 92, "subsurfac": 92, "outsid": 92, "develop": 92, "mainli": 92, "pgeobipi": 92, "codebas": 92, "417": [], "channel_nam": [13, 17, 19], "650509": 63, "42": 63, "520": 63, "213": 63, "39": 63, "027413": 63, "258949": 63, "537": 63, "171754": 64, "254": 64, "423246": 64, "141082": 64, "343": [64, 67, 93], "360661": 65, "969": 65, "267442": 65, "26": 65, "089147": 65, "22": [65, 67, 93], "225": [65, 67, 93], "568": 67, "wrap_clabel": [68, 69, 70], "160": 68, "set_titl": [68, 69, 70], "wrap_ylabel": [68, 69, 70], "ll": [68, 69, 70], "bb": [68, 69, 70], "ww": [68, 69, 70], "hh": [68, 69, 70], "get_posit": [68, 69, 70], "set_posit": [68, 69, 70], "plot_channel_satur": [68, 69, 70], "plot_burned_in": [68, 69, 70], "underlai": [68, 69, 70], "877": [68, 72, 93], "finit": [69, 70], "ma": [69, 70], "maskedarrai": [69, 70], "130": [69, 72, 93], "006": 72, "574": 93}, "objects": {"geobipy.src.base.HDF": [[1, 0, 0, "-", "hdfRead"], [1, 0, 0, "-", "hdfWrite"]], "geobipy.src.base.HDF.hdfRead": [[1, 1, 1, "", "find"], [1, 1, 1, "", "readKeyFromFile"], [1, 1, 1, "", "readKeyFromFiles"], [1, 1, 1, "", "read_all"], [1, 1, 1, "", "read_groups_with_tag"], [1, 1, 1, "", "read_item"]], "geobipy.src.base.HDF.hdfWrite": [[1, 1, 1, "", "write_nd"]], "geobipy.src.base": [[2, 0, 0, "-", "MPI"], [4, 0, 0, "-", "fileIO"], [5, 0, 0, "-", "interpolation"], [6, 0, 0, "-", "plotting"], [7, 0, 0, "-", "utilities"]], "geobipy.src.base.MPI": [[2, 1, 1, "", "Bcast"], [2, 1, 1, "", "Bcast_1int"], [2, 1, 1, "", "Bcast_list"], [2, 1, 1, "", "Irecv"], [2, 1, 1, "", "IrecvFromLeft"], [2, 1, 1, "", "IrecvFromRight"], [2, 1, 1, "", "Irecv_1int"], [2, 1, 1, "", "Isend"], [2, 1, 1, "", "IsendToLeft"], [2, 1, 1, "", "IsendToRight"], [2, 1, 1, "", "Isend_1int"], [2, 1, 1, "", "Scatterv"], [2, 1, 1, "", "Scatterv_list"], [2, 1, 1, "", "Scatterv_numpy"], [2, 1, 1, "", "banner"], [2, 1, 1, "", "bcastType"], [2, 1, 1, "", "get_prng"], [2, 1, 1, "", "helloWorld"], [2, 1, 1, "", "loadBalance1D_shrinkingArrays"], [2, 1, 1, "", "loadBalance3D_shrinkingArrays"], [2, 1, 1, "", "ordered_print"], [2, 1, 1, "", "print"], [2, 1, 1, "", "rankPrint"]], "geobipy.src.base.fileIO": [[4, 1, 1, "", "bytes2readable"], [4, 1, 1, "", "deleteFile"], [4, 1, 1, "", "dirExists"], [4, 1, 1, "", "fileExists"], [4, 1, 1, "", "filesExist"], [4, 1, 1, "", "getFileExtension"], [4, 1, 1, "", "getFileSize"], [4, 1, 1, "", "getNcolumns"], [4, 1, 1, "", "getNlines"], [4, 1, 1, "", "get_column_name"], [4, 1, 1, "", "get_real_numbers_from_line"], [4, 1, 1, "", "int2str"], [4, 1, 1, "", "isFileExtension"], [4, 1, 1, "", "parseString"], [4, 1, 1, "", "wccount"]], "geobipy.src.base.plotting": [[6, 1, 1, "", "bar"], [6, 1, 1, "", "clabel"], [6, 1, 1, "", "generate_subplots"], [6, 1, 1, "", "hillshade"], [6, 1, 1, "", "hlines"], [6, 1, 1, "", "make_colourmap"], [6, 1, 1, "", "pause"], [6, 1, 1, "", "pcolor"], [6, 1, 1, "", "pcolor_1D"], [6, 1, 1, "", "pcolor_as_bar"], [6, 1, 1, "", "plot"], [6, 1, 1, "", "pretty"], [6, 1, 1, "", "scatter2D"], [6, 1, 1, "", "setAlphaPerPcolormeshPixel"], [6, 1, 1, "", "sizeLegend"], [6, 1, 1, "", "stackplot2D"], [6, 1, 1, "", "step"], [6, 1, 1, "", "vlines"]], "geobipy.src.base.utilities": [[7, 1, 1, "", "Ax"], [7, 1, 1, "", "Det"], [7, 1, 1, "", "Inv"], [7, 1, 1, "", "LogDet"], [7, 1, 1, "", "cosSin1"], [7, 1, 1, "", "expReal"], [7, 1, 1, "", "findFirstLastNotValue"], [7, 1, 1, "", "findFirstNonZeros"], [7, 1, 1, "", "findLastNonZeros"], [7, 1, 1, "", "findNans"], [7, 1, 1, "", "findNotNans"], [7, 1, 1, "", "getName"], [7, 1, 1, "", "getNameUnits"], [7, 1, 1, "", "getUnits"], [7, 1, 1, "", "histogramEqualize"], [7, 1, 1, "", "interleave"], [7, 1, 1, "", "isInt"], [7, 1, 1, "", "isIntorSlice"], [7, 1, 1, "", "isNumpy"], [7, 1, 1, "", "mergeComplex"], [7, 1, 1, "", "rosenbrock"], [7, 1, 1, "", "smooth"], [7, 1, 1, "", "splitComplex"], [7, 1, 1, "", "str_to_raw"], [7, 1, 1, "", "tanh"], [7, 1, 1, "", "trim_by_percentile"]], "geobipy.src.classes.core": [[9, 0, 0, "-", "StatArray"], [11, 0, 0, "-", "myObject"]], "geobipy.src.classes.core.StatArray": [[9, 2, 1, "", "StatArray"]], "geobipy.src.classes.core.StatArray.StatArray": [[9, 3, 1, "", "Bcast"], [9, 3, 1, "", "Irecv"], [9, 3, 1, "", "IrecvFromLeft"], [9, 3, 1, "", "IrecvFromRight"], [9, 3, 1, "", "Isend"], [9, 3, 1, "", "IsendToLeft"], [9, 3, 1, "", "IsendToRight"], [9, 3, 1, "", "Scatterv"], [9, 3, 1, "", "abs"], [9, 4, 1, "", "addressof"], [9, 3, 1, "", "append"], [9, 3, 1, "", "argmax_multiple_to_nan"], [9, 3, 1, "", "bar"], [9, 4, 1, "", "bounds"], [9, 3, 1, "", "centred_grid_nodes"], [9, 3, 1, "", "confidence_interval"], [9, 3, 1, "", "copy"], [9, 3, 1, "", "copyStats"], [9, 3, 1, "", "createHdf"], [9, 3, 1, "", "create_posterior_hdf"], [9, 3, 1, "", "delete"], [9, 3, 1, "", "diff"], [9, 3, 1, "", "edges"], [9, 3, 1, "", "firstNonZero"], [9, 3, 1, "", "fit_mixture"], [9, 3, 1, "", "fromHdf"], [9, 3, 1, "", "gaussianMixture"], [9, 3, 1, "", "getNameUnits"], [9, 3, 1, "", "hasLabels"], [9, 4, 1, "", "hasPosterior"], [9, 4, 1, "", "hasPrior"], [9, 4, 1, "", "hasProposal"], [9, 4, 1, "", "hdf_name"], [9, 3, 1, "", "hist"], [9, 3, 1, "", "index"], [9, 3, 1, "", "insert"], [9, 3, 1, "", "interleave"], [9, 3, 1, "", "internalEdges"], [9, 3, 1, "", "isRegular"], [9, 3, 1, "", "kMeans"], [9, 4, 1, "", "label"], [9, 3, 1, "", "lastNonZero"], [9, 3, 1, "", "mahalanobis"], [9, 4, 1, "", "n_posteriors"], [9, 4, 1, "", "name"], [9, 3, 1, "", "nanmax"], [9, 3, 1, "", "nanmin"], [9, 3, 1, "", "normalize"], [9, 3, 1, "", "pad"], [9, 3, 1, "", "pcolor"], [9, 3, 1, "", "perturb"], [9, 3, 1, "", "plot"], [9, 3, 1, "", "plot_posteriors"], [9, 4, 1, "", "posterior"], [9, 3, 1, "", "posteriors_from_hdf"], [9, 3, 1, "", "prepend"], [9, 4, 1, "", "prior"], [9, 3, 1, "", "priorDerivative"], [9, 3, 1, "", "probability"], [9, 4, 1, "", "proposal"], [9, 3, 1, "", "proposal_derivative"], [9, 3, 1, "", "propose"], [9, 4, 1, "", "range"], [9, 3, 1, "", "rescale"], [9, 3, 1, "", "reset_posteriors"], [9, 3, 1, "", "resize"], [9, 3, 1, "", "rolling"], [9, 3, 1, "", "scatter"], [9, 3, 1, "", "smooth"], [9, 3, 1, "", "stackedAreaPlot"], [9, 3, 1, "", "standardize"], [9, 3, 1, "", "strip_nan"], [9, 4, 1, "", "summary"], [9, 3, 1, "", "summaryPlot"], [9, 4, 1, "", "units"], [9, 3, 1, "", "update_posterior"], [9, 4, 1, "", "values"], [9, 3, 1, "", "verbose"], [9, 3, 1, "", "writeHdf"], [9, 3, 1, "", "write_posterior_hdf"]], "geobipy.src.classes.core.myObject": [[11, 2, 1, "", "myObject"]], "geobipy.src.classes.core.myObject.myObject": [[11, 3, 1, "", "getsizeof"], [11, 3, 1, "", "toHdf"]], "geobipy.src.classes.data.datapoint": [[17, 0, 0, "-", "DataPoint"], [13, 0, 0, "-", "EmDataPoint"], [14, 0, 0, "-", "FdemDataPoint"], [15, 0, 0, "-", "TdemDataPoint"], [16, 0, 0, "-", "Tempest_datapoint"]], "geobipy.src.classes.data.datapoint.DataPoint": [[17, 2, 1, "", "DataPoint"], [17, 1, 1, "", "randn"]], "geobipy.src.classes.data.datapoint.DataPoint.DataPoint": [[17, 5, 1, "", "active"], [17, 4, 1, "", "addressof"], [17, 3, 1, "", "createHdf"], [17, 3, 1, "", "data_misfit"], [17, 4, 1, "", "deltaD"], [17, 3, 1, "", "fromHdf"], [17, 3, 1, "", "likelihood"], [17, 3, 1, "", "perturb"], [17, 4, 1, "", "predictedData"], [17, 4, 1, "", "probability"], [17, 3, 1, "", "set_additive_error_posterior"], [17, 3, 1, "", "set_posteriors"], [17, 3, 1, "", "set_proposals"], [17, 3, 1, "", "set_relative_error_posterior"], [17, 4, 1, "", "std"], [17, 4, 1, "", "summary"], [17, 3, 1, "", "writeHdf"]], "geobipy.src.classes.data.datapoint.EmDataPoint": [[13, 2, 1, "", "EmDataPoint"]], "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint": [[13, 4, 1, "", "active"], [13, 3, 1, "", "find_best_halfspace"], [13, 3, 1, "", "plotHalfSpaceResponses"], [13, 4, 1, "", "predictedData"], [13, 3, 1, "", "update_posteriors"]], "geobipy.src.classes.data.datapoint.FdemDataPoint": [[14, 2, 1, "", "FdemDataPoint"]], "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint": [[14, 3, 1, "", "calibrate"], [14, 3, 1, "", "createHdf"], [14, 3, 1, "", "forward"], [14, 3, 1, "", "frequencies"], [14, 3, 1, "", "fromHdf"], [14, 3, 1, "", "getFrequency"], [14, 3, 1, "", "getMeasurementType"], [14, 3, 1, "", "plot"], [14, 3, 1, "", "plot_predicted"], [14, 3, 1, "", "sensitivity"], [14, 3, 1, "", "updateSensitivity"], [14, 3, 1, "", "update_posteriors"]], "geobipy.src.classes.data.datapoint.TdemDataPoint": [[15, 2, 1, "", "TdemDataPoint"]], "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint": [[15, 4, 1, "", "addressof"], [15, 3, 1, "", "createHdf"], [15, 3, 1, "", "dualMoment"], [15, 3, 1, "", "forward"], [15, 3, 1, "", "fromHdf"], [15, 4, 1, "", "iplotActive"], [15, 3, 1, "", "off_time"], [15, 3, 1, "", "perturb"], [15, 3, 1, "", "plot"], [15, 4, 1, "", "predictedData"], [15, 4, 1, "", "probability"], [15, 3, 1, "", "read"], [15, 3, 1, "", "sensitivity"], [15, 3, 1, "", "set_posteriors"], [15, 3, 1, "", "set_proposals"], [15, 4, 1, "", "std"], [15, 4, 1, "", "summary"], [15, 3, 1, "", "update_posteriors"], [15, 3, 1, "", "writeHdf"]], "geobipy.src.classes.data.datapoint.Tempest_datapoint": [[16, 2, 1, "", "Tempest_datapoint"]], "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint": [[16, 3, 1, "", "createHdf"], [16, 3, 1, "", "fromHdf"], [16, 3, 1, "", "perturb"], [16, 3, 1, "", "plot"], [16, 4, 1, "", "predictedData"], [16, 4, 1, "", "probability"], [16, 3, 1, "", "set_additive_error_posterior"], [16, 3, 1, "", "set_posteriors"], [16, 3, 1, "", "set_proposals"], [16, 3, 1, "", "set_relative_error_posterior"], [16, 4, 1, "", "std"], [16, 3, 1, "", "writeHdf"]], "geobipy.src.classes.data.dataset": [[19, 0, 0, "-", "Data"], [20, 0, 0, "-", "FdemData"], [21, 0, 0, "-", "TdemData"], [22, 0, 0, "-", "TempestData"]], "geobipy.src.classes.data.dataset.Data": [[19, 2, 1, "", "Data"]], "geobipy.src.classes.data.dataset.Data.Data": [[19, 3, 1, "", "Bcast"], [19, 3, 1, "", "Scatterv"], [19, 4, 1, "", "active"], [19, 3, 1, "", "addToVTK"], [19, 4, 1, "", "additive_error"], [19, 3, 1, "", "append"], [19, 3, 1, "", "channel_index"], [19, 3, 1, "", "createHdf"], [19, 4, 1, "", "data"], [19, 3, 1, "", "data_misfit"], [19, 3, 1, "", "datapoint"], [19, 4, 1, "", "deltaD"], [19, 3, 1, "", "fromHdf"], [19, 3, 1, "", "line"], [19, 3, 1, "", "mapData"], [19, 3, 1, "", "mapPredictedData"], [19, 3, 1, "", "mapStd"], [19, 3, 1, "", "nPointsPerLine"], [19, 3, 1, "", "plot_data"], [19, 3, 1, "", "plot_predicted"], [19, 4, 1, "", "predictedData"], [19, 3, 1, "", "read_csv"], [19, 4, 1, "", "relative_error"], [19, 4, 1, "", "std"], [19, 4, 1, "", "summary"], [19, 3, 1, "", "writeHdf"]], "geobipy.src.classes.data.dataset.FdemData": [[20, 2, 1, "", "FdemData"]], "geobipy.src.classes.data.dataset.FdemData.FdemData": [[20, 3, 1, "", "Bcast"], [20, 3, 1, "", "Scatterv"], [20, 3, 1, "", "append"], [20, 3, 1, "", "createHdf"], [20, 3, 1, "", "datapoint"], [20, 3, 1, "", "fileInformation"], [20, 3, 1, "", "fromHdf"], [20, 3, 1, "", "getFrequency"], [20, 3, 1, "", "getMeasurementType"], [20, 4, 1, "", "nActiveData"], [20, 3, 1, "", "plotLine"], [20, 3, 1, "", "plot_data"], [20, 3, 1, "", "readAarhusFile"], [20, 3, 1, "", "read_csv"], [20, 5, 1, "", "single"], [20, 4, 1, "", "std"]], "geobipy.src.classes.data.dataset.TdemData": [[21, 2, 1, "", "TdemData"]], "geobipy.src.classes.data.dataset.TdemData.TdemData": [[21, 3, 1, "", "Bcast"], [21, 3, 1, "", "Scatterv"], [21, 3, 1, "", "append"], [21, 3, 1, "", "createHdf"], [21, 4, 1, "", "data"], [21, 3, 1, "", "datapoint"], [21, 3, 1, "", "estimateAdditiveError"], [21, 3, 1, "", "fileInformation"], [21, 3, 1, "", "fromHdf"], [21, 3, 1, "", "mapChannel"], [21, 4, 1, "", "nPoints"], [21, 3, 1, "", "off_time"], [21, 3, 1, "", "pcolor"], [21, 3, 1, "", "plot_data"], [21, 3, 1, "", "plot_predicted"], [21, 4, 1, "", "predicted_primary_field"], [21, 4, 1, "", "predicted_secondary_field"], [21, 4, 1, "", "primary_field"], [21, 3, 1, "", "read_csv"], [21, 4, 1, "", "secondary_field"], [21, 5, 1, "", "single"], [21, 4, 1, "", "std"], [21, 4, 1, "", "summary"], [21, 3, 1, "", "writeHdf"]], "geobipy.src.classes.data.dataset.TempestData": [[22, 2, 1, "", "TempestData"]], "geobipy.src.classes.data.dataset.TempestData.TempestData": [[22, 4, 1, "", "additive_error"], [22, 3, 1, "", "fromHdf"], [22, 3, 1, "", "plot_data"], [22, 3, 1, "", "plot_predicted"], [22, 3, 1, "", "read_csv"], [22, 3, 1, "", "read_netcdf"], [22, 4, 1, "", "relative_error"], [22, 5, 1, "", "single"]], "geobipy.src.classes.mesh": [[24, 0, 0, "-", "RectilinearMesh1D"], [25, 0, 0, "-", "RectilinearMesh2D"], [26, 0, 0, "-", "RectilinearMesh2D_stitched"], [27, 0, 0, "-", "RectilinearMesh3D"]], "geobipy.src.classes.mesh.RectilinearMesh1D": [[24, 2, 1, "", "RectilinearMesh1D"]], "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D": [[24, 3, 1, "", "cellIndex"], [24, 3, 1, "", "createHdf"], [24, 3, 1, "", "delete_edge"], [24, 3, 1, "", "fromHdf"], [24, 3, 1, "", "gradient"], [24, 3, 1, "", "hdfName"], [24, 3, 1, "", "in_bounds"], [24, 3, 1, "", "insert_edge"], [24, 3, 1, "", "map_to_pdf"], [24, 3, 1, "", "mask_cells"], [24, 3, 1, "", "pad"], [24, 3, 1, "", "pcolor"], [24, 3, 1, "", "perturb"], [24, 3, 1, "", "piecewise_constant_interpolate"], [24, 3, 1, "", "plot"], [24, 3, 1, "", "plotGrid"], [24, 4, 1, "", "probability"], [24, 4, 1, "", "range"], [24, 3, 1, "", "set_priors"], [24, 3, 1, "", "set_proposals"], [24, 4, 1, "", "summary"], [24, 3, 1, "", "unperturb"]], "geobipy.src.classes.mesh.RectilinearMesh2D": [[25, 2, 1, "", "RectilinearMesh2D"]], "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D": [[25, 3, 1, "", "cellIndex"], [25, 3, 1, "", "cellIndices"], [25, 3, 1, "", "centres"], [25, 3, 1, "", "createHdf"], [25, 4, 1, "", "distance"], [25, 3, 1, "", "edges"], [25, 3, 1, "", "hasSameSize"], [25, 3, 1, "", "in_bounds"], [25, 3, 1, "", "intervalStatistic"], [25, 3, 1, "", "mask_cells"], [25, 4, 1, "", "nCells"], [25, 4, 1, "", "nNodes"], [25, 4, 1, "", "nodes"], [25, 3, 1, "", "pcolor"], [25, 3, 1, "", "plotGrid"], [25, 3, 1, "", "plot_relative_to"], [25, 3, 1, "", "ravelIndices"], [25, 4, 1, "", "shape"], [25, 4, 1, "", "summary"], [25, 3, 1, "", "unravelIndex"], [25, 3, 1, "", "writeHdf"], [25, 4, 1, "", "x_centres"], [25, 4, 1, "", "x_edges"], [25, 4, 1, "", "y_centres"], [25, 4, 1, "", "y_edges"]], "geobipy.src.classes.mesh.RectilinearMesh2D_stitched": [[26, 2, 1, "", "RectilinearMesh2D_stitched"]], "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched": [[26, 3, 1, "", "createHdf"], [26, 3, 1, "", "fromHdf"], [26, 4, 1, "", "nCells"], [26, 3, 1, "", "pcolor"], [26, 4, 1, "", "shape"], [26, 4, 1, "", "summary"], [26, 4, 1, "", "y_edges"]], "geobipy.src.classes.mesh.RectilinearMesh3D": [[27, 2, 1, "", "RectilinearMesh3D"]], "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D": [[27, 3, 1, "", "cellIndices"], [27, 3, 1, "", "centres"], [27, 3, 1, "", "createHdf"], [27, 3, 1, "", "edges"], [27, 3, 1, "", "fromHdf"], [27, 4, 1, "", "nCells"], [27, 4, 1, "", "nNodes"], [27, 3, 1, "", "plotGrid"], [27, 3, 1, "", "pyvista_mesh"], [27, 3, 1, "", "ravelIndices"], [27, 4, 1, "", "shape"], [27, 4, 1, "", "summary"], [27, 3, 1, "", "unravelIndex"], [27, 3, 1, "", "writeHdf"], [27, 3, 1, "", "xRange"], [27, 4, 1, "", "x_centres"], [27, 4, 1, "", "x_edges"], [27, 4, 1, "", "y_centres"], [27, 4, 1, "", "y_edges"], [27, 3, 1, "", "zRange"]], "geobipy.src.classes.model": [[29, 0, 0, "-", "Model"]], "geobipy.src.classes.model.Model": [[29, 2, 1, "", "Model"]], "geobipy.src.classes.model.Model.Model": [[29, 3, 1, "", "compute_local_inverse_hessian"], [29, 3, 1, "", "fromHdf"], [29, 4, 1, "", "gradient"], [29, 3, 1, "", "gradient_probability"], [29, 3, 1, "", "local_precision"], [29, 3, 1, "", "local_variance"], [29, 3, 1, "", "pad"], [29, 3, 1, "", "pcolor"], [29, 3, 1, "", "perturb"], [29, 3, 1, "", "probability"], [29, 3, 1, "", "proposal_probabilities"], [29, 3, 1, "", "set_priors"], [29, 3, 1, "", "set_proposals"], [29, 4, 1, "", "summary"], [29, 3, 1, "", "update_parameter_posterior"], [29, 3, 1, "", "update_posteriors"]], "geobipy.src.classes.pointcloud": [[31, 0, 0, "-", "Point"]], "geobipy.src.classes.pointcloud.Point": [[31, 2, 1, "", "Point"]], "geobipy.src.classes.pointcloud.Point.Point": [[31, 3, 1, "", "Bcast"], [31, 3, 1, "", "Scatterv"], [31, 3, 1, "", "append"], [31, 3, 1, "", "axis"], [31, 3, 1, "", "block_indices"], [31, 3, 1, "", "block_median"], [31, 3, 1, "", "block_median_indices"], [31, 4, 1, "", "bounds"], [31, 3, 1, "", "centred_grid_nodes"], [31, 3, 1, "", "createHdf"], [31, 3, 1, "", "distance"], [31, 3, 1, "", "fileInformation"], [31, 3, 1, "", "fromHdf"], [31, 3, 1, "", "getXAxis"], [31, 3, 1, "", "interpCloughTocher"], [31, 3, 1, "", "interpolate"], [31, 3, 1, "", "map"], [31, 3, 1, "", "move"], [31, 4, 1, "", "nPoints"], [31, 3, 1, "", "nearest"], [31, 3, 1, "", "perturb"], [31, 3, 1, "", "plot"], [31, 4, 1, "", "probability"], [31, 3, 1, "", "read_csv"], [31, 3, 1, "", "scatter2D"], [31, 3, 1, "", "set_kdtree"], [31, 3, 1, "", "set_x_posterior"], [31, 3, 1, "", "set_y_posterior"], [31, 3, 1, "", "set_z_posterior"], [31, 4, 1, "", "summary"], [31, 3, 1, "", "toVTK"], [31, 3, 1, "", "vtkStructure"], [31, 3, 1, "", "writeHdf"]], "geobipy.src.classes.statistics": [[33, 0, 0, "-", "Distribution"], [34, 0, 0, "-", "GammaDistribution"], [35, 0, 0, "-", "Histogram"], [36, 0, 0, "-", "MvNormalDistribution"], [37, 0, 0, "-", "NormalDistribution"], [38, 0, 0, "-", "OrderStatistics"], [39, 0, 0, "-", "UniformDistribution"], [40, 0, 0, "-", "baseDistribution"]], "geobipy.src.classes.statistics.Distribution": [[33, 1, 1, "", "Distribution"]], "geobipy.src.classes.statistics.GammaDistribution": [[34, 2, 1, "", "Gamma"]], "geobipy.src.classes.statistics.GammaDistribution.Gamma": [[34, 3, 1, "", "pdf"]], "geobipy.src.classes.statistics.Histogram": [[35, 2, 1, "", "Histogram"], [35, 1, 1, "", "rand"]], "geobipy.src.classes.statistics.Histogram.Histogram": [[35, 3, 1, "", "credible_intervals"], [35, 3, 1, "", "credible_range"], [35, 3, 1, "", "fit_mixture_to_pdf_1d"], [35, 3, 1, "", "fromHdf"], [35, 3, 1, "", "marginalize"], [35, 3, 1, "", "mean"], [35, 3, 1, "", "median"], [35, 3, 1, "", "mode"], [35, 3, 1, "", "opacity"], [35, 3, 1, "", "opacity_level"], [35, 3, 1, "", "pcolor"], [35, 3, 1, "", "percentile"], [35, 3, 1, "", "plot"], [35, 3, 1, "", "sample"], [35, 3, 1, "", "transparency"]], "geobipy.src.classes.statistics.MvNormalDistribution": [[36, 2, 1, "", "MvNormal"]], "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal": [[36, 3, 1, "", "bins"], [36, 4, 1, "", "ndim"], [36, 3, 1, "", "pad"], [36, 3, 1, "", "probability"]], "geobipy.src.classes.statistics.NormalDistribution": [[37, 2, 1, "", "Normal"]], "geobipy.src.classes.statistics.NormalDistribution.Normal": [[37, 3, 1, "", "bins"], [37, 3, 1, "", "cdf"], [37, 4, 1, "", "ndim"], [37, 3, 1, "", "probability"], [37, 3, 1, "", "rng"]], "geobipy.src.classes.statistics.OrderStatistics": [[38, 2, 1, "", "Order"]], "geobipy.src.classes.statistics.UniformDistribution": [[39, 2, 1, "", "Uniform"]], "geobipy.src.classes.statistics.UniformDistribution.Uniform": [[39, 3, 1, "", "bins"], [39, 3, 1, "", "cdf"], [39, 4, 1, "", "ndim"]], "geobipy.src.classes.statistics.baseDistribution": [[40, 2, 1, "", "baseDistribution"]], "geobipy.src.classes.statistics.baseDistribution.baseDistribution": [[40, 3, 1, "", "bins"], [40, 3, 1, "", "deepcopy"], [40, 4, 1, "", "moment"], [40, 4, 1, "", "ndim"]], "geobipy.src.classes.system": [[42, 0, 0, "-", "CircularLoop"], [43, 0, 0, "-", "EmLoop"], [44, 0, 0, "-", "FdemSystem"], [45, 0, 0, "-", "TdemSystem"]], "geobipy.src.classes.system.CircularLoop": [[42, 2, 1, "", "CircularLoop"]], "geobipy.src.classes.system.CircularLoop.CircularLoop": [[42, 3, 1, "", "Bcast"], [42, 3, 1, "", "createHdf"], [42, 3, 1, "", "fromHdf"], [42, 4, 1, "", "summary"], [42, 3, 1, "", "writeHdf"]], "geobipy.src.classes.system.EmLoop": [[43, 2, 1, "", "EmLoop"]], "geobipy.src.classes.system.EmLoop.EmLoop": [[43, 3, 1, "", "createHdf"], [43, 3, 1, "", "fromHdf"], [43, 3, 1, "", "perturb"], [43, 4, 1, "", "probability"], [43, 3, 1, "", "set_pitch_posterior"], [43, 3, 1, "", "set_roll_posterior"], [43, 3, 1, "", "set_yaw_posterior"], [43, 4, 1, "", "summary"], [43, 3, 1, "", "writeHdf"]], "geobipy.src.classes.system.FdemSystem": [[44, 2, 1, "", "FdemSystem"]], "geobipy.src.classes.system.FdemSystem.FdemSystem": [[44, 3, 1, "", "Bcast"], [44, 4, 1, "", "component_id"], [44, 3, 1, "", "fileInformation"], [44, 3, 1, "", "fromHdf"], [44, 3, 1, "", "read"], [44, 4, 1, "", "summary"], [44, 4, 1, "", "tensor_id"], [44, 3, 1, "", "toHdf"]], "geobipy.src.classes.system.TdemSystem": [[45, 2, 1, "", "TdemSystem"]], "geobipy.src.classes.system.TdemSystem.TdemSystem": [[45, 4, 1, "", "get_modellingTimes"], [45, 4, 1, "", "off_time"]]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:method", "4": "py:property", "5": "py:attribute"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "method", "Python method"], "4": ["py", "property", "Python property"], "5": ["py", "attribute", "Python attribute"]}, "titleterms": {"api": 0, "heirarch": 1, "data": [1, 12, 19, 50, 63, 64, 65, 89], "format": [1, 53], "hdf": [1, 61, 89], "mpi": [2, 48], "wrapper": [2, 33], "function": 2, "core": [3, 10, 11], "routin": 3, "need": 3, "geobipi": [3, 8, 48, 49, 60, 63, 64, 65, 92], "fileio": 4, "interpol": 5, "plot": [6, 83], "util": 7, "class": [8, 10, 11, 12, 18, 23, 28, 30, 32, 41, 46, 53, 54, 57, 83], "us": [8, 53, 54, 60, 92], "statarrai": [9, 83], "object": 11, "emdatapoint": 13, "fdemdatapoint": 14, "tdemdatapoint": 15, "tempest_datapoint": 16, "datapoint": [17, 18, 52, 53, 54, 55, 89], "fdemdata": 20, "tdemdata": 21, "tempestdata": 22, "dataset": 23, "rectilinearmesh1d": 24, "rectilinearmesh2d": 25, "rectilinearmesh2d_stitch": 26, "rectilinearmesh3d": 27, "mesh": [28, 73, 74, 75, 76, 89], "model": [29, 30, 48, 73, 78, 79, 80, 81, 89], "point": 31, "pointcloud": 32, "distribut": [33, 34, 37, 39, 57, 58, 83, 89], "gamma": 34, "histogram": [35, 83, 84, 85, 86], "mvnormal": 36, "normal": [37, 57, 83], "order": 38, "statist": [38, 41, 53, 54, 87, 89], "uniform": 39, "basedistribut": 40, "circular": 42, "loop": 42, "emloop": 43, "frequenc": [44, 52], "domain": [44, 45, 48, 52, 53, 54], "system": [44, 45, 46], "time": [45, 48, 51, 53, 56, 59, 62, 67, 72, 77, 78, 82, 88, 91, 93], "get": 47, "start": 47, "instal": 48, "serial": 48, "version": 48, "parallel": 48, "mpi4pi": 48, "hdf5": [48, 60], "h5py": 48, "forward": 48, "prerequisit": 48, "compil": 48, "gatdaem1d": 48, "share": 48, "librari": 48, "python": [48, 92], "bind": 48, "run": [49, 63, 64, 65], "comput": [51, 56, 59, 62, 67, 72, 77, 82, 88, 91, 93], "skytem": [53, 64, 69], "attach": [53, 54, 83], "descriptor": [53, 54], "file": 53, "tempest": [54, 65, 70], "univari": 57, "multivari": [57, 83], "within": 60, "5": [61, 89], "invert": [63, 64, 65], "resolv": [63, 68], "1d": [66, 73, 78, 83, 84, 89], "infer": [66, 68, 69, 70, 71, 89, 92], "2d": [68, 69, 70, 71, 74, 79, 83, 85, 89], "posterior": [68, 69, 70, 83], "analysi": [68, 69, 70], "rectilinear": [73, 74, 75, 79, 80], "The": 73, "basic": [73, 83], "log": [73, 74, 84], "space": [73, 74, 78, 84], "relativeto": [73, 74], "random": [73, 78], "perturb": [73, 78], "ax": 74, "3d": [75, 80, 86], "an": 78, "infinit": 78, "halfspac": 78, "instanti": [78, 83], "half": 78, "multipl": 78, "new": 83, "prior": 83, "propos": 83, "captur": 83, "manipul": 83, "exampl": [83, 89, 90], "equal": 83, "regular": 84, "bin": 84, "irregular": 84, "linear": 84, "entri": 84, "ar": 84, "intern": 84, "welcom": 92, "geophys": 92, "bayesian": 92, "yeti": 92}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 60}, "alltitles": {"API": [[0, "api"]], "Heirarchical Data Format (HDF)": [[1, "module-geobipy.src.base.HDF.hdfRead"]], "MPI wrapper functions": [[2, "module-geobipy.src.base.MPI"]], "Core routines needed for GeoBIPy": [[3, "core-routines-needed-for-geobipy"]], "fileIO": [[4, "module-geobipy.src.base.fileIO"]], "Interpolation": [[5, "module-geobipy.src.base.interpolation"]], "Classes used in GeoBIPy": [[8, "classes-used-in-geobipy"]], "StatArray": [[9, "statarray"]], "Core classes": [[10, "core-classes"]], "Core object class": [[11, "module-geobipy.src.classes.core.myObject"]], "Data classes": [[12, "data-classes"]], "Datapoint classes": [[18, "datapoint-classes"]], "Dataset classes": [[23, "dataset-classes"]], "Mesh classes": [[28, "mesh-classes"]], "Model classes": [[30, "model-classes"]], "Pointcloud classes": [[32, "pointcloud-classes"]], "Distribution Wrapper": [[33, "distribution-wrapper"]], "Gamma Distribution": [[34, "gamma-distribution"]], "MvNormal": [[36, "mvnormal"]], "Normal distribution": [[37, "normal-distribution"]], "Order Statistics": [[38, "order-statistics"]], "Uniform distribution": [[39, "uniform-distribution"]], "baseDistribution": [[40, "basedistribution"]], "Statistics classes": [[41, "statistics-classes"]], "Circular Loop": [[42, "circular-loop"]], "Frequency domain system": [[44, "frequency-domain-system"]], "Time domain system": [[45, "time-domain-system"]], "System classes": [[46, "system-classes"]], "Getting Started": [[47, "getting-started"]], "Installing GeoBIPy": [[48, "installing-geobipy"]], "Installing a serial version of GeoBIPy": [[48, "installing-a-serial-version-of-geobipy"]], "Installing a parallel version of GeoBIPy": [[48, "installing-a-parallel-version-of-geobipy"]], "Installing MPI and mpi4py": [[48, "installing-mpi-and-mpi4py"]], "MPI": [[48, "mpi"]], "mpi4py": [[48, "mpi4py"]], "Installing parallel HDF5 and h5py": [[48, "installing-parallel-hdf5-and-h5py"]], "HDF5": [[48, "hdf5"]], "h5py": [[48, "h5py"]], "Installing the time domain forward modeller": [[48, "installing-the-time-domain-forward-modeller"]], "Prerequisites": [[48, "prerequisites"]], "Compile the gatdaem1d shared library": [[48, "compile-the-gatdaem1d-shared-library"]], "Installing the Python Bindings": [[48, "installing-the-python-bindings"]], "Running GeoBIPy": [[49, "running-geobipy"]], "Data": [[50, "data"], [19, "data"], [89, "data"]], "Computation times": [[51, "computation-times"], [56, "computation-times"], [59, "computation-times"], [62, "computation-times"], [77, "computation-times"], [82, "computation-times"], [88, "computation-times"], [91, "computation-times"], [67, "computation-times"], [72, "computation-times"], [93, "computation-times"]], "Frequency domain datapoint": [[52, "frequency-domain-datapoint"]], "Skytem Datapoint Class": [[53, "skytem-datapoint-class"]], "Using a time domain datapoint": [[53, "using-a-time-domain-datapoint"]], "Attaching statistical descriptors to the skytem datapoint": [[53, "attaching-statistical-descriptors-to-the-skytem-datapoint"]], "File Format for a time domain datapoint": [[53, "file-format-for-a-time-domain-datapoint"]], "Tempest Datapoint Class": [[54, "tempest-datapoint-class"]], "Using a tempest domain datapoint": [[54, "using-a-tempest-domain-datapoint"]], "Attaching statistical descriptors to the tempest datapoint": [[54, "attaching-statistical-descriptors-to-the-tempest-datapoint"]], "Datapoints": [[55, "datapoints"], [89, "datapoints"]], "Distribution Class": [[57, "distribution-class"]], "Univariate Normal Distribution": [[57, "univariate-normal-distribution"]], "Multivariate Normal Distribution": [[57, "multivariate-normal-distribution"]], "Distributions": [[58, "distributions"], [89, "distributions"]], "Using HDF5 within GeoBIPy": [[60, "using-hdf5-within-geobipy"]], "HDF 5": [[61, "hdf-5"], [89, "hdf-5"]], "1D Inference": [[66, "d-inference"], [89, "d-inference"]], "Inference 2D": [[71, "inference-2d"], [89, "inference-2d"]], "1D Rectilinear Mesh": [[73, "d-rectilinear-mesh"]], "The basics": [[73, "the-basics"]], "Log-space rectilinear mesh": [[73, "log-space-rectilinear-mesh"]], "RelativeTo": [[73, "relativeto"], [74, "relativeto"]], "Randomness and Model Perturbations": [[73, "randomness-and-model-perturbations"], [78, "randomness-and-model-perturbations"]], "2D Rectilinear Mesh": [[74, "d-rectilinear-mesh"]], "Axes in log space": [[74, "axes-in-log-space"]], "3D Rectilinear Mesh": [[75, "d-rectilinear-mesh"]], "Meshes": [[76, "meshes"], [89, "meshes"]], "1D Model with an infinite halfspace": [[78, "d-model-with-an-infinite-halfspace"]], "Instantiate the 1D Model with a Half Space": [[78, "instantiate-the-1d-model-with-a-half-space"]], "Perturbing a model multiple times": [[78, "perturbing-a-model-multiple-times"]], "2D Rectilinear Model": [[79, "d-rectilinear-model"]], "3D Rectilinear Model": [[80, "d-rectilinear-model"]], "Models": [[81, "models"], [89, "models"]], "StatArray Class": [[83, "statarray-class"]], "Instantiating a new StatArray class": [[83, "instantiating-a-new-statarray-class"]], "Attaching Prior and Proposal Distributions to a StatArray": [[83, "attaching-prior-and-proposal-distributions-to-a-statarray"]], "Attaching a Histogram to capture the posterior distribution": [[83, "attaching-a-histogram-to-capture-the-posterior-distribution"]], "Attach a multivariate normal distribution as the prior and proposal": [[83, "attach-a-multivariate-normal-distribution-as-the-prior-and-proposal"]], "Basic manipulation": [[83, "basic-manipulation"]], "1D example": [[83, "d-example"]], "2D example": [[83, "id1"]], "Plotting": [[83, "plotting"]], "Histogram Equalization": [[83, "histogram-equalization"]], "Histogram 1D": [[84, "histogram-1d"]], "Histogram with regular bins": [[84, "histogram-with-regular-bins"]], "Histogram with irregular bins": [[84, "histogram-with-irregular-bins"]], "Histogram with linear space entries that are logged internally": [[84, "histogram-with-linear-space-entries-that-are-logged-internally"]], "Histogram 2D": [[85, "histogram-2d"]], "Histogram 3D": [[86, "histogram-3d"]], "Statistics": [[87, "statistics"], [89, "statistics"]], "Examples": [[90, "examples"], [89, "examples"]], "Welcome to GeoBIPy: Geophysical Bayesian Inference in Python": [[92, "welcome-to-geobipy-geophysical-bayesian-inference-in-python"]], "Using GeoBIPy on Yeti": [[92, "using-geobipy-on-yeti"]], "plotting": [[6, "module-geobipy.src.base.plotting"]], "utilities": [[7, "module-geobipy.src.base.utilities"]], "EmDataPoint": [[13, "emdatapoint"]], "FdemDataPoint": [[14, "fdemdatapoint"]], "TdemDataPoint": [[15, "tdemdatapoint"]], "Tempest_datapoint": [[16, "tempest-datapoint"]], "DataPoint": [[17, "datapoint"]], "FdemData": [[20, "fdemdata"]], "TdemData": [[21, "tdemdata"]], "TempestData": [[22, "tempestdata"]], "RectilinearMesh1D": [[24, "rectilinearmesh1d"]], "RectilinearMesh2D": [[25, "rectilinearmesh2d"]], "RectilinearMesh2D_stitched": [[26, "rectilinearmesh2d-stitched"]], "RectilinearMesh3D": [[27, "rectilinearmesh3d"]], "Model": [[29, "model"]], "Point": [[31, "point"]], "Histogram": [[35, "histogram"]], "EmLoop": [[43, "emloop"]], "Running GeoBIPy to invert Resolve data": [[63, "running-geobipy-to-invert-resolve-data"]], "Running GeoBIPy to invert Skytem data": [[64, "running-geobipy-to-invert-skytem-data"]], "Running GeoBIPy to invert Tempest data": [[65, "running-geobipy-to-invert-tempest-data"]], "2D Posterior analysis of Resolve inference": [[68, "d-posterior-analysis-of-resolve-inference"]], "2D Posterior analysis of Skytem inference": [[69, "d-posterior-analysis-of-skytem-inference"]], "2D Posterior analysis of Tempest inference": [[70, "d-posterior-analysis-of-tempest-inference"]]}, "indexentries": {"find() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.find"]], "geobipy.src.base.hdf.hdfread": [[1, "module-geobipy.src.base.HDF.hdfRead"]], "geobipy.src.base.hdf.hdfwrite": [[1, "module-geobipy.src.base.HDF.hdfWrite"]], "module": [[1, "module-geobipy.src.base.HDF.hdfRead"], [1, "module-geobipy.src.base.HDF.hdfWrite"], [2, "module-geobipy.src.base.MPI"], [4, "module-geobipy.src.base.fileIO"], [5, "module-geobipy.src.base.interpolation"], [6, "module-geobipy.src.base.plotting"], [7, "module-geobipy.src.base.utilities"], [9, "module-geobipy.src.classes.core.StatArray"], [11, "module-geobipy.src.classes.core.myObject"], [13, "module-geobipy.src.classes.data.datapoint.EmDataPoint"], [14, "module-geobipy.src.classes.data.datapoint.FdemDataPoint"], [15, "module-geobipy.src.classes.data.datapoint.TdemDataPoint"], [16, "module-geobipy.src.classes.data.datapoint.Tempest_datapoint"], [17, "module-geobipy.src.classes.data.datapoint.DataPoint"], [19, "module-geobipy.src.classes.data.dataset.Data"], [20, "module-geobipy.src.classes.data.dataset.FdemData"], [21, "module-geobipy.src.classes.data.dataset.TdemData"], [22, "module-geobipy.src.classes.data.dataset.TempestData"], [24, "module-geobipy.src.classes.mesh.RectilinearMesh1D"], [25, "module-geobipy.src.classes.mesh.RectilinearMesh2D"], [26, "module-geobipy.src.classes.mesh.RectilinearMesh2D_stitched"], [27, "module-geobipy.src.classes.mesh.RectilinearMesh3D"], [29, "module-geobipy.src.classes.model.Model"], [31, "module-geobipy.src.classes.pointcloud.Point"], [33, "module-geobipy.src.classes.statistics.Distribution"], [34, "module-geobipy.src.classes.statistics.GammaDistribution"], [35, "module-geobipy.src.classes.statistics.Histogram"], [36, "module-geobipy.src.classes.statistics.MvNormalDistribution"], [37, "module-geobipy.src.classes.statistics.NormalDistribution"], [38, "module-geobipy.src.classes.statistics.OrderStatistics"], [39, "module-geobipy.src.classes.statistics.UniformDistribution"], [40, "module-geobipy.src.classes.statistics.baseDistribution"], [42, "module-geobipy.src.classes.system.CircularLoop"], [43, "module-geobipy.src.classes.system.EmLoop"], [44, "module-geobipy.src.classes.system.FdemSystem"], [45, "module-geobipy.src.classes.system.TdemSystem"]], "readkeyfromfile() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.readKeyFromFile"]], "readkeyfromfiles() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.readKeyFromFiles"]], "read_all() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.read_all"]], "read_groups_with_tag() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.read_groups_with_tag"]], "read_item() (in module geobipy.src.base.hdf.hdfread)": [[1, "geobipy.src.base.HDF.hdfRead.read_item"]], "write_nd() (in module geobipy.src.base.hdf.hdfwrite)": [[1, "geobipy.src.base.HDF.hdfWrite.write_nd"]], "bcast() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Bcast"]], "bcast_1int() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Bcast_1int"]], "bcast_list() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Bcast_list"]], "irecv() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Irecv"]], "irecvfromleft() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.IrecvFromLeft"]], "irecvfromright() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.IrecvFromRight"]], "irecv_1int() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Irecv_1int"]], "isend() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Isend"]], "isendtoleft() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.IsendToLeft"]], "isendtoright() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.IsendToRight"]], "isend_1int() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Isend_1int"]], "scatterv() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Scatterv"]], "scatterv_list() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Scatterv_list"]], "scatterv_numpy() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.Scatterv_numpy"]], "banner() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.banner"]], "bcasttype() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.bcastType"]], "geobipy.src.base.mpi": [[2, "module-geobipy.src.base.MPI"]], "get_prng() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.get_prng"]], "helloworld() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.helloWorld"]], "loadbalance1d_shrinkingarrays() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.loadBalance1D_shrinkingArrays"]], "loadbalance3d_shrinkingarrays() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.loadBalance3D_shrinkingArrays"]], "ordered_print() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.ordered_print"]], "print() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.print"]], "rankprint() (in module geobipy.src.base.mpi)": [[2, "geobipy.src.base.MPI.rankPrint"]], "bytes2readable() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.bytes2readable"]], "deletefile() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.deleteFile"]], "direxists() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.dirExists"]], "fileexists() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.fileExists"]], "filesexist() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.filesExist"]], "geobipy.src.base.fileio": [[4, "module-geobipy.src.base.fileIO"]], "getfileextension() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.getFileExtension"]], "getfilesize() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.getFileSize"]], "getncolumns() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.getNcolumns"]], "getnlines() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.getNlines"]], "get_column_name() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.get_column_name"]], "get_real_numbers_from_line() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.get_real_numbers_from_line"]], "int2str() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.int2str"]], "isfileextension() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.isFileExtension"]], "parsestring() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.parseString"]], "wccount() (in module geobipy.src.base.fileio)": [[4, "geobipy.src.base.fileIO.wccount"]], "geobipy.src.base.interpolation": [[5, "module-geobipy.src.base.interpolation"]], "bar() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.bar"]], "clabel() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.clabel"]], "generate_subplots() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.generate_subplots"]], "geobipy.src.base.plotting": [[6, "module-geobipy.src.base.plotting"]], "hillshade() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.hillshade"]], "hlines() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.hlines"]], "make_colourmap() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.make_colourmap"]], "pause() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.pause"]], "pcolor() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.pcolor"]], "pcolor_1d() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.pcolor_1D"]], "pcolor_as_bar() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.pcolor_as_bar"]], "plot() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.plot"]], "pretty() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.pretty"]], "scatter2d() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.scatter2D"]], "setalphaperpcolormeshpixel() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.setAlphaPerPcolormeshPixel"]], "sizelegend() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.sizeLegend"]], "stackplot2d() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.stackplot2D"]], "step() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.step"]], "vlines() (in module geobipy.src.base.plotting)": [[6, "geobipy.src.base.plotting.vlines"]], "ax() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.Ax"]], "det() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.Det"]], "inv() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.Inv"]], "logdet() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.LogDet"]], "cossin1() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.cosSin1"]], "expreal() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.expReal"]], "findfirstlastnotvalue() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.findFirstLastNotValue"]], "findfirstnonzeros() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.findFirstNonZeros"]], "findlastnonzeros() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.findLastNonZeros"]], "findnans() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.findNans"]], "findnotnans() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.findNotNans"]], "geobipy.src.base.utilities": [[7, "module-geobipy.src.base.utilities"]], "getname() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.getName"]], "getnameunits() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.getNameUnits"]], "getunits() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.getUnits"]], "histogramequalize() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.histogramEqualize"]], "interleave() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.interleave"]], "isint() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.isInt"]], "isintorslice() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.isIntorSlice"]], "isnumpy() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.isNumpy"]], "mergecomplex() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.mergeComplex"]], "rosenbrock() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.rosenbrock"]], "smooth() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.smooth"]], "splitcomplex() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.splitComplex"]], "str_to_raw() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.str_to_raw"]], "tanh() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.tanh"]], "trim_by_percentile() (in module geobipy.src.base.utilities)": [[7, "geobipy.src.base.utilities.trim_by_percentile"]], "bcast() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.Bcast"]], "irecv() (geobipy.src.classes.core.statarray.statarray class method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.Irecv"]], "irecvfromleft() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.IrecvFromLeft"]], "irecvfromright() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.IrecvFromRight"]], "isend() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.Isend"]], "isendtoleft() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.IsendToLeft"]], "isendtoright() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.IsendToRight"]], "scatterv() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.Scatterv"]], "statarray (class in geobipy.src.classes.core.statarray)": [[9, "geobipy.src.classes.core.StatArray.StatArray"]], "abs() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.abs"]], "addressof (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.addressof"]], "append() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.append"]], "argmax_multiple_to_nan() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.argmax_multiple_to_nan"]], "bar() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.bar"]], "bounds (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.bounds"]], "centred_grid_nodes() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.centred_grid_nodes"]], "confidence_interval() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.confidence_interval"]], "copy() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.copy"]], "copystats() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.copyStats"]], "createhdf() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.createHdf"]], "create_posterior_hdf() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.create_posterior_hdf"]], "delete() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.delete"]], "diff() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.diff"]], "edges() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.edges"]], "firstnonzero() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.firstNonZero"]], "fit_mixture() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.fit_mixture"]], "fromhdf() (geobipy.src.classes.core.statarray.statarray class method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.fromHdf"]], "gaussianmixture() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.gaussianMixture"]], "geobipy.src.classes.core.statarray": [[9, "module-geobipy.src.classes.core.StatArray"]], "getnameunits() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.getNameUnits"]], "haslabels() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hasLabels"]], "hasposterior (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hasPosterior"]], "hasprior (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hasPrior"]], "hasproposal (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hasProposal"]], "hdf_name (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hdf_name"]], "hist() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.hist"]], "index() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.index"]], "insert() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.insert"]], "interleave() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.interleave"]], "internaledges() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.internalEdges"]], "isregular() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.isRegular"]], "kmeans() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.kMeans"]], "label (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.label"]], "lastnonzero() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.lastNonZero"]], "mahalanobis() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.mahalanobis"]], "n_posteriors (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.n_posteriors"]], "name (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.name"]], "nanmax() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.nanmax"]], "nanmin() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.nanmin"]], "normalize() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.normalize"]], "pad() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.pad"]], "pcolor() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.pcolor"]], "perturb() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.perturb"]], "plot() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.plot"]], "plot_posteriors() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.plot_posteriors"]], "posterior (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.posterior"]], "posteriors_from_hdf() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.posteriors_from_hdf"]], "prepend() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.prepend"]], "prior (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.prior"]], "priorderivative() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.priorDerivative"]], "probability() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.probability"]], "proposal (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.proposal"]], "proposal_derivative() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.proposal_derivative"]], "propose() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.propose"]], "range (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.range"]], "rescale() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.rescale"]], "reset_posteriors() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.reset_posteriors"]], "resize() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.resize"]], "rolling() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.rolling"]], "scatter() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.scatter"]], "smooth() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.smooth"]], "stackedareaplot() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.stackedAreaPlot"]], "standardize() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.standardize"]], "strip_nan() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.strip_nan"]], "summary (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.summary"]], "summaryplot() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.summaryPlot"]], "units (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.units"]], "update_posterior() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.update_posterior"]], "values (geobipy.src.classes.core.statarray.statarray property)": [[9, "geobipy.src.classes.core.StatArray.StatArray.values"]], "verbose() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.verbose"]], "writehdf() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.writeHdf"]], "write_posterior_hdf() (geobipy.src.classes.core.statarray.statarray method)": [[9, "geobipy.src.classes.core.StatArray.StatArray.write_posterior_hdf"]], "geobipy.src.classes.core.myobject": [[11, "module-geobipy.src.classes.core.myObject"]], "getsizeof() (geobipy.src.classes.core.myobject.myobject method)": [[11, "geobipy.src.classes.core.myObject.myObject.getsizeof"]], "myobject (class in geobipy.src.classes.core.myobject)": [[11, "geobipy.src.classes.core.myObject.myObject"]], "tohdf() (geobipy.src.classes.core.myobject.myobject method)": [[11, "geobipy.src.classes.core.myObject.myObject.toHdf"]], "emdatapoint (class in geobipy.src.classes.data.datapoint.emdatapoint)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint"]], "active (geobipy.src.classes.data.datapoint.emdatapoint.emdatapoint property)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint.active"]], "find_best_halfspace() (geobipy.src.classes.data.datapoint.emdatapoint.emdatapoint method)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint.find_best_halfspace"]], "geobipy.src.classes.data.datapoint.emdatapoint": [[13, "module-geobipy.src.classes.data.datapoint.EmDataPoint"]], "plothalfspaceresponses() (geobipy.src.classes.data.datapoint.emdatapoint.emdatapoint method)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint.plotHalfSpaceResponses"]], "predicteddata (geobipy.src.classes.data.datapoint.emdatapoint.emdatapoint property)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint.predictedData"]], "update_posteriors() (geobipy.src.classes.data.datapoint.emdatapoint.emdatapoint method)": [[13, "geobipy.src.classes.data.datapoint.EmDataPoint.EmDataPoint.update_posteriors"]], "fdemdatapoint (class in geobipy.src.classes.data.datapoint.fdemdatapoint)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint"]], "calibrate() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.calibrate"]], "createhdf() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.createHdf"]], "forward() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.forward"]], "frequencies() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.frequencies"]], "fromhdf() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint class method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.fromHdf"]], "geobipy.src.classes.data.datapoint.fdemdatapoint": [[14, "module-geobipy.src.classes.data.datapoint.FdemDataPoint"]], "getfrequency() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.getFrequency"]], "getmeasurementtype() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.getMeasurementType"]], "plot() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.plot"]], "plot_predicted() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.plot_predicted"]], "sensitivity() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.sensitivity"]], "updatesensitivity() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.updateSensitivity"]], "update_posteriors() (geobipy.src.classes.data.datapoint.fdemdatapoint.fdemdatapoint method)": [[14, "geobipy.src.classes.data.datapoint.FdemDataPoint.FdemDataPoint.update_posteriors"]], "tdemdatapoint (class in geobipy.src.classes.data.datapoint.tdemdatapoint)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint"]], "addressof (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.addressof"]], "createhdf() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.createHdf"]], "dualmoment() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.dualMoment"]], "forward() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.forward"]], "fromhdf() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint class method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.fromHdf"]], "geobipy.src.classes.data.datapoint.tdemdatapoint": [[15, "module-geobipy.src.classes.data.datapoint.TdemDataPoint"]], "iplotactive (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.iplotActive"]], "off_time() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.off_time"]], "perturb() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.perturb"]], "plot() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.plot"]], "predicteddata (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.predictedData"]], "probability (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.probability"]], "read() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.read"]], "sensitivity() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.sensitivity"]], "set_posteriors() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.set_posteriors"]], "set_proposals() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.set_proposals"]], "std (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.std"]], "summary (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint property)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.summary"]], "update_posteriors() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.update_posteriors"]], "writehdf() (geobipy.src.classes.data.datapoint.tdemdatapoint.tdemdatapoint method)": [[15, "geobipy.src.classes.data.datapoint.TdemDataPoint.TdemDataPoint.writeHdf"]], "tempest_datapoint (class in geobipy.src.classes.data.datapoint.tempest_datapoint)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint"]], "createhdf() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.createHdf"]], "fromhdf() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint class method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.fromHdf"]], "geobipy.src.classes.data.datapoint.tempest_datapoint": [[16, "module-geobipy.src.classes.data.datapoint.Tempest_datapoint"]], "perturb() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.perturb"]], "plot() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.plot"]], "predicteddata (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint property)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.predictedData"]], "probability (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint property)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.probability"]], "set_additive_error_posterior() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.set_additive_error_posterior"]], "set_posteriors() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.set_posteriors"]], "set_proposals() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.set_proposals"]], "set_relative_error_posterior() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.set_relative_error_posterior"]], "std (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint property)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.std"]], "writehdf() (geobipy.src.classes.data.datapoint.tempest_datapoint.tempest_datapoint method)": [[16, "geobipy.src.classes.data.datapoint.Tempest_datapoint.Tempest_datapoint.writeHdf"]], "datapoint (class in geobipy.src.classes.data.datapoint.datapoint)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint"]], "active (geobipy.src.classes.data.datapoint.datapoint.datapoint attribute)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.active"]], "addressof (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.addressof"]], "createhdf() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.createHdf"]], "data_misfit() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.data_misfit"]], "deltad (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.deltaD"]], "fromhdf() (geobipy.src.classes.data.datapoint.datapoint.datapoint class method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.fromHdf"]], "geobipy.src.classes.data.datapoint.datapoint": [[17, "module-geobipy.src.classes.data.datapoint.DataPoint"]], "likelihood() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.likelihood"]], "perturb() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.perturb"]], "predicteddata (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.predictedData"]], "probability (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.probability"]], "randn() (in module geobipy.src.classes.data.datapoint.datapoint)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.randn"]], "set_additive_error_posterior() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.set_additive_error_posterior"]], "set_posteriors() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.set_posteriors"]], "set_proposals() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.set_proposals"]], "set_relative_error_posterior() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.set_relative_error_posterior"]], "std (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.std"]], "summary (geobipy.src.classes.data.datapoint.datapoint.datapoint property)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.summary"]], "writehdf() (geobipy.src.classes.data.datapoint.datapoint.datapoint method)": [[17, "geobipy.src.classes.data.datapoint.DataPoint.DataPoint.writeHdf"]], "bcast() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.Bcast"]], "data (class in geobipy.src.classes.data.dataset.data)": [[19, "geobipy.src.classes.data.dataset.Data.Data"]], "scatterv() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.Scatterv"]], "active (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.active"]], "addtovtk() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.addToVTK"]], "additive_error (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.additive_error"]], "append() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.append"]], "channel_index() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.channel_index"]], "createhdf() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.createHdf"]], "data (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.data"]], "data_misfit() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.data_misfit"]], "datapoint() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.datapoint"]], "deltad (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.deltaD"]], "fromhdf() (geobipy.src.classes.data.dataset.data.data class method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.fromHdf"]], "geobipy.src.classes.data.dataset.data": [[19, "module-geobipy.src.classes.data.dataset.Data"]], "line() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.line"]], "mapdata() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.mapData"]], "mappredicteddata() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.mapPredictedData"]], "mapstd() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.mapStd"]], "npointsperline() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.nPointsPerLine"]], "plot_data() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.plot_data"]], "plot_predicted() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.plot_predicted"]], "predicteddata (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.predictedData"]], "read_csv() (geobipy.src.classes.data.dataset.data.data class method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.read_csv"]], "relative_error (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.relative_error"]], "std (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.std"]], "summary (geobipy.src.classes.data.dataset.data.data property)": [[19, "geobipy.src.classes.data.dataset.Data.Data.summary"]], "writehdf() (geobipy.src.classes.data.dataset.data.data method)": [[19, "geobipy.src.classes.data.dataset.Data.Data.writeHdf"]], "bcast() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.Bcast"]], "fdemdata (class in geobipy.src.classes.data.dataset.fdemdata)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData"]], "scatterv() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.Scatterv"]], "append() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.append"]], "createhdf() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.createHdf"]], "datapoint() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.datapoint"]], "fileinformation() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.fileInformation"]], "fromhdf() (geobipy.src.classes.data.dataset.fdemdata.fdemdata class method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.fromHdf"]], "geobipy.src.classes.data.dataset.fdemdata": [[20, "module-geobipy.src.classes.data.dataset.FdemData"]], "getfrequency() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.getFrequency"]], "getmeasurementtype() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.getMeasurementType"]], "nactivedata (geobipy.src.classes.data.dataset.fdemdata.fdemdata property)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.nActiveData"]], "plotline() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.plotLine"]], "plot_data() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.plot_data"]], "readaarhusfile() (geobipy.src.classes.data.dataset.fdemdata.fdemdata method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.readAarhusFile"]], "read_csv() (geobipy.src.classes.data.dataset.fdemdata.fdemdata class method)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.read_csv"]], "single (geobipy.src.classes.data.dataset.fdemdata.fdemdata attribute)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.single"]], "std (geobipy.src.classes.data.dataset.fdemdata.fdemdata property)": [[20, "geobipy.src.classes.data.dataset.FdemData.FdemData.std"]], "bcast() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.Bcast"]], "scatterv() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.Scatterv"]], "tdemdata (class in geobipy.src.classes.data.dataset.tdemdata)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData"]], "append() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.append"]], "createhdf() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.createHdf"]], "data (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.data"]], "datapoint() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.datapoint"]], "estimateadditiveerror() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.estimateAdditiveError"]], "fileinformation() (geobipy.src.classes.data.dataset.tdemdata.tdemdata static method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.fileInformation"]], "fromhdf() (geobipy.src.classes.data.dataset.tdemdata.tdemdata class method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.fromHdf"]], "geobipy.src.classes.data.dataset.tdemdata": [[21, "module-geobipy.src.classes.data.dataset.TdemData"]], "mapchannel() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.mapChannel"]], "npoints (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.nPoints"]], "off_time() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.off_time"]], "pcolor() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.pcolor"]], "plot_data() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.plot_data"]], "plot_predicted() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.plot_predicted"]], "predicted_primary_field (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.predicted_primary_field"]], "predicted_secondary_field (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.predicted_secondary_field"]], "primary_field (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.primary_field"]], "read_csv() (geobipy.src.classes.data.dataset.tdemdata.tdemdata class method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.read_csv"]], "secondary_field (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.secondary_field"]], "single (geobipy.src.classes.data.dataset.tdemdata.tdemdata attribute)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.single"]], "std (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.std"]], "summary (geobipy.src.classes.data.dataset.tdemdata.tdemdata property)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.summary"]], "writehdf() (geobipy.src.classes.data.dataset.tdemdata.tdemdata method)": [[21, "geobipy.src.classes.data.dataset.TdemData.TdemData.writeHdf"]], "tempestdata (class in geobipy.src.classes.data.dataset.tempestdata)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData"]], "additive_error (geobipy.src.classes.data.dataset.tempestdata.tempestdata property)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.additive_error"]], "fromhdf() (geobipy.src.classes.data.dataset.tempestdata.tempestdata class method)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.fromHdf"]], "geobipy.src.classes.data.dataset.tempestdata": [[22, "module-geobipy.src.classes.data.dataset.TempestData"]], "plot_data() (geobipy.src.classes.data.dataset.tempestdata.tempestdata method)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.plot_data"]], "plot_predicted() (geobipy.src.classes.data.dataset.tempestdata.tempestdata method)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.plot_predicted"]], "read_csv() (geobipy.src.classes.data.dataset.tempestdata.tempestdata class method)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.read_csv"]], "read_netcdf() (geobipy.src.classes.data.dataset.tempestdata.tempestdata class method)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.read_netcdf"]], "relative_error (geobipy.src.classes.data.dataset.tempestdata.tempestdata property)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.relative_error"]], "single (geobipy.src.classes.data.dataset.tempestdata.tempestdata attribute)": [[22, "geobipy.src.classes.data.dataset.TempestData.TempestData.single"]], "rectilinearmesh1d (class in geobipy.src.classes.mesh.rectilinearmesh1d)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D"]], "cellindex() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.cellIndex"]], "createhdf() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.createHdf"]], "delete_edge() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.delete_edge"]], "fromhdf() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d class method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.fromHdf"]], "geobipy.src.classes.mesh.rectilinearmesh1d": [[24, "module-geobipy.src.classes.mesh.RectilinearMesh1D"]], "gradient() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.gradient"]], "hdfname() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.hdfName"]], "in_bounds() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.in_bounds"]], "insert_edge() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.insert_edge"]], "map_to_pdf() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.map_to_pdf"]], "mask_cells() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.mask_cells"]], "pad() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.pad"]], "pcolor() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.pcolor"]], "perturb() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.perturb"]], "piecewise_constant_interpolate() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.piecewise_constant_interpolate"]], "plot() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.plot"]], "plotgrid() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.plotGrid"]], "probability (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d property)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.probability"]], "range (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d property)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.range"]], "set_priors() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.set_priors"]], "set_proposals() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.set_proposals"]], "summary (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d property)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.summary"]], "unperturb() (geobipy.src.classes.mesh.rectilinearmesh1d.rectilinearmesh1d method)": [[24, "geobipy.src.classes.mesh.RectilinearMesh1D.RectilinearMesh1D.unperturb"]], "rectilinearmesh2d (class in geobipy.src.classes.mesh.rectilinearmesh2d)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D"]], "cellindex() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.cellIndex"]], "cellindices() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.cellIndices"]], "centres() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.centres"]], "createhdf() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.createHdf"]], "distance (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.distance"]], "edges() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.edges"]], "geobipy.src.classes.mesh.rectilinearmesh2d": [[25, "module-geobipy.src.classes.mesh.RectilinearMesh2D"]], "hassamesize() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.hasSameSize"]], "in_bounds() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.in_bounds"]], "intervalstatistic() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.intervalStatistic"]], "mask_cells() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.mask_cells"]], "ncells (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.nCells"]], "nnodes (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.nNodes"]], "nodes (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.nodes"]], "pcolor() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.pcolor"]], "plotgrid() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.plotGrid"]], "plot_relative_to() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.plot_relative_to"]], "ravelindices() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.ravelIndices"]], "shape (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.shape"]], "summary (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.summary"]], "unravelindex() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.unravelIndex"]], "writehdf() (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d method)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.writeHdf"]], "x_centres (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.x_centres"]], "x_edges (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.x_edges"]], "y_centres (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.y_centres"]], "y_edges (geobipy.src.classes.mesh.rectilinearmesh2d.rectilinearmesh2d property)": [[25, "geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D.y_edges"]], "rectilinearmesh2d_stitched (class in geobipy.src.classes.mesh.rectilinearmesh2d_stitched)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched"]], "createhdf() (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched method)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.createHdf"]], "fromhdf() (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched class method)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.fromHdf"]], "geobipy.src.classes.mesh.rectilinearmesh2d_stitched": [[26, "module-geobipy.src.classes.mesh.RectilinearMesh2D_stitched"]], "ncells (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched property)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.nCells"]], "pcolor() (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched method)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.pcolor"]], "shape (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched property)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.shape"]], "summary (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched property)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.summary"]], "y_edges (geobipy.src.classes.mesh.rectilinearmesh2d_stitched.rectilinearmesh2d_stitched property)": [[26, "geobipy.src.classes.mesh.RectilinearMesh2D_stitched.RectilinearMesh2D_stitched.y_edges"]], "rectilinearmesh3d (class in geobipy.src.classes.mesh.rectilinearmesh3d)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D"]], "cellindices() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.cellIndices"]], "centres() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.centres"]], "createhdf() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.createHdf"]], "edges() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.edges"]], "fromhdf() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d class method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.fromHdf"]], "geobipy.src.classes.mesh.rectilinearmesh3d": [[27, "module-geobipy.src.classes.mesh.RectilinearMesh3D"]], "ncells (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.nCells"]], "nnodes (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.nNodes"]], "plotgrid() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.plotGrid"]], "pyvista_mesh() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.pyvista_mesh"]], "ravelindices() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.ravelIndices"]], "shape (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.shape"]], "summary (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.summary"]], "unravelindex() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.unravelIndex"]], "writehdf() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.writeHdf"]], "xrange() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.xRange"]], "x_centres (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.x_centres"]], "x_edges (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.x_edges"]], "y_centres (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.y_centres"]], "y_edges (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d property)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.y_edges"]], "zrange() (geobipy.src.classes.mesh.rectilinearmesh3d.rectilinearmesh3d method)": [[27, "geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D.zRange"]], "model (class in geobipy.src.classes.model.model)": [[29, "geobipy.src.classes.model.Model.Model"]], "compute_local_inverse_hessian() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.compute_local_inverse_hessian"]], "fromhdf() (geobipy.src.classes.model.model.model class method)": [[29, "geobipy.src.classes.model.Model.Model.fromHdf"]], "geobipy.src.classes.model.model": [[29, "module-geobipy.src.classes.model.Model"]], "gradient (geobipy.src.classes.model.model.model property)": [[29, "geobipy.src.classes.model.Model.Model.gradient"]], "gradient_probability() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.gradient_probability"]], "local_precision() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.local_precision"]], "local_variance() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.local_variance"]], "pad() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.pad"]], "pcolor() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.pcolor"]], "perturb() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.perturb"]], "probability() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.probability"]], "proposal_probabilities() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.proposal_probabilities"]], "set_priors() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.set_priors"]], "set_proposals() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.set_proposals"]], "summary (geobipy.src.classes.model.model.model property)": [[29, "geobipy.src.classes.model.Model.Model.summary"]], "update_parameter_posterior() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.update_parameter_posterior"]], "update_posteriors() (geobipy.src.classes.model.model.model method)": [[29, "geobipy.src.classes.model.Model.Model.update_posteriors"]], "bcast() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.Bcast"]], "point (class in geobipy.src.classes.pointcloud.point)": [[31, "geobipy.src.classes.pointcloud.Point.Point"]], "scatterv() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.Scatterv"]], "append() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.append"]], "axis() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.axis"]], "block_indices() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.block_indices"]], "block_median() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.block_median"]], "block_median_indices() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.block_median_indices"]], "bounds (geobipy.src.classes.pointcloud.point.point property)": [[31, "geobipy.src.classes.pointcloud.Point.Point.bounds"]], "centred_grid_nodes() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.centred_grid_nodes"]], "createhdf() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.createHdf"]], "distance() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.distance"]], "fileinformation() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.fileInformation"]], "fromhdf() (geobipy.src.classes.pointcloud.point.point class method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.fromHdf"]], "geobipy.src.classes.pointcloud.point": [[31, "module-geobipy.src.classes.pointcloud.Point"]], "getxaxis() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.getXAxis"]], "interpcloughtocher() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.interpCloughTocher"]], "interpolate() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.interpolate"]], "map() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.map"]], "move() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.move"]], "npoints (geobipy.src.classes.pointcloud.point.point property)": [[31, "geobipy.src.classes.pointcloud.Point.Point.nPoints"]], "nearest() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.nearest"]], "perturb() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.perturb"]], "plot() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.plot"]], "probability (geobipy.src.classes.pointcloud.point.point property)": [[31, "geobipy.src.classes.pointcloud.Point.Point.probability"]], "read_csv() (geobipy.src.classes.pointcloud.point.point class method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.read_csv"]], "scatter2d() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.scatter2D"]], "set_kdtree() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.set_kdtree"]], "set_x_posterior() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.set_x_posterior"]], "set_y_posterior() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.set_y_posterior"]], "set_z_posterior() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.set_z_posterior"]], "summary (geobipy.src.classes.pointcloud.point.point property)": [[31, "geobipy.src.classes.pointcloud.Point.Point.summary"]], "tovtk() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.toVTK"]], "vtkstructure() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.vtkStructure"]], "writehdf() (geobipy.src.classes.pointcloud.point.point method)": [[31, "geobipy.src.classes.pointcloud.Point.Point.writeHdf"]], "distribution() (in module geobipy.src.classes.statistics.distribution)": [[33, "geobipy.src.classes.statistics.Distribution.Distribution"]], "geobipy.src.classes.statistics.distribution": [[33, "module-geobipy.src.classes.statistics.Distribution"]], "gamma (class in geobipy.src.classes.statistics.gammadistribution)": [[34, "geobipy.src.classes.statistics.GammaDistribution.Gamma"]], "geobipy.src.classes.statistics.gammadistribution": [[34, "module-geobipy.src.classes.statistics.GammaDistribution"]], "pdf() (geobipy.src.classes.statistics.gammadistribution.gamma method)": [[34, "geobipy.src.classes.statistics.GammaDistribution.Gamma.pdf"]], "histogram (class in geobipy.src.classes.statistics.histogram)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram"]], "credible_intervals() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.credible_intervals"]], "credible_range() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.credible_range"]], "fit_mixture_to_pdf_1d() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.fit_mixture_to_pdf_1d"]], "fromhdf() (geobipy.src.classes.statistics.histogram.histogram class method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.fromHdf"]], "geobipy.src.classes.statistics.histogram": [[35, "module-geobipy.src.classes.statistics.Histogram"]], "marginalize() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.marginalize"]], "mean() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.mean"]], "median() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.median"]], "mode() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.mode"]], "opacity() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.opacity"]], "opacity_level() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.opacity_level"]], "pcolor() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.pcolor"]], "percentile() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.percentile"]], "plot() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.plot"]], "rand() (in module geobipy.src.classes.statistics.histogram)": [[35, "geobipy.src.classes.statistics.Histogram.rand"]], "sample() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.sample"]], "transparency() (geobipy.src.classes.statistics.histogram.histogram method)": [[35, "geobipy.src.classes.statistics.Histogram.Histogram.transparency"]], "mvnormal (class in geobipy.src.classes.statistics.mvnormaldistribution)": [[36, "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal"]], "bins() (geobipy.src.classes.statistics.mvnormaldistribution.mvnormal method)": [[36, "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal.bins"]], "geobipy.src.classes.statistics.mvnormaldistribution": [[36, "module-geobipy.src.classes.statistics.MvNormalDistribution"]], "ndim (geobipy.src.classes.statistics.mvnormaldistribution.mvnormal property)": [[36, "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal.ndim"]], "pad() (geobipy.src.classes.statistics.mvnormaldistribution.mvnormal method)": [[36, "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal.pad"]], "probability() (geobipy.src.classes.statistics.mvnormaldistribution.mvnormal method)": [[36, "geobipy.src.classes.statistics.MvNormalDistribution.MvNormal.probability"]], "normal (class in geobipy.src.classes.statistics.normaldistribution)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal"]], "bins() (geobipy.src.classes.statistics.normaldistribution.normal method)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal.bins"]], "cdf() (geobipy.src.classes.statistics.normaldistribution.normal method)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal.cdf"]], "geobipy.src.classes.statistics.normaldistribution": [[37, "module-geobipy.src.classes.statistics.NormalDistribution"]], "ndim (geobipy.src.classes.statistics.normaldistribution.normal property)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal.ndim"]], "probability() (geobipy.src.classes.statistics.normaldistribution.normal method)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal.probability"]], "rng() (geobipy.src.classes.statistics.normaldistribution.normal method)": [[37, "geobipy.src.classes.statistics.NormalDistribution.Normal.rng"]], "order (class in geobipy.src.classes.statistics.orderstatistics)": [[38, "geobipy.src.classes.statistics.OrderStatistics.Order"]], "geobipy.src.classes.statistics.orderstatistics": [[38, "module-geobipy.src.classes.statistics.OrderStatistics"]], "uniform (class in geobipy.src.classes.statistics.uniformdistribution)": [[39, "geobipy.src.classes.statistics.UniformDistribution.Uniform"]], "bins() (geobipy.src.classes.statistics.uniformdistribution.uniform method)": [[39, "geobipy.src.classes.statistics.UniformDistribution.Uniform.bins"]], "cdf() (geobipy.src.classes.statistics.uniformdistribution.uniform method)": [[39, "geobipy.src.classes.statistics.UniformDistribution.Uniform.cdf"]], "geobipy.src.classes.statistics.uniformdistribution": [[39, "module-geobipy.src.classes.statistics.UniformDistribution"]], "ndim (geobipy.src.classes.statistics.uniformdistribution.uniform property)": [[39, "geobipy.src.classes.statistics.UniformDistribution.Uniform.ndim"]], "basedistribution (class in geobipy.src.classes.statistics.basedistribution)": [[40, "geobipy.src.classes.statistics.baseDistribution.baseDistribution"]], "bins() (geobipy.src.classes.statistics.basedistribution.basedistribution method)": [[40, "geobipy.src.classes.statistics.baseDistribution.baseDistribution.bins"]], "deepcopy() (geobipy.src.classes.statistics.basedistribution.basedistribution method)": [[40, "geobipy.src.classes.statistics.baseDistribution.baseDistribution.deepcopy"]], "geobipy.src.classes.statistics.basedistribution": [[40, "module-geobipy.src.classes.statistics.baseDistribution"]], "moment (geobipy.src.classes.statistics.basedistribution.basedistribution property)": [[40, "geobipy.src.classes.statistics.baseDistribution.baseDistribution.moment"]], "ndim (geobipy.src.classes.statistics.basedistribution.basedistribution property)": [[40, "geobipy.src.classes.statistics.baseDistribution.baseDistribution.ndim"]], "bcast() (geobipy.src.classes.system.circularloop.circularloop method)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop.Bcast"]], "circularloop (class in geobipy.src.classes.system.circularloop)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop"]], "createhdf() (geobipy.src.classes.system.circularloop.circularloop method)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop.createHdf"]], "fromhdf() (geobipy.src.classes.system.circularloop.circularloop class method)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop.fromHdf"]], "geobipy.src.classes.system.circularloop": [[42, "module-geobipy.src.classes.system.CircularLoop"]], "summary (geobipy.src.classes.system.circularloop.circularloop property)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop.summary"]], "writehdf() (geobipy.src.classes.system.circularloop.circularloop method)": [[42, "geobipy.src.classes.system.CircularLoop.CircularLoop.writeHdf"]], "emloop (class in geobipy.src.classes.system.emloop)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop"]], "createhdf() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.createHdf"]], "fromhdf() (geobipy.src.classes.system.emloop.emloop class method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.fromHdf"]], "geobipy.src.classes.system.emloop": [[43, "module-geobipy.src.classes.system.EmLoop"]], "perturb() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.perturb"]], "probability (geobipy.src.classes.system.emloop.emloop property)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.probability"]], "set_pitch_posterior() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.set_pitch_posterior"]], "set_roll_posterior() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.set_roll_posterior"]], "set_yaw_posterior() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.set_yaw_posterior"]], "summary (geobipy.src.classes.system.emloop.emloop property)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.summary"]], "writehdf() (geobipy.src.classes.system.emloop.emloop method)": [[43, "geobipy.src.classes.system.EmLoop.EmLoop.writeHdf"]], "bcast() (geobipy.src.classes.system.fdemsystem.fdemsystem method)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.Bcast"]], "fdemsystem (class in geobipy.src.classes.system.fdemsystem)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem"]], "component_id (geobipy.src.classes.system.fdemsystem.fdemsystem property)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.component_id"]], "fileinformation() (geobipy.src.classes.system.fdemsystem.fdemsystem method)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.fileInformation"]], "fromhdf() (geobipy.src.classes.system.fdemsystem.fdemsystem class method)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.fromHdf"]], "geobipy.src.classes.system.fdemsystem": [[44, "module-geobipy.src.classes.system.FdemSystem"]], "read() (geobipy.src.classes.system.fdemsystem.fdemsystem class method)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.read"]], "summary (geobipy.src.classes.system.fdemsystem.fdemsystem property)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.summary"]], "tensor_id (geobipy.src.classes.system.fdemsystem.fdemsystem property)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.tensor_id"]], "tohdf() (geobipy.src.classes.system.fdemsystem.fdemsystem method)": [[44, "geobipy.src.classes.system.FdemSystem.FdemSystem.toHdf"]], "tdemsystem (class in geobipy.src.classes.system.tdemsystem)": [[45, "geobipy.src.classes.system.TdemSystem.TdemSystem"]], "geobipy.src.classes.system.tdemsystem": [[45, "module-geobipy.src.classes.system.TdemSystem"]], "get_modellingtimes (geobipy.src.classes.system.tdemsystem.tdemsystem property)": [[45, "geobipy.src.classes.system.TdemSystem.TdemSystem.get_modellingTimes"]], "off_time (geobipy.src.classes.system.tdemsystem.tdemsystem property)": [[45, "geobipy.src.classes.system.TdemSystem.TdemSystem.off_time"]]}}) \ No newline at end of file diff --git a/docs/sg_execution_times.html b/docs/sg_execution_times.html new file mode 100644 index 00000000..a355ddbf --- /dev/null +++ b/docs/sg_execution_times.html @@ -0,0 +1,223 @@ + + + + + + + Computation times — GeoBIPy 1.0.0 documentation + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Computation times

+

03:16.574 total execution time for 21 files from all galleries:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

Running GeoBIPy to invert Tempest data (examples/Inference_1D/plot_inference_1d_tempest.py)

01:22.225

0.0

Running GeoBIPy to invert Skytem data (examples/Inference_1D/plot_inference_1d_skytem.py)

01:06.343

0.0

2D Posterior analysis of Resolve inference (examples/Inference_2D/plot_inference_2d_resolve.py)

00:24.877

0.0

2D Posterior analysis of Tempest inference (examples/Inference_2D/plot_inference_2d_tempest.py)

00:12.999

0.0

2D Posterior analysis of Skytem inference (examples/Inference_2D/plot_inference_2d_skytem.py)

00:10.130

0.0

Frequency domain datapoint (examples/Datapoints/plot_resolve_datapoint.py)

00:00.000

0.0

Skytem Datapoint Class (examples/Datapoints/plot_skytem_datapoint.py)

00:00.000

0.0

Tempest Datapoint Class (examples/Datapoints/plot_tempest_datapoint.py)

00:00.000

0.0

Distribution Class (examples/Distributions/plot_distributions.py)

00:00.000

0.0

Using HDF5 within GeoBIPy (examples/HDF5/hdf5.py)

00:00.000

0.0

Running GeoBIPy to invert Resolve data (examples/Inference_1D/plot_inference_1d_resolve.py)

00:00.000

0.0

1D Rectilinear Mesh (examples/Meshes/plot_rectilinear_mesh_1d.py)

00:00.000

0.0

2D Rectilinear Mesh (examples/Meshes/plot_rectilinear_mesh_2d.py)

00:00.000

0.0

3D Rectilinear Mesh (examples/Meshes/plot_rectilinear_mesh_3d.py)

00:00.000

0.0

1D Model with an infinite halfspace (examples/Models/plot_model_1d.py)

00:00.000

0.0

2D Rectilinear Model (examples/Models/plot_model_2d.py)

00:00.000

0.0

3D Rectilinear Model (examples/Models/plot_model_3d.py)

00:00.000

0.0

StatArray Class (examples/Statistics/plot_StatArray.py)

00:00.000

0.0

Histogram 1D (examples/Statistics/plot_histogram_1d.py)

00:00.000

0.0

Histogram 2D (examples/Statistics/plot_histogram_2d.py)

00:00.000

0.0

Histogram 3D (examples/Statistics/plot_histogram_3d.py)

00:00.000

0.0

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file