def download_and_unzip_data(
    url="https://storage.googleapis.com/simpeg/bookpurnong/bookpurnong_inversion.tar.gz"
):
    """
    Download the data from the storage bucket, unzip the tar file, return
    the directory where the data are
    """
    # download the data
    downloads = Utils.download(url)

    # directory where the downloaded files are
    directory = downloads.split(".")[0]

    # unzip the tarfile
    tar = tarfile.open(downloads, "r")
    tar.extractall()
    tar.close()

    return downloads, directory
Exemplo n.º 2
0
def download_and_unzip_data(
    url="https://storage.googleapis.com/simpeg/em_examples/tdem_groundedsource/tdem_groundedsource.tar"
):
    """
    Download the data from the storage bucket, unzip the tar file, return
    the directory where the data are
    """
    # download the data
    downloads = Utils.download(url)

    # directory where the downloaded files are
    directory = downloads.split(".")[0]

    # unzip the tarfile
    tar = tarfile.open(downloads, "r")
    tar.extractall()
    tar.close()

    return downloads, directory
def download_and_unzip_data(
    url = "https://storage.googleapis.com/simpeg/bookpurnong/bookpurnong_inversion.tar.gz"
):
    """
    Download the data from the storage bucket, unzip the tar file, return
    the directory where the data are
    """
    # download the data
    downloads = Utils.download(url)

    # directory where the downloaded files are
    directory = downloads.split(".")[0]

    # unzip the tarfile
    tar = tarfile.open(downloads, "r")
    tar.extractall()
    tar.close()

    return downloads, directory
Exemplo n.º 4
0
import numpy as np
import cPickle as pickle
from scipy.constants import mu_0
from pymatsolver import PardisoSolver as Solver
from SimPEG import EM, Mesh, Maps, Utils

download_dir = '.'  # name of the local directory to create and put the files in.

root_url = 'https://storage.googleapis.com/simpeg/tkc_synthetic/atem/'
files = ['TKCATEMexample.p']
urls = [root_url + f for f in files]

downloads = Utils.download(url=urls, folder=download_dir, overwrite=True)
downloads = dict(zip(['fwd_params'], downloads))  # create a dict

TKCATEMexample = pickle.load(open(downloads['fwd_params'], "rb"))

mesh = TKCATEMexample["mesh"]
sigma = TKCATEMexample["sigma"]
xyz = TKCATEMexample["xyz"]
ntx = xyz.shape[0]

# TDEM Survey
srcLists = []
times = np.logspace(-4, np.log10(2e-3), 10)
for itx in range(ntx):
    rx = EM.TDEM.Rx.Point_b(
        xyz[itx, :].reshape([1, -1]), times, orientation='z'
    )
    src = EM.TDEM.Src.CircularLoop(
        [rx], waveform=EM.TDEM.Src.StepOffWaveform(),
Exemplo n.º 5
0
import numpy as np
import cPickle as pickle
from scipy.constants import mu_0
from pymatsolver import PardisoSolver as Solver
from SimPEG import EM, Mesh, Maps, Utils

download_dir = '.'  # name of the local directory to create and put the files in.

root_url = 'https://storage.googleapis.com/simpeg/tkc_synthetic/atem/'
files = ['TKCATEMexample.p']
urls = [root_url + f for f in files]

downloads = Utils.download(url=urls, folder=download_dir, overwrite=True)
downloads = dict(zip(['fwd_params'], downloads))  # create a dict

TKCATEMexample = pickle.load(open(downloads['fwd_params'], "rb"))

mesh = TKCATEMexample["mesh"]
sigma = TKCATEMexample["sigma"]
xyz = TKCATEMexample["xyz"]
ntx = xyz.shape[0]

# TDEM Survey
srcLists = []
times = np.logspace(-4, np.log10(2e-3), 10)
for itx in range(ntx):
    rx = EM.TDEM.Rx.Point_b(xyz[itx, :].reshape([1, -1]),
                            times,
                            orientation='z')
    src = EM.TDEM.Src.CircularLoop([rx],
                                   waveform=EM.TDEM.Src.StepOffWaveform(),