Point

digraph inheritancefff5d93699 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Point" [URL="#geobipy.src.classes.pointcloud.Point.Point",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="3D Point Cloud with x,y,z co-ordinates"]; "myObject" -> "Point" [arrowsize=0.5,style="setlinewidth(0.5)"]; "myObject" [URL="../core/myObject.html#geobipy.src.classes.core.myObject.myObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "myObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class geobipy.src.classes.pointcloud.Point.Point(x=None, y=None, z=None, elevation=None, **kwargs)

3D Point Cloud with x,y,z co-ordinates

Point(N, x, y, z)

Parameters:
  • N (int) – Number of points

  • x (array_like or geobipy.StatArray, optional) – The x co-ordinates. Default is zeros of size N

  • y (array_like or geobipy.StatArray, optional) – The y co-ordinates. Default is zeros of size N

  • z (array_like or geobipy.StatArray, optional) – The z co-ordinates. Default is zeros of size N

  • units (str, optional) – The units of the co-ordinates. Default is “m”

Returns:

out – The 3D point cloud

Return type:

geobipy.PointCloud3D

Bcast(world, root=0)

Broadcast a PointCloud3D using MPI

Parameters:
  • world (mpi4py.MPI.COMM_WORLD) – MPI communicator

  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

Returns:

out – PointCloud3D broadcast to each rank

Return type:

geobipy.PointCloud3D

Scatterv(starts, chunks, world, root=0)

ScatterV a PointCloud3D using MPI

Parameters:
  • myStart (sequence of ints) – Indices into self that define the starting locations of the chunks to be sent to each rank.

  • myChunk (sequence of ints) – The size of each chunk that each rank will receive.

  • world (mpi4py.MPI.Comm) – The MPI communicator over which to Scatterv.

  • root (int, optional) – The MPI rank to broadcast from. Default is 0.

Returns:

out – The PointCloud3D distributed amongst ranks.

Return type:

geobipy.PointCloud3D

append(other)

Append pointclouds together

Parameters:

other (geobipy.PointCloud3D) – 3D pointcloud

axis(axis='x')

Obtain the axis against which to plot values.

Parameters:

axis (str) – If axis is ‘index’, returns numpy.arange(self.nPoints) If axis is ‘x’, returns self.x If axis is ‘y’, returns self.y If axis is ‘z’, returns self.z If axis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. If axis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

Returns:

out – The requested axis.

Return type:

array_like

block_indices(dx=None, dy=None, x_grid=None, y_grid=None)

Returns the indices of the points lying in blocks across the domain..

Performed before a block median filter by extracting the point location within blocks across the domain. Idea taken from pygmt, however I extracted the indices and this was quite a bit faster.

Parameters:
  • dx (float) – Grid spacing in x.

  • dy (float) – Grid spacing in y.

Returns:

ints

Return type:

Index into self whose points are the median location within blocks across the domain.

block_median(dx=None, dy=None, x_grid=None, y_grid=None, values=None)

Median point within juxtaposed blocks across the domain.

Parameters:
  • dx (float) – Increment in x.

  • dy (float) – Increment in y.

  • values (array_like, optional) – Used to compute the median in each block. Defaults to None.

Returns:

geobipt.PointCloud3d

Return type:

Contains one point in each block.

block_median_indices(dx=None, dy=None, x_grid=None, y_grid=None, values=None)

Index to the median point within juxtaposed blocks across the domain.

Parameters:
  • dx (float) – Increment in x.

  • dy (float) – Increment in y.

  • values (array_like, optional) – Used to compute the median in each block. Defaults to None.

Returns:

ints

Return type:

Index of the median point in each block.

property bounds

Gets the bounding box of the data set

centred_grid_nodes(bounds, spacing)

Generates grid nodes centred over bounds

Parameters:
  • bounds (array_like) – bounds of the dimension

  • spacing (float) – distance between nodes

createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None)

Create the hdf group metadata in file parent: HDF object to create a group inside myName: Name of the group

fileInformation()

Description of PointCloud3D file.

Returns:

out – File description.

Return type:

str

classmethod fromHdf(grp, index=None, **kwargs)

Reads the object from a HDF group

interpolate(dx=None, dy=None, mesh=None, values=None, method='mc', mask=False, clip=True, i=None, block=False, **kwargs)

Interpolate values to a grid.

The grid is automatically generated such that it is centred over the point cloud.

Parameters:
  • dx (float) – Grid spacing in x.

  • dy (float) – Grid spacing in y.

  • values (array_like, optional) – Values to interpolate. Must have size self.nPoints. Defaults to None.

  • method (str, optional) –

    • ‘ct’ uses Clough Tocher interpolation. Default

    • ’mc’ uses Minimum curvature and requires pygmt to be installed.

  • mask (float, optional) – Cells of distance mask away from points are NaN. Defaults to False.

  • clip (bool, optional) – Clip any overshot grid values to the min/max of values. Defaults to True.

  • i (ints, optional) – Use only the i locations during interpolation. Defaults to None.

  • block (bool, optional) – Perform a block median filter before interpolation. Inherrently smooths the final grid, but alleviates aliasing. Defaults to False.

Returns:

geobipy.Model

Return type:

Interpolated values.

map(dx, dy, i=None, **kwargs)

Create a map of a parameter

move(dx, dy, dz)

Move the point by [dx,dy,dz]

property nPoints

Get the number of points

nearest(x, k=1, eps=0, p=2, radius=inf)

Obtain the k nearest neighbours

See also

See

perturb()

Propose a new point given the attached propsal distributions

plot(values, x='index', **kwargs)

Line plot of values against a co-ordinate.

Parameters:
  • values (array_like) – Values to plot against a co-ordinate

  • xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) If xAxis is ‘x’, returns self.x If xAxis is ‘y’, returns self.y If xAxis is ‘z’, returns self.z If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

Returns:

ax – Plot axes handle

Return type:

matplotlib.axes

See also

geobipy.plotting.plot

For additional keyword arguments

property probability

Evaluate the probability for the EM data point given the specified attached priors

Parameters:
  • rEerr (bool) – Include the relative error when evaluating the prior

  • aEerr (bool) – Include the additive error when evaluating the prior

  • height (bool) – Include the elevation when evaluating the prior

  • calibration (bool) – Include the calibration parameters when evaluating the prior

  • verbose (bool) – Return the components of the probability, i.e. the individually evaluated priors

Returns:

out – The evaluation of the probability using all assigned priors

Return type:

float64

Notes

For each boolean, the associated prior must have been set.

Raises:

TypeError – If a prior has not been set on a requested parameter

classmethod read_csv(filename, **kwargs)

Reads x y z co-ordinates from an ascii csv file.

Parameters:

filename (str) – Path to the file to read from.

scatter2D(**kwargs)

Create a 2D scatter plot using the x, y coordinates of the point cloud.

Can take any other matplotlib arguments and keyword arguments e.g. markersize etc.

Parameters:
  • c (1D array_like or StatArray, optional) – Colour values of the points, default is the height of the points

  • i (sequence of ints, optional) – Plot a subset of x, y, c, using the indices in i.

See also

geobipy.plotting.Scatter2D

For additional keyword arguments you may use.

set_kdtree(ndim)

Creates a k-d tree of the point co-ordinates

Parameters:

nDims (int) – Either 2 or 3 to exclude or include the vertical co-ordinate

set_x_posterior()
set_y_posterior()
set_z_posterior()
property summary

Summary of self

toVTK(fileName, pointData=None, format='binary')

Save the PointCloud3D to a VTK file.

Parameters:
  • fileName (str) – Filename to save to.

  • pointData (geobipy.StatArray or list of geobipy.StatArray, optional) – Data at each point in the point cloud. Each entry is saved as a separate vtk attribute.

  • format (str, optional) – “ascii” or “binary” format. Ascii is readable, binary is not but results in smaller files.

Raises:
  • TypeError – If pointData is not a geobipy.StatArray or list of them.

  • ValueError – If any pointData entry does not have size equal to the number of points.

  • ValueError – If any StatArray does not have a name or units. This is needed for the vtk attribute.

vtkStructure()

Generates a vtk mesh structure that can be used in a vtk file.

Returns:

out – Vtk data structure

Return type:

pyvtk.VtkData

writeHdf(parent, name, withPosterior=True, index=None)

Write the StatArray to an HDF object parent: Upper hdf file or group myName: object hdf name. Assumes createHdf has already been called create: optionally create the data set as well before writing

x_axis(xAxis='x')

Obtain the xAxis against which to plot values.

Parameters:

xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) If xAxis is ‘x’, returns self.x If xAxis is ‘y’, returns self.y If xAxis is ‘z’, returns self.z If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.

Returns:

out – The requested xAxis.

Return type:

array_like