Obsidian
Probabilistic Geophysical Joint Inversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
obsidian::world Namespace Reference

Classes

class  InterpolatorSpec
 Represents a boundary of the layer, which is specified by a mesh grid of control points that vary in depth according to a vector of parameters. More...
 
struct  Query
 

Enumerations

enum  SamplingStrategy { noAA, superSamp2X, superSamp4X }
 Represents a sampling strategy for queries. More...
 

Functions

Eigen::MatrixXd sensorGrid (const WorldSpec &worldSpec, uint resx, uint resy, double sensorZ)
 
Eigen::MatrixXd internalGrid2D (std::pair< double, double > xMinMax, std::pair< double, double > yMinMax, uint resx, uint resy)
 
Eigen::MatrixXd internalGrid2DX (std::pair< double, double > xMinMax, std::pair< double, double > yMinMax, uint resx, uint resy)
 
Eigen::MatrixXd edgeGrid2D (std::pair< double, double > xMinMax, std::pair< double, double > yMinMax, uint resx, uint resy)
 
Eigen::MatrixXd sensorGrid3d (const WorldSpec &worldSpec, uint resx, uint resy, uint resz)
 
double length (const Eigen::Vector2d &pt)
 
Eigen::VectorXd linrange (double from, double to, double step=1.0)
 Return a vector containing regularly spaced numbers within a range. This is equivalent to the colon operator in MATLAB (Note the different parameter ordering). More...
 
std::pair< Eigen::MatrixXd,
Eigen::MatrixXd > 
meshgrid (const Eigen::VectorXd &x, const Eigen::VectorXd &y)
 
Eigen::VectorXd flatten (const Eigen::MatrixXd &matrix)
 Maps all the columns of a matrix into a single column vector. Equivalent to the colon operator A(:) in MATLAB. More...
 
Eigen::VectorXi flatten (const Eigen::MatrixXi &matrix)
 Maps all the columns of a matrix into a single column vector. Equivalent to the colon operator A(:) in MATLAB. More...
 
std::pair< Eigen::MatrixXd,
std::pair< Eigen::MatrixXd,
Eigen::MatrixXd > > 
makeGrid (const Eigen::Vector2d &boundaryStart, const Eigen::Vector2d &boundaryEnd, const Eigen::Vector2i &resolution, int padding=0)
 Compute a regular 2D grid given the boundaries and resolutions in the x and y directions. More...
 
std::vector< InterpolatorSpecworldspec2Interp (const WorldSpec &region)
 Generate a vector of interpolators for each layer based on the key info contained in WorldSpec. More...
 
Eigen::VectorXd kernelInterpolate (const Query &query, const uint boundary, const Eigen::MatrixXd &input)
 Given a 3D query, interpolate the depth of each point in the query. More...
 
Eigen::VectorXd linearInterpolate (const Query &query, InterpolatorSpec interpolator)
 Given a 3D query, interpolate the depth of each point in the query linearly. More...
 
Eigen::MatrixXd sqExp (const Eigen::MatrixXd &x1, const Eigen::MatrixXd &x2, const Eigen::VectorXd &lengthScale, bool noisy=false)
 Compute a covariance matrix using the square exponential function. More...
 
Eigen::MatrixXd sqExp2d (const Eigen::Matrix< double, 2,-1 > &x1, const Eigen::Matrix< double, 2,-1 > &x2, const Eigen::Vector2d &lengthScale, bool noisy=false)
 Compute a covariance matrix using the squared exponential function. This function is faster than sqExp, but only applies when the dimensions of the points is 2 (which is true for control points and query points). More...
 
Eigen::Vector2d autoLengthScale (const std::pair< double, double > &x1x2, const std::pair< double, double > &y1y2, uint resx, uint resy)
 Get an appropriate length scale given the grid resolution and a smoothing factor. More...
 
double boundDensity (double raw)
 Bound the density property. More...
 
double boundLogSusceptibility (double raw)
 Bound the log susceptibility. More...
 
double boundThermalConductivity (double raw)
 Bound the thermal conductivity. More...
 
double boundThermalProductivity (double raw)
 Bound the thermal productivity. More...
 
double boundLogResistivity (double raw)
 Bound the log resistivity. More...
 
double boundResistivity (double raw)
 Bound the resistivity. More...
 
double boundResistivityPhase (double raw)
 Bound the resistivity phase. More...
 
double boundPWaveVelocity (double raw)
 Bound the primary wave velocity. More...
 
double boundSusceptibility (double raw)
 Bound the susceptibility. More...
 
Eigen::VectorXd extractProperty (const WorldParams &input, obsidian::RockProperty desiredProp)
 Extract a particular property from the WorldParams. More...
 
Eigen::MatrixXd getTransitions (const std::vector< world::InterpolatorSpec > &boundaries, const WorldParams &inputs, const Query &query)
 Get the depths of each layer at each query point. More...
 
Eigen::MatrixXd thickness (const Eigen::MatrixXd &transitions)
 Get the thickness of each layer at each query point. More...
 
Eigen::MatrixXd postProcessGranites (const Eigen::MatrixXd &transitioni, Eigen::VectorXd offseti, const Eigen::MatrixXd &transitionj, const Query &query, const uint region, const Eigen::MatrixXd &inputs, double floorHeight)
 Code for post-processing the granites, applying a non-linear transform to their heights.
 
Eigen::MatrixXd getVoxels (const std::vector< world::InterpolatorSpec > &interpolators, const WorldParams &inputs, const Query &query, obsidian::RockProperty desiredProp)
 
Eigen::MatrixXd voxelise (const Eigen::MatrixXd &transitions, const Eigen::VectorXd &zIntercepts, const Eigen::VectorXd &props)
 Convert transitions into a grid of points. More...
 
Eigen::VectorXd shrink3d (const Eigen::VectorXd &densities, int nx, int ny, int nz)
 

Detailed Description

Namespace for world model related functionality.

Enumeration Type Documentation

Represents a sampling strategy for queries.

Enumerator
noAA 

Sample with no anti-aliasing.

superSamp2X 

Supersample at twice the resolution.

superSamp4X 

Supersample at four times the resolution.

Function Documentation

Eigen::Vector2d obsidian::world::autoLengthScale ( const std::pair< double, double > &  x1x2,
const std::pair< double, double > &  y1y2,
uint  resx,
uint  resy 
)

Get an appropriate length scale given the grid resolution and a smoothing factor.

Parameters
x1x2The start and end of the grid boundaries in the x direction.
y1y2The start and end of the grid boundaries in the y direction.
resxThe resolution of the grid in the x direction.
resyThe resolution of the grid in the y direction.
smoothingThe smoothing factor.
Returns
A two dimensional vector containing the length scales for the x and y dimensions.
double obsidian::world::boundDensity ( double  raw)

Bound the density property.

Parameters
rawThe raw density value.
Returns
Bounded density value.
double obsidian::world::boundLogResistivity ( double  raw)

Bound the log resistivity.

Parameters
rawThe raw log resistivity value.
Returns
Bounded log resistivity value.
double obsidian::world::boundLogSusceptibility ( double  raw)

Bound the log susceptibility.

Parameters
rawThe raw log susceptibility value.
Returns
Bounded log susceptibility value.
double obsidian::world::boundPWaveVelocity ( double  raw)

Bound the primary wave velocity.

Parameters
rawThe raw primary wave velocity value.
Returns
Bounded primary wave velocity value.
double obsidian::world::boundResistivity ( double  raw)

Bound the resistivity.

Parameters
rawThe raw resistivity value.
Returns
Bounded resistivity value.
double obsidian::world::boundResistivityPhase ( double  raw)

Bound the resistivity phase.

Parameters
rawThe raw resistivity phase value.
Returns
Bounded resistivity phase value.
double obsidian::world::boundSusceptibility ( double  raw)

Bound the susceptibility.

Parameters
rawThe raw susceptibility value.
Returns
Bounded susceptibility value.
double obsidian::world::boundThermalConductivity ( double  raw)

Bound the thermal conductivity.

Parameters
rawThe raw thermal conductivity value.
Returns
Bounded thermal conductivity value.
double obsidian::world::boundThermalProductivity ( double  raw)

Bound the thermal productivity.

Parameters
rawThe raw thermal productivity value.
Returns
Bounded thermal productivity value.
Eigen::VectorXd obsidian::world::extractProperty ( const WorldParams &  input,
obsidian::RockProperty  desiredProp 
)

Extract a particular property from the WorldParams.

Parameters
inputthe worldParams object.
desiredPropthe desired property.
Returns
A vector of that property for each layer in the world.
Eigen::VectorXd obsidian::world::flatten ( const Eigen::MatrixXd &  matrix)

Maps all the columns of a matrix into a single column vector. Equivalent to the colon operator A(:) in MATLAB.

Parameters
matrixThe matrix to flatten.
Returns
A column vector containing the flattened matrix.
Eigen::VectorXi obsidian::world::flatten ( const Eigen::MatrixXi &  matrix)

Maps all the columns of a matrix into a single column vector. Equivalent to the colon operator A(:) in MATLAB.

Parameters
matrixThe matrix to flatten.
Returns
A column vector containing the flattened matrix.
Eigen::MatrixXd obsidian::world::getTransitions ( const std::vector< world::InterpolatorSpec > &  boundaries,
const WorldParams &  inputs,
const Query &  query 
)

Get the depths of each layer at each query point.

Parameters
boundariesThe interpolator specs for each layer.
inputsThe world model parameters.
queryThe query containing the query points.
Returns
A matrix with rows containing the depths of the query points at every layer.
Eigen::VectorXd obsidian::world::kernelInterpolate ( const Query &  query,
const uint  boundary,
const Eigen::MatrixXd &  input 
)

Given a 3D query, interpolate the depth of each point in the query.

Parameters
queryThe 3D query.
layerThe layer to interpolate in.
inputThe packed parameter values.
Returns
A vector of depths that correspond to each query point.
Eigen::VectorXd obsidian::world::linearInterpolate ( const Query &  query,
InterpolatorSpec  interpolator 
)

Given a 3D query, interpolate the depth of each point in the query linearly.

Parameters
queryThe 3D query.
interpolatorThe interpolator specificaitons.
Returns
A vector of depths that correspond to each query point.
Eigen::VectorXd obsidian::world::linrange ( double  from,
double  to,
double  step = 1.0 
)

Return a vector containing regularly spaced numbers within a range. This is equivalent to the colon operator in MATLAB (Note the different parameter ordering).

Parameters
fromThe start of the range.
toThe end of the range (inclusive).
stepThe step size.
std::pair< Eigen::MatrixXd, std::pair< Eigen::MatrixXd, Eigen::MatrixXd > > obsidian::world::makeGrid ( const Eigen::Vector2d &  boundaryStart,
const Eigen::Vector2d &  boundaryEnd,
const Eigen::Vector2i &  resolution,
int  padding = 0 
)

Compute a regular 2D grid given the boundaries and resolutions in the x and y directions.

Parameters
boundaryStart,boundaryEndThe start and end boundaries.
resolutionThe resolution in each direction (npoints in each direction).
paddingNumber of cells to extend outside the boundaries.
Returns
Eigen::MatrixXd obsidian::world::sqExp ( const Eigen::MatrixXd &  x1,
const Eigen::MatrixXd &  x2,
const Eigen::VectorXd &  lengthScale,
bool  noisy = false 
)

Compute a covariance matrix using the square exponential function.

Parameters
x1,x2DxN matrices. Each row represents the input in one dimension.
lengthScaleVector containing length scale value for each dimension.
noisyWhether noise is modelled.
Eigen::MatrixXd obsidian::world::sqExp2d ( const Eigen::Matrix< double, 2,-1 > &  x1,
const Eigen::Matrix< double, 2,-1 > &  x2,
const Eigen::Vector2d &  lengthScale,
bool  noisy = false 
)

Compute a covariance matrix using the squared exponential function. This function is faster than sqExp, but only applies when the dimensions of the points is 2 (which is true for control points and query points).

Parameters
x1,x22xN matrices. Each row represents the input in one dimension.
lengthScaleVector containing length scale value for each dimension.
noisyWhether noise is modelled.
Eigen::MatrixXd obsidian::world::thickness ( const Eigen::MatrixXd &  transitions)

Get the thickness of each layer at each query point.

Parameters
transitionsA nlayers by mqueries matrix of the transitions between layers at each sensor location.
Returns
An mqueries x nthicknesses matrix of layer thicknesses at each sensor location.
Eigen::MatrixXd obsidian::world::voxelise ( const Eigen::MatrixXd &  transitions,
const Eigen::VectorXd &  zIntercepts,
const Eigen::VectorXd &  props 
)

Convert transitions into a grid of points.

Parameters
transitionsThe layer transitions.
zInterceptsA vector containing the z coordinates of the voxels.
Returns
A matrix of property values. Rows contain the property values of each transition point at every depth specified by zIntercepts. The property values are obtained from linear interpolation.
std::vector< InterpolatorSpec > obsidian::world::worldspec2Interp ( const WorldSpec &  region)

Generate a vector of interpolators for each layer based on the key info contained in WorldSpec.

Parameters
regionThe world specifications.