Exemple #1
0
 def compute_K_analytical(self, spacing, **kwargs):
     """Compute geometrical factors over the homogeneous half-space with a
     constant electrode spacing
     """
     K = redaK.compute_K_analytical(self.data, spacing=spacing, **kwargs)
     self.data = redaK.apply_K(self.data, K, **kwargs)
     redafixK.fix_sign_with_K(self.data, **kwargs)
Exemple #2
0
def _add_rhoa(df, spacing):
    """a simple wrapper to compute K factors and add rhoa
    """
    df['K'] = redaK.compute_K_analytical(df, spacing=spacing)
    df['rho_a'] = df['R'] * df['K']
    if 'Zt' in df.columns:
        df['rho_a_complex'] = df['Zt'] * df['K']
    return df
Exemple #3
0
    def compute_K_analytical(self, spacing):
        """Assuming an equal electrode spacing, compute the K-factor over a
        homogeneous half-space.

        For more complex grids, please refer to the module:
        reda.utils.geometric_factors

        Parameters
        ----------
        spacing : float
            Electrode spacing

        """
        assert isinstance(spacing, Number)
        K = geometric_factors.compute_K_analytical(self.data, spacing)
        self.data = geometric_factors.apply_K(self.data, K)
        fix_sign_with_K(self.data)
Exemple #4
0
 def compute_K_analytical(self, spacing):
     """Compute geometrical factors over the homogeneous half-space with a
     constant electrode spacing
     """
     redaK.compute_K_analytical(self.data, spacing=spacing)
     redafixK.fix_sign_with_K(self.data)
Exemple #5
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Import MPT DAS-1 data
=====================

"""
import reda

###############################################################################
# normal loading of tdip data
ip = reda.TDIP()
# with profiler():
ip.import_mpt('data_mpt_das1/TD_2000ms.Data')

print(ip.data[['a', 'b', 'm', 'n', 'id', 'norrec']])

# import IPython
# IPython.embed()
# exit()
###############################################################################
#
import reda.utils.geometric_factors as geomK
K = geomK.compute_K_analytical(ip.data, spacing=2)
geomK.apply_K(ip.data, K)

import reda.utils.fix_sign_with_K as fixK
ip.data = fixK.fix_sign_with_K(ip.data)

###############################################################################
# generate configs, by hand
a = 1
b = 2
quads = []
for m in range(3, 40):
    quads.append((a, b, m, m + 1))

config.add_to_configs(quads)
# config.compute_K_factors(spacing=1)

fig, ax = plt.subplots(figsize=(15 / 2.54, 10 / 2.54))

for spacing in np.arange(0.5, 4, 0.5):
    dipole_separation = (config.configs[:, 2] - config.configs[:, 1]) * spacing
    print(spacing, dipole_separation)
    K = compute_K_analytical(config.configs, spacing=spacing)
    ax.plot(dipole_separation,
            np.abs(K),
            '.-',
            label='spacing {0}m'.format(spacing))

ax.set_xlabel('dipole separation [m]')
ax.set_ylabel('K [m]')
ax.set_title(
    'geometric factor for different electrode distances ' +
    '(dipole-dipole skip-0)',
    fontsize=10.0,
)

ax.axhline(y=5000, color='k', linestyle='dashed')
ax.annotate(
Exemple #7
0
# from the current injection dipoles:
from reda.importers.eit_fzj import MD_ConfigsPermutate

# initialize an sEIT container
seit_not_used = reda.sEIT()

# import the data
seit_not_used.import_eit_fzj(filename='data_EIT40_v_EZ-2017/eit_data_mnu0.mat',
                             configfile=MD_ConfigsPermutate)

##############################################################################
# Compute geometric factors
import reda.utils.geometric_factors as redaK
import reda.utils.fix_sign_with_K as redafixK

K = redaK.compute_K_analytical(seit.data, spacing=0.25)
redaK.apply_K(seit.data, K)
redafixK.fix_sign_with_K(seit.data)

##############################################################################
# compute normal and reciprocal pairs
# note that this is usually done on import once.
import reda.utils.norrec as norrec
seit.data = norrec.assign_norrec_to_df(seit.data)

##############################################################################
# quadrupoles can be directly accessed using a pandas grouper
print(seit.abmn)
quadpole_data = seit.abmn.get_group((10, 29, 15, 34))
print(quadpole_data[['a', 'b', 'm', 'n', 'frequency', 'r', 'rpha']])
Exemple #8
0
import IPython

IPython
import sys
import IPython.core.ultratb as ultratb

sys.excepthook = ultratb.VerboseTB(call_pdb=True, )

import pandas as pd

pd.set_option('display.width', 1000)

import edf

container = reda.ERT()
container.import_syscal_dat('data_normal.txt')
container.import_syscal_dat('data_reciprocal.txt', reciprocals=48)

import reda.utils.geometric_factors as edfK

K = edfK.compute_K_analytical(container.df, spacing=0.25)
edfK.apply_K(container.df, K)

import reda.plotters as plotters

plotters.histograms.plot_histograms(container, [
    'R',
    'rho_a',
    'Iab',
])
from reda.utils.geometric_factors import compute_K_analytical

grid = CRGrid.crt_grid.create_surface_grid(
    nr_electrodes=50,
    spacing=0.5,
    depth=25,
    right=20,
    left=20,
    char_lengths=[0.1, 5, 5, 5],
    lines=[-3, ],
)
print(grid)

man = CRman.tdMan(grid=grid)
man.configs.gen_schlumberger(M=20, N=21)
K = compute_K_analytical(man.configs.configs, spacing=0.5)
print(man.configs.configs)

# pseudo depth after Knödel et al for Schlumberger configurations
pdepth = np.abs(
    np.max(
        man.configs.configs, axis=1
    ) - np.min(
        man.configs.configs, axis=1
    )
) * 0.19

fig, axes = plt.subplots(2, 1, figsize=(12 / 2.54, 10 / 2.54))

ax = axes[0]
for contrast in (2, 5, 10):