Ejemplo n.º 1
0
    def __init__(self, features_fn =None, ErpColObjs=None , vesObjs=None,
                 geoObjs=None, boreholeObjs=None,  **kwargs):
        
        self._logging = watexlog.get_watex_logger(self.__class__.__name__)
        
        self.features_fn =features_fn
        self.ErpColObjs=ErpColObjs
        self.vesObjs=vesObjs
        self.geoObjs=geoObjs
        self.borehObjs=boreholeObjs
        
        self.gFname= None 

        for key in list(kwargs.keys()):
            setattr(self, key, kwargs[key])
            
        self._readFeatures_()   
Ejemplo n.º 2
0
    def __init__(self,
                 erp_fn=None,
                 dipole_length=None,
                 auto=False,
                 posMinMax=None,
                 **kwargs):
        """ Read :ref:`erp` file and  initilize  the following
        attributes attributes. Set `auto` to ``True`` to let the program 
        selecting the best anomaly points. """

        self._logging = watexlog.get_watex_logger(self.__class__.__name__)

        self.erp_fn = erp_fn
        self._dipoleLength = dipole_length
        self.auto = auto

        self.anom_boundaries = posMinMax
        self._select_best_point = kwargs.pop('best_point', None)
        self.turn_on = kwargs.pop('turn_on', False)
        self.display_auto_infos = kwargs.pop('display_autoinfos', False)
        self._select_best_value = kwargs.pop('best_rhoa', None)

        self._power = None
        self._magnitude = None

        self._lat = None
        self._name = None

        self._lon = None
        self._east = None
        self._north = None

        self._sfi = None
        self._type = None
        self._shape = None
        self.utm_zone = kwargs.pop('utm_zone', None)

        self.data = None

        self._fn = None

        for key in list(kwargs.keys()):
            setattr(self, key, kwargs[key])

        if self.erp_fn is not None:
            self._read_erp()
Ejemplo n.º 3
0
.._anomaly-boundaries:`anBounds`

@author: @Daniel03

"""

import os 
import warnings
import numpy as np 
import pandas as pd
from scipy.signal import argrelextrema 
from scipy.interpolate import interp1d as sp1d
import watex.utils.exceptions as Wex
from watex.utils._watexlog import watexlog  

_logger =watexlog.get_watex_logger(__name__)



def compute_lower_anomaly(erp_array, station_position=None, 
                          step=None, **kws): 
    """
    Function to get the minimum value on the ERP array. 
    If `pk` is provided wil give the index of pk
    
    :param erp_array: array of apparent resistivity profile 
    :type erp_array: array_like
    
    :param station position: array of station position (survey) , if not given 
                    and `step` is known , set the step value and 
                    `station_position` will compute automatically 
Ejemplo n.º 4
0
if os.name == "posix" and 'DISPLAY' not in os.environ:

    print("MATPLOTLIB: No Display found, using non-interactive svg backend",
          file=sys.stderr)
    matplotlib.use('svg')
    import matplotlib.pyplot as plt

    WATex_TEST_HAS_DISPLAY = False
else:
    #matplotlib.use('svg')
    import matplotlib.pyplot as plt
    WATex_TEST_HAS_DISPLAY = True
    plt.ion()

watexlog.get_watex_logger(__name__).info("Testing using matplotlib backend {}".\
                                          format(matplotlib.rcParams['backend']))


def diff_files(after, before, ignores=None):
    """
    compare two files using diff
    :param ignores:
    :param before:
    :param after:
    :return: the number count of different lines
    """

    with open(before) as f2p:
        before_lines = f2p.readlines()
    with open(after) as f1p:
        after_lines = f1p.readlines()
Ejemplo n.º 5
0
SUCCES_IMPORT_CHARTSTUDIO = False

try:
    import chart_studio
    import chart_studio.plotly as py

except:
    #implement pip as subprocess
    subprocess.check_call(
        [sys.executable, '-m', 'pip', 'install', 'chart_studio'])
    #process output with an API in the subprocess module
    reqs = subprocess.check_output([sys.executable, 'm', 'pip', 'freeze'])
    installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
    #get the list of installed dependancies
    watexlog.get_watex_logger().info(
        'CHART_STUDIO was successfully installed with its dependancies')

    SUCCESS_IMPORT_CHART_STUDIO = True

else:
    # updating chart_studio
    try:
        chart_studio_version = [
            int(ss) for ss in chart_studio.__version__.split('.')
        ]
        if chart_studio_version[0] == 1:
            if chart_studio_version[1] < 1:
                warnings.warn(
                    'Note: need chart_studio version 1.1.0 or higher to write '
                    ' to plot some analyses figures propertly.', ImportWarning)
                watexlog().get_watex_logger().warning(