Exemplo n.º 1
0
    def test_downloads(self):
        url = "https://storage.googleapis.com/simpeg/Chile_GRAV_4_Miller/"
        cloudfiles = [
            'LdM_grav_obs.grv', 'LdM_mesh.mesh',
            'LdM_topo.topo', 'LdM_input_file.inp'
        ]

        url1 = url + cloudfiles[0]
        url2 = url + cloudfiles[1]

        file_names = download(
            [url1, url2], folder='./test_urls', overwrite=True
        )
        # or
        file_name = download(url1, folder='./test_url', overwrite=True)
        # where
        assert isinstance(file_names, list)
        assert len(file_names) == 2
        assert isinstance(file_name, str)

        # clean up
        shutil.rmtree(os.path.expanduser('./test_urls'))
        shutil.rmtree(os.path.expanduser('./test_url'))
Exemplo n.º 2
0
    def test_surface2ind_topo(self):
        file_url = "https://storage.googleapis.com/simpeg/tests/utils/vancouver_topo.xyz"
        file2load = download(file_url)
        vancouver_topo = np.loadtxt(file2load)
        mesh_topo = Mesh.TensorMesh([
            [(500., 24)],
            [(500., 20)],
            [(10., 30)]
            ],
            x0='CCC')

        indtopoCC = surface2ind_topo(mesh_topo, vancouver_topo, gridLoc='CC', method='nearest')
        indtopoN = surface2ind_topo(mesh_topo, vancouver_topo, gridLoc='N', method='nearest')

        assert len(np.where(indtopoCC)[0]) == 8729
        assert len(np.where(indtopoN)[0]) == 8212
Exemplo n.º 3
0
def NMOstackSingle(data, tintercept, v, timeFile):
    dx = 20.
    xorig = np.arange(38) * dx
    timdat = download(timeFile, verbose=False)
    time = np.load(timdat)
    singletrace = NMOstack(data, xorig, time, v)

    fig, ax = plt.subplots(1, 1, figsize=(7, 8))
    kwargs = {
        'skipt': 1,
        'scale': 2.,
        'lwidth': 1.,
        'sampr': 0.004,
        'ax': ax,
        'clip': 10,
    }
    extent = [singletrace.min(), singletrace.max(), time.max(), time.min()]
    ax.invert_yaxis()
    ax.axis(extent)
    wiggle(singletrace.reshape([1, -1]), **kwargs)
    ax.set_xlabel("Amplitude")
    ax.set_ylabel("Time (s)")
Exemplo n.º 4
0
def NMOstackSingle(data, tintercept, v, timeFile):
    dx = 20.0
    xorig = np.arange(38) * dx
    timdat = download(timeFile, verbose=False)
    time = np.load(timdat)
    singletrace = NMOstack(data, xorig, time, v)

    _, ax = plt.subplots(1, 1, figsize=(7, 8))
    kwargs = {
        "skipt": 1,
        "scale": 2.0,
        "lwidth": 1.0,
        "sampr": 0.004,
        "ax": ax,
        "clip": 10,
    }
    extent = [singletrace.min(), singletrace.max(), time.max(), time.min()]
    ax.invert_yaxis()
    ax.axis(extent)
    wiggle(singletrace.reshape([1, -1]), **kwargs)
    ax.set_xlabel("Amplitude")
    ax.set_ylabel("Time (s)")