Exemple #1
0
    def test_plot_topography_high(self, one_fault_model_topo_solution):
        """
        Args:
            vista_object_computed_topo:
        """
        vista_object_computed_topo = GemPyToVista(one_fault_model_topo_solution,
                                                  plotter_type='basic', off_screen=True)

        vista_object_computed_topo.plot_topography(scalars='topography')
        img = vista_object_computed_topo.p.show(screenshot=True)
        plt.imshow(img[1])
        plt.show()
        print('foo')
Exemple #2
0
    def test_plot_several3(self, one_fault_model_topo_solution):
        vista_object_computed_topo = GemPyToVista(one_fault_model_topo_solution,
                                                  plotter_type='basic', off_screen=True)

        vista_object_computed_topo.plot_surface_points()
        vista_object_computed_topo.plot_surfaces()
        vista_object_computed_topo.plot_structured_grid(render_topography=True,
                                                        scalar_field='scalar',
                                                        series='Strat_Series',
                                                        )
        vista_object_computed_topo.plot_topography(scalars='topography')
        img = vista_object_computed_topo.p.show(screenshot=True)
        plt.imshow(img[1])
        plt.show()
Exemple #3
0
def plot_3d(model,
            plotter_type='basic',
            show_data: bool = True,
            show_results: bool = True,
            show_surfaces: bool = True,
            show_lith: bool = True,
            show_scalar: bool = False,
            show_boundaries: bool = True,
            show_topography: Union[bool, list] = False,
            scalar_field: str = None,
            ve=None,
            kwargs_plot_structured_grid=None,
            kwargs_plot_topography=None,
            image=False,
            off_screen=False,
            **kwargs) -> GemPyToVista:
    """foobar

    Args:

        model (:class:`gempy.core.model.Project`): Container class of all
         objects that constitute a GemPy model.
        plotter_type: PyVista plotter types. Supported plotters are:
         'basic', 'background', and 'notebook'.
        show_data (bool): Show original input data. Defaults to True.
        show_results (bool): If False, override show lith, show_scalar, show_values
        show_lith (bool): Show lithological block volumes. Defaults to True.
        show_scalar (bool): Show scalar field isolines. Defaults to False.
        show_boundaries (bool): Show surface boundaries as lines. Defaults to True.
        show_topography (bool): Show topography on plot. Defaults to False.
        scalar_field (str): Name of the field to be activated
        series_n (int): number of the scalar field.
        ve (float): Vertical Exaggeration
        kwargs_plot_structured_grid:
        kwargs_plot_topography:
        **kwargs:

    Returns:
        :class:`gempy.plot.vista.GemPyToVista`

    """
    if image is True:
        off_screen = True
        kwargs['off_screen'] = True
        plotter_type = 'basic'
    if show_results is False:
        show_surfaces = False
        show_scalar = False
        show_lith = False

    if kwargs_plot_topography is None:
        kwargs_plot_topography = dict()
    if kwargs_plot_structured_grid is None:
        kwargs_plot_structured_grid = dict()

    fig_path: str = kwargs.get('fig_path', None)

    gpv = GemPyToVista(model, plotter_type=plotter_type, **kwargs)
    if show_surfaces and len(model.solutions.vertices) != 0:
        gpv.plot_surfaces()
    if show_lith is True and model.solutions.lith_block.shape[0] != 0:
        gpv.plot_structured_grid('lith', **kwargs_plot_structured_grid)
    if show_scalar is True and model.solutions.scalar_field_matrix.shape[
            0] != 0:
        gpv.plot_structured_grid("scalar", series=scalar_field)

    if show_data:
        gpv.plot_data()
    if show_topography and model._grid.topography is not None:
        gpv.plot_topography(**kwargs_plot_topography)

    if ve is not None:
        gpv.p.set_scale(zscale=ve)

    if fig_path is not None:
        gpv.p.show(screenshot=fig_path)

    if image is True:
        img = gpv.p.show(screenshot=True)
        plt.imshow(img[1])
        plt.axis('off')
        plt.show()
        gpv.p.close()

    if off_screen is False:
        gpv.p.show()

    return gpv