GeoTessCExamples  2.0
Functions
Tomography2D.c File Reference
#include "Tomography2D.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
GeoTessModelC * startingModel (char *gridFile)
 
void generateRayPaths (double ****rayPaths, int *nRays)
 
void integrateRayPaths (GeoTessModelC *model, double ***rayPaths, int nRays)
 
void regularization (GeoTessModelC *model)
 
void applyAttributeChanges (GeoTessModelC *model, int attributeIndex, float *attributeChanges, int nChanges)
 
GeoTessModelC * hitCount (GeoTessModelC *model, double ***rayPaths, int nRays)
 
GeoTessModelC * refineModel (GeoTessModelC *oldModel, GeoTessModelC *hitCountModelRefined)
 
void errorCheck ()
 

Function Documentation

◆ applyAttributeChanges()

void applyAttributeChanges ( GeoTessModelC *  model,
int  attributeIndex,
float *  attributeChanges,
int  nChanges 
)

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

Parameters
model
attributeIndex
attributeChanges
nChanges

Definition at line 713 of file Tomography2D.c.

◆ errorCheck()

void errorCheck ( )

Check to see if any errors have occurred. If any, print out the error messages and abort.

Definition at line 1022 of file Tomography2D.c.

◆ generateRayPaths()

void generateRayPaths ( double ****  rayPaths,
int *  nRays 
)

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.

Parameters
rayPathsa pointer to a 3D array containing the rayPaths. Each ray path consists of two unit vectors, one for the event and one for the station. On input, this pointer should be null.
nRaysthe number of rays created.

Definition at line 362 of file Tomography2D.c.

◆ hitCount()

GeoTessModelC* hitCount ( GeoTessModelC *  model,
double ***  rayPaths,
int  nRays 
)

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
model
rayPaths
nRays
Returns
a model containing hit_count values

Definition at line 740 of file Tomography2D.c.

◆ integrateRayPaths()

void integrateRayPaths ( GeoTessModelC *  model,
double ***  rayPaths,
int  nRays 
)

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
nRays

Definition at line 445 of file Tomography2D.c.

◆ 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 Earth.
  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
Sandy Ballard

Definition at line 75 of file Tomography2D.c.

◆ refineModel()

GeoTessModelC* refineModel ( GeoTessModelC *  oldModel,
GeoTessModelC *  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
new model with grid from refinedGrid and attribute values from oldModel.

Definition at line 941 of file Tomography2D.c.

◆ regularization()

void regularization ( GeoTessModelC *  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 606 of file Tomography2D.c.

◆ startingModel()

GeoTessModelC* startingModel ( char *  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 GeoTessModelC

Definition at line 260 of file Tomography2D.c.