Пример #1
0
    def test_ip2d(self):

        data_type = "apparent_chargeability"
        end_points = np.array([-100, 100])

        # Create sources and data object
        source_list = []
        for stype in self.survey_type:
            source_list = source_list + utils.generate_dcip_sources_line(
                stype,
                data_type,
                "2D",
                end_points,
                self.topo,
                self.num_rx_per_src,
                self.station_spacing,
            )
        survey2D = dc.survey.Survey(source_list)
        dobs = np.random.rand(survey2D.nD)
        dunc = 1e-3 * np.ones(survey2D.nD)
        data2D = data.Data(survey2D, dobs=dobs, standard_deviation=dunc)

        # Write DCIP2D files
        io_utils.write_dcip2d_ubc(
            self.dir_path + "/ip2d_general.txt",
            data2D,
            "apparent_chargeability",
            "dobs",
            "general",
            comment_lines="GENERAL FORMAT",
        )
        io_utils.write_dcip2d_ubc(
            self.dir_path + "/ip2d_surface.txt",
            data2D,
            "apparent_chargeability",
            "dobs",
            "surface",
            comment_lines="SURFACE FORMAT",
        )

        # Read DCIP2D files
        data_general = io_utils.read_dcip2d_ubc(
            self.dir_path + "/ip2d_general.txt", "apparent_chargeability", "general"
        )
        data_surface = io_utils.read_dcip2d_ubc(
            self.dir_path + "/ip2d_surface.txt", "apparent_chargeability", "surface"
        )

        # Compare
        passed = np.all(
            np.isclose(data2D.dobs, data_general.dobs)
            & np.isclose(data2D.dobs, data_surface.dobs)
        )

        self.assertTrue(passed)
        print("READ/WRITE METHODS FOR IP2D DATA PASSED!")
Пример #2
0
    def test_dc2d(self):

        data_type = 'volt'
        end_points = np.array([-100, 100])

        # Create sources and data object
        source_list = []
        for stype in self.survey_type:
            source_list = source_list + utils.generate_dcip_sources_line(
                stype, data_type, '2D', end_points, self.topo,
                self.num_rx_per_src, self.station_spacing)
        survey2D = dc.survey.Survey(source_list)
        dobs = np.random.rand(survey2D.nD)
        dunc = 1e-3 * np.ones(survey2D.nD)
        data2D = data.Data(survey2D, dobs=dobs, standard_deviation=dunc)

        io_utils.write_dcip2d_ubc(self.dir_path + '/dc2d_general.txt',
                                  data2D,
                                  'volt',
                                  'dobs',
                                  'general',
                                  comment_lines="GENERAL FORMAT")
        io_utils.write_dcip2d_ubc(self.dir_path + '/dc2d_surface.txt',
                                  data2D,
                                  'volt',
                                  'dobs',
                                  'surface',
                                  comment_lines="SURFACE FORMAT")

        # Read DCIP2D files
        data_general = io_utils.read_dcip2d_ubc(
            self.dir_path + '/dc2d_general.txt', 'volt', 'general')
        data_surface = io_utils.read_dcip2d_ubc(
            self.dir_path + '/dc2d_surface.txt', 'volt', 'surface')

        # Compare
        passed = (np.all(
            np.isclose(data2D.dobs, data_general.dobs)
            & np.isclose(data2D.dobs, data_surface.dobs)))

        self.assertTrue(passed)
        print("READ/WRITE METHODS FOR DC2D DATA PASSED!")
Пример #3
0
topo_filename = dir_path + "topo_xyz.txt"
dc_data_filename = dir_path + "dc_data.obs"
ip_data_filename = dir_path + "ip_data.obs"


#############################################
# Load Data, Define Survey and Plot
# ---------------------------------
#
# Here we load the observed data, define the DC and IP survey geometry and
# plot the data values using pseudo-sections.
#

# Load data
topo_xyz = np.loadtxt(str(topo_filename))
dc_data = read_dcip2d_ubc(dc_data_filename, "volt", "general")
ip_data = read_dcip2d_ubc(ip_data_filename, "apparent_chargeability", "general")

#########################################################
# Plot Observed Data in Pseudosection
# -----------------------------------
#

# Plot apparent conductivity using pseudo-section
mpl.rcParams.update({"font.size": 12})

apparent_conductivities = 1 / apparent_resistivity_from_voltage(
    dc_data.survey, dc_data.dobs
)

# Plot apparent conductivity pseudo-section
Пример #4
0
topo_filename = dir_path + "topo_xyz.txt"
data_filename = dir_path + "dc_data.obs"

#############################################
# Load Data, Define Survey and Plot
# ---------------------------------
#
# Here we load the observed data, define the DC and IP survey geometry and
# plot the data values using pseudo-sections.
# **Warning**: In the following example, the observations file is assumed to be
# sorted by sources
#

# Load data
topo_xyz = np.loadtxt(str(topo_filename))
dc_data = read_dcip2d_ubc(data_filename, "volt", "general")

#######################################################################
# Plot Observed Data in Pseudo-Section
# ------------------------------------
#
# Here, we demonstrate how to plot 2D data in pseudo-section.
# First, we plot the actual data (voltages) in pseudo-section as a scatter plot.
# This allows us to visualize the pseudo-sensitivity locations for our survey.
# Next, we plot the data as apparent conductivities in pseudo-section with a filled
# contour plot.
#

# Plot voltages pseudo-section
fig = plt.figure(figsize=(12, 5))
ax1 = fig.add_axes([0.1, 0.15, 0.75, 0.78])