GeoTessCPPExamples
2.0
|
#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] |
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.
model | |
attributeIndex | |
attributeChanges |
Definition at line 621 of file Tomography2D.cc.
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.
Definition at line 343 of file Tomography2D.cc.
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.
inputModel | |
rayPaths |
Definition at line 639 of file Tomography2D.cc.
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.
model | |
rayPaths |
Definition at line 416 of file Tomography2D.cc.
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:
Definition at line 90 of file Tomography2D.cc.
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.
oldModel | |
hitCountModelRefined |
Definition at line 769 of file Tomography2D.cc.
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.
model |
Definition at line 544 of file Tomography2D.cc.
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
gridFile | the name of the file containing the GeoTessGrid upon which the starting model will be based. |
Definition at line 264 of file Tomography2D.cc.
|
static |
Definition at line 50 of file Tomography2D.cc.