Geoview

Diavatly module

tomopal.geoview.diavatly.DOI(d1: str, d2: str, r1: float, r2: float)[source]

Returns the DOI array given two files containing the res2dinv exported data. Resistivity units assumed to be ohm*m. (depends on the read_xyz function)

Parameters
  • d1 – doi file 1

  • d2 – doi file 2

  • r1 – resistivity value for the reference model 1 (ohm*m)

  • r2 – resistivity value for the reference model 2 (ohm*m)

Returns

tomopal.geoview.diavatly.blocks_from_rc(rows, columns)[source]

Returns the blocks forming a 2D grid whose rows and columns widths are defined by the two arrays rows, columns

tomopal.geoview.diavatly.dirmaker(dird)[source]

Given a folder path, check if it exists, and if not, creates it :param dird: path :return:

tomopal.geoview.diavatly.find_norm(array, levels)[source]

Convert values to linear space to facilitate visualization!

tomopal.geoview.diavatly.get_contour_line(x, y, z, level)[source]
tomopal.geoview.diavatly.model_map(polygons=None, vals=array([], dtype=float64), levels=0, log=1, aspect=1, cbpos=0.1, ndec=1, cmap_name='coolwarm', stepx=None, stepy=None, folder=None, figname=None, contour=None, contours_path=None, binned=False, fontsize=5, labelsize=5, dpi=300, extension='png')[source]

Given a mesh geometry and values, produces the colored mesh with the proper color scale

Parameters
  • stepy – float: Step size to discretize the y-axis

  • stepx – float: Step size to discretize the x-axis

  • dpi – int: fig dpi

  • contours_path – list: List of matplotlib contour paths

  • contour – float: Contour value

  • polygons – np.array (n, m, 4): array containing the xy coordinates of the different mesh blocks

  • vals – np.array (n*m): array containing the value assigned to each block

  • levels – list: sequential or continuous color scale

  • aspect – float: plot aspect ratio

  • cbpos – float: z-position of the colorbar between 0 and 1

  • log – bool: flag for logarithmic scale

  • folder – str: folder where images will be saved

  • figname – str: figure name

Returns

tomopal.geoview.diavatly.rc_from_blocks(blocks)[source]

Computes the x and y dimensions of each block :param blocks: :return:

tomopal.geoview.diavatly.read_xyz(file)[source]
Expects a dat file containing the four following columns separated by a space, exported from res2dinv:

1 Cell id 2-3 4-5 6-7 8-9 Block X-Z coordinates 10-11 Block center 12 Resistivity value for the block

tomopal.geoview.diavatly.refine_axis(widths, r_pt, ext, cnd, d_dim, a_lim)[source]

iotomo module

class tomopal.geoview.iotomo.TomoVTK(output_dir, name=None)[source]

Bases: object

__init__(output_dir, name=None)[source]

Initialize self. See help(type(self)) for accurate signature.

dem_to_vtk(dem)[source]
grid_to_vtk(blocks, values, values_names=None)[source]

# TODO: define values shape :param blocks: :param values: :param values_names: :return:

tomopal.geoview.iotomo.order_vertices(vertices)[source]

Paraview expects vertices in a particular order for Quad object, with the origin at the bottom left corner. :param vertices: (x, y) coordinates of the quad vertices :return: Sorted vertices

tomopal.geoview.iotomo.read_file(file=None, header=0)[source]

Reads space separated dat file

Module contents