GeoTessCPPExamples  2.0
Functions | Variables
Tomography2D.cc File Reference
#include "CPPUtils.h"
#include "CPPGlobals.h"
#include "CpuTimer.h"
#include "GeoTessGrid.h"
#include "GeoTessModel.h"
#include "GeoTessPosition.h"
#include "GeoTessModelUtils.h"
#include <vector>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
GeoTessModel * startingModel (const string &gridFile)
 
void generateRayPaths (vector< double ** > &rayPaths)
 
void integrateRayPaths (GeoTessModel *model, const vector< double ** > &rayPaths)
 
void regularization (GeoTessModel *model)
 
void applyAttributeChanges (GeoTessModel *model, const int &attributeIndex, const vector< float > &attributeChanges)
 
GeoTessModel * hitCount (GeoTessModel *inputModel, const vector< double ** > &rayPaths)
 
GeoTessModel * refineModel (GeoTessModel *oldModel, GeoTessModel *hitCountModelRefined)
 

Variables

static double ANMO [3]
 

Function Documentation

◆ applyAttributeChanges()

void applyAttributeChanges ( GeoTessModel *  model,
const int &  attributeIndex,
const vector< float > &  attributeChanges 
)

Given a model and an array of attribute changes, apply the changes to the model.

Parameters
model
attributeIndex
attributeChanges

Definition at line 621 of file Tomography2D.cc.

◆ generateRayPaths()

void generateRayPaths ( vector< double ** > &  rayPaths)

Generate 11 ray paths on the surface of the WGS84 ellipsoid. Each ray path is defined by two unit vector locations, one representing an event, and the other a station. All of the ray paths generated here have the same station, ANMO, located near Albuquerque, New Mexico, USA. The first ray path has zero length (the event is colocated with the station). The remaining events range in distance from 5 to 50 degrees in distance and 0 to 360 in azimuth from the station.

There is no requirement in GeoTess that the ray paths be represented this way, this parameterization was designed for this example program. In fact, GeoTess has no concept of a ray path at all.

Returns
an ArrayList of raypaths. Each ray path consists of two unit vectors, one for the event and one for the station.

Definition at line 343 of file Tomography2D.cc.

◆ hitCount()

GeoTessModel* hitCount ( GeoTessModel *  inputModel,
const vector< double ** > &  rayPaths 
)

Build a new GeoTessModel with the same grid nodes as the input model. There will a single attribute value of type int assigned to each grid node. The name of the attribute is HIT_COUNT and it is unitless.

Parameters
inputModel
rayPaths
Returns

Definition at line 639 of file Tomography2D.cc.

◆ integrateRayPaths()

void integrateRayPaths ( GeoTessModel *  model,
const vector< double ** > &  rayPaths 
)

For every ray path, trace the ray through the model. Compute the integral of the model attribute along the ray path. Also accumulate the 'weight' associated with each grid node during interpolation of the attribute values along the ray path.

The GeoTess method used to compute the required information assume that each ray path is a great circle path from event to station. The radii of the points along the ray path are assumed to coincide with the surface of the WGS84 ellipsoid.

This method doesn't do anything with the results (the integrated value and the weights). This method merely serves as an example of how to extract the relevant information from a GeoTessModel. In a real tomography application, additional code would be required to transfer the information to tomographic matrices for inversion.

Parameters
model
rayPaths

Definition at line 416 of file Tomography2D.cc.

◆ main()

int main ( int  argc,
char **  argv 
)

This application illustrates how to use features available in GeoTessJava to execute tomography on a 2D model. This application does not implement tomography but merely illustrates how to call methods in GeoTessJava that one would likely need to perform tomography.

In order to run properly, this program must be run from directory GeoTessBuilderExamples/tomo2dTest.

This application illustrates the following tasks:

  1. Generate 11 great circle ray paths along the surface of the WGS84 ellipsoid.
  2. Generate a 2D, global starting model consisting of values of attenuation as a function of geographic position on the globe.
  3. Limit the application of tomography to a region of the Earth in North America. This limitation is optional.
  4. Trace rays through the starting model, calculating the path integral of the attenuation along the ray path and the weights (data kernels) of all the grid nodes attributable to interpolation of points on ray paths.
  5. Call methods in GeoTessJava to identify the neighbors of a specified node. These methods are needed to apply regularization of the tomography matrix.
  6. Apply changes in model attribute values computed by tomographic inversion.
  7. Compute a new GeoTessModel whose attribute values are the number of times each grid node was 'touched' by one of the ray paths (hit count).
  8. Execute application GeoTessBuilder to generate a new grid that is more refined in areas of high hit count.
  9. Generate a new model based on the new, refined grid generated with GeoTessBuilder but containing attenuation values copied or interpolated from the original model.
Author
sballar

Definition at line 90 of file Tomography2D.cc.

◆ refineModel()

GeoTessModel* refineModel ( GeoTessModel *  oldModel,
GeoTessModel *  hitCountModelRefined 
)

At this point, we have a new GeoTessModel that has been refined to have higher resolution (more vertices) than the old model. But the new model has attribute value HIT_COUNT, not ATTENUATION. We need to make a new model using the refined grid from hitCountModelRefined but using data obtained from the old model. Where the old model has a vertex that is colocated with the vertex in the new model, the data from the old model is copied to the new model. For vertices in the new model that do not have colocated vertices in the old model, data will be interpolated from the data in the old model.

Parameters
oldModel
hitCountModelRefined
Returns

Definition at line 769 of file Tomography2D.cc.

◆ regularization()

void regularization ( GeoTessModel *  model)

Find the indices of the model 'points' that are the neighbors of each model point. In a real tomography application, this information would be used to apply regularization. Here, the GeoTessGrid is interrogated for the required information, but nothing is done with it.

Parameters
model

Definition at line 544 of file Tomography2D.cc.

◆ startingModel()

GeoTessModel* startingModel ( const string &  gridFile)

Generate a starting model for the Tomography2D example program. The model will have a single attribute (attenuation), and will be a 2D model, i.e., there will be no radius associated with the nodes of the model. For this simple example, the model is populated with a single, constant value of attenuation, 0.1

Parameters
gridFilethe name of the file containing the GeoTessGrid upon which the starting model will be based.
Returns
a pointer to a GeoTessModel

Definition at line 264 of file Tomography2D.cc.

Variable Documentation

◆ ANMO

double ANMO[3]
static

Definition at line 50 of file Tomography2D.cc.