def setUp(self): url = "https://storage.googleapis.com/simpeg/tests/dc_utils/" cloudfiles = [ "mesh3d.msh", "2spheres_conmodel.npy", "rhoA_GIF_dd.txt", "rhoA_GIF_dp.txt", "rhoA_GIF_pd.txt", "rhoA_GIF_pp.txt", ] self.basePath = os.path.expanduser("~/Downloads/TestDCUtilsHalfSpace") io_utils.download( [url + f for f in cloudfiles], folder=self.basePath, overwrite=True ) # Load Mesh mesh_file = os.path.sep.join([self.basePath, "mesh3d.msh"]) mesh = discretize.load_mesh(mesh_file) self.mesh = mesh # Load Model model_file = os.path.sep.join([self.basePath, "2spheres_conmodel.npy"]) model = np.load(model_file) self.model = model xmin, xmax = -15.0, 15.0 ymin, ymax = 0.0, 0.0 zmin, zmax = -0.25, -0.25 xyz = np.array([[xmin, ymin, zmin], [xmax, ymax, zmax]]) self.xyz = xyz self.survey_a = 1.0 self.survey_b = 1.0 self.survey_n = 10 self.plotIt = False
def setUp(self): url = "https://storage.googleapis.com/simpeg/tests/potential_fields/" cloudfiles = [ "MagData.obs", "Gaussian.topo", "Mesh_10m.msh", "ModelStart.sus", "SimPEG_Mag_Input.inp", ] self.basePath = os.path.expanduser("~/Downloads/simpegtemp") self.files = io_utils.download([url + f for f in cloudfiles], folder=self.basePath, overwrite=True)
def setUp(self): url = "https://storage.googleapis.com/simpeg/tests/dc_utils/" cloudfiles = [ "dPred_fullspace.txt", "AB_GIF_fullspace.txt", "MN_GIF_fullspace.txt", "AM_GIF_fullspace.txt", "AN_GIF_fullspace.txt", "BM_GIF_fullspace.txt", "BN_GIF_fullspace.txt", "RhoApp_GIF_fullspace.txt", ] self.basePath = os.path.expanduser("~/Downloads/TestDCUtilsFullSpace") self.files = io_utils.download( [url + f for f in cloudfiles], folder=self.basePath, overwrite=True ) survey_file = os.path.sep.join([self.basePath, "dPred_fullspace.txt"]) data = utils.readUBC_DC3Dobs(survey_file) self.survey = data.survey self.data = data
from SimPEG.utils import io_utils import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes # Reproducible science np.random.seed(518936) ######################################################################### # Setup # ----- # # Load Mesh mesh_file = io_utils.download( "https://storage.googleapis.com/simpeg/pgi_tutorial_assets/mesh_tutorial.ubc" ) mesh = ds.TreeMesh.read_UBC(mesh_file) # Load True geological model for comparison with inversion result true_geology_file = io_utils.download( "https://storage.googleapis.com/simpeg/pgi_tutorial_assets/geology_true.mod" ) true_geology = mesh.read_model_UBC(true_geology_file) # Plot true geology model fig, ax = plt.subplots(1, 4, figsize=(20, 4)) ticksize, labelsize = 14, 16 for _, axx in enumerate(ax): axx.set_aspect(1) axx.tick_params(labelsize=ticksize)
import pandas as pd import shutil import os import matplotlib.pyplot as plt from SimPEG.electromagnetics.static import resistivity as DC from SimPEG import Report from SimPEG.utils.io_utils import download ############################################################################### # Download an example DC data csv file # ------------------------------------ # # file origina and name url = "https://storage.googleapis.com/simpeg/examples/dc_data.csv" fname = download(url, folder="./test_url", overwrite=True) # read csv using pandas df = pd.read_csv(fname) # header for ABMN locations header_loc = ["Spa." + str(i + 1) for i in range(4)] # Apparent resistivity header_apprho = df.keys()[6] ############################################################################### # # Convert file to DC.IO object # ---------------------------- # # Number of the data