Ejemplo n.º 1
0
    def theano_f(self):
        # Importing the data from csv files and settign extent and resolution
        geo_data = gempy.create_data([0, 10, 0, 10, -10, 0], [50, 50, 50],
                                     path_o=os.path.dirname(__file__)+"/GeoModeller/test_a/test_a_Foliations.csv",
                                     path_i=os.path.dirname(__file__)+"/GeoModeller/test_a/test_a_Points.csv")

        interp_data = gempy.InterpolatorData(geo_data, dtype='float64', u_grade=[1], compile_theano=True,
                                             verbose=['cov_gradients', 'cov_interfaces',
                                                      'solve_kriging', 'sed_dips_dips', 'slices'])

        return interp_data
Ejemplo n.º 2
0
    def theano_f_1f(self):
        # Importing the data from csv files and settign extent and resolution
        geo_data = gempy.create_data([0, 10, 0, 10, -10, 0], [50, 50, 50],
                                     path_o=os.path.dirname(__file__)+"/GeoModeller/test_d/test_d_Foliations.csv",
                                     path_i=os.path.dirname(__file__)+"/GeoModeller/test_d/test_d_Points.csv")

        gempy.set_series(geo_data, {'series': ('A', 'B'),
                                    'fault1': 'f1'}, order_series=['fault1', 'series'])

        interp_data = gempy.InterpolatorData(geo_data, dtype='float64', compile_theano=True)
        return interp_data
Ejemplo n.º 3
0
    def test_high_res(self):

        # Importing the data from csv files and settign extent and resolution
        geo_data = gempy.read_pickle(
            os.path.dirname(__file__) + "/input_data/geo_data.pickle")
        geo_data.add_orientation(X=-2.88043478e+04,
                                 Y=6.21413043e+06,
                                 Z=-1.17648965e+02,
                                 dip=0,
                                 azimuth=0,
                                 polarity=1,
                                 formation='basement')

        new_grid = gempy.GridClass()
        res = 100

        # Create a new grid object with the new resolution
        new_grid.create_regular_grid_3d(geo_data.extent, [res, res, res])

        # Setting the new grid to the geodata
        gempy.set_grid(geo_data, new_grid)

        n_faults = 0

        interp_data = gempy.InterpolatorData(geo_data,
                                             dtype='float32',
                                             compile_theano=False,
                                             verbose=['slices'],
                                             theano_optimizer='fast_run')

        interp_data.interpolator.tg.fault_matrix = theano.tensor.zeros(
            (n_faults * 2, interp_data.interpolator.tg.grid_val_T.shape[0] +
             2 * interp_data.interpolator.tg.len_points))
        theano.config.optimizer = 'fast_run'
        th_f = theano.function(
            interp_data.interpolator.tg.input_parameters_list(),
            interp_data.interpolator.tg.compute_a_series(
                *interp_data.interpolator.tg.len_series_i.get_value()
                [n_faults:].astype(int),
                *interp_data.interpolator.tg.len_series_f.get_value()
                [n_faults:].astype(int),
                *interp_data.interpolator.tg.n_formations_per_serie.get_value(
                )[n_faults:],
                *interp_data.interpolator.tg.n_universal_eq_T.get_value()
                [n_faults:], interp_data.interpolator.tg.lith_block_init,
                interp_data.interpolator.tg.fault_matrix),
            on_unused_input='ignore',
            allow_input_downcast=True,
            profile=False)

        sol = th_f(*interp_data.get_input_data())

        assert sol
Ejemplo n.º 4
0
def theano_f():
    # Importing the data from csv files and settign extent and resolution
    geo_data = gempy.create_data(
        [0, 10, 0, 10, -10, 0], [50, 50, 50],
        path_o=input_path + "/GeoModeller/test_a/test_a_Foliations.csv",
        path_i=input_path + "/GeoModeller/test_a/test_a_Points.csv")

    interp_data = gempy.InterpolatorData(geo_data,
                                         dtype='float64',
                                         compile_theano=True,
                                         verbose=[])
    return interp_data
Ejemplo n.º 5
0
def test_ch6(theano_f_1f):

    # initialize geo_data object
    geo_data = gp.create_data([0, 3000, 0, 20, 0, 2000],
                              resolution=[50, 3, 67])
    # import data points
    geo_data.import_data_csv(
        input_path + "/input_data/tut_chapter6/ch6_data_interf.csv",
        input_path + "/input_data/tut_chapter6/ch6_data_fol.csv")

    gp.set_series(
        geo_data, {
            "fault":
            geo_data.get_formations()[np.where(
                geo_data.get_formations() == "Fault")[0][0]],
            "Rest":
            np.delete(geo_data.get_formations(),
                      np.where(geo_data.get_formations() == "Fault")[0][0])
        },
        order_series=["fault", "Rest"],
        verbose=0,
        order_formations=['Fault', 'Layer 2', 'Layer 3', 'Layer 4', 'Layer 5'])

    gp.plot_data(geo_data)
    plt.xlim(0, 3000)
    plt.ylim(0, 2000)

    interp_data = gp.InterpolatorData(geo_data, u_grade=[0, 1])
    lith_block, fault_block = gp.compute_model(interp_data)

    gp.plot_section(geo_data, lith_block[0], 0)

    G, centroids, labels_unique, lith_to_labels_lot, labels_to_lith_lot = gp.topology_compute(
        geo_data, lith_block[0], fault_block)

    gp.plot_section(geo_data, lith_block[0], 0, direction='y')
    gp.plot_topology(geo_data, G, centroids)

    lith_to_labels_lot["4"].keys()

    gp.topology.check_adjacency(G, 8, 3)

    G.adj[8]

    G.adj[8][2]["edge_type"]
Ejemplo n.º 6
0
def theano_f_grav():
    # Importing the data from csv files and settign extent and resolution
    geo_data = gempy.create_data(
        [0, 10, 0, 10, -10, 0], [50, 50, 50],
        path_o=input_path + "/GeoModeller/test_a/test_a_Foliations.csv",
        path_i=input_path + "/GeoModeller/test_a/test_a_Points.csv")

    gempy.set_series(geo_data, {
        'series': ('A', 'B'),
        'fault1': 'f1'
    },
                     order_series=['fault1', 'series'])

    interp_data = gempy.InterpolatorData(geo_data,
                                         dtype='float64',
                                         compile_theano=True,
                                         output='gravity',
                                         verbose=[])
    return interp_data