Exemplo n.º 1
0
    def setUp(self):

        # Define the parameters for each survey line
        survey_type = [
            "dipole-dipole", "pole-pole", "pole-dipole", "dipole-pole"
        ]
        data_type = "volt"
        dimension_type = "3D"
        end_locations = np.r_[-1000.0, 1000.0, 0.0, 0.0]
        station_separation = 200.0
        num_rx_per_src = 5

        # The source lists for each line can be appended to create the source
        # list for the whole survey.
        source_list = []
        for ii in range(0, len(survey_type)):
            source_list += utils.generate_dcip_sources_line(
                survey_type[ii],
                data_type,
                dimension_type,
                end_locations,
                0.0,
                num_rx_per_src,
                station_separation,
            )

        # Define the survey
        self.survey = dc.survey.Survey(source_list)
Exemplo n.º 2
0
    def test_dcip3d(self):

        # Survey parameters
        data_type = "volt"
        end_points = np.array([-100, 50, 100, -50])

        # 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,
                "3D",
                end_points,
                self.topo,
                self.num_rx_per_src,
                self.station_spacing,
            )
        survey3D = dc.survey.Survey(source_list)
        dobs = np.random.rand(survey3D.nD)
        dunc = 1e-3 * np.ones(survey3D.nD)
        data3D = data.Data(survey3D, dobs=dobs, standard_deviation=dunc)

        # Write DCIP3D files
        io_utils.write_dcipoctree_ubc(
            self.dir_path + "/dcip3d_general.txt",
            data3D,
            "volt",
            "dobs",
            format_type="general",
            comment_lines="GENERAL FORMAT",
        )
        io_utils.write_dcipoctree_ubc(
            self.dir_path + "/dcip3d_surface.txt",
            data3D,
            "volt",
            "dobs",
            format_type="surface",
            comment_lines="SURFACE FORMAT",
        )

        # Read DCIP3D files
        data_general = io_utils.read_dcipoctree_ubc(
            self.dir_path + "/dcip3d_general.txt", "volt"
        )
        data_surface = io_utils.read_dcipoctree_ubc(
            self.dir_path + "/dcip3d_surface.txt", "volt"
        )

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

        self.assertTrue(passed)
        print("READ/WRITE METHODS FOR DCIP3D DATA PASSED!")
Exemplo n.º 3
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!")
Exemplo n.º 4
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!")
Exemplo n.º 5
0
# For the source, we must define the AB electrode locations. For the receivers
# we must define the MN electrode locations. Instead of creating the survey
# from scratch (see 1D example), we will use the *generat_dcip_survey_line* utility.
#

# Define survey line parameters
survey_type = "dipole-dipole"
dimension_type = "2.5D"
data_type = "volt"
end_locations = np.r_[-400.0, 400]
station_separation = 50.0
num_rx_per_src = 8

# Generate source list for DC survey line
source_list = generate_dcip_sources_line(survey_type, data_type,
                                         dimension_type, end_locations,
                                         xyz_topo, num_rx_per_src,
                                         station_separation)

# Define survey
dc_survey = dc.survey.Survey(source_list, survey_type=survey_type)

###############################################################
# Create OcTree Mesh
# ------------------
#
# Here, we create the OcTree mesh that will be used to predict both DC
# resistivity and IP data.
#

dh = 10.0  # base cell width
dom_width_x = 2400.0  # domain width x