include "slowness.h" using namespace SEISPP; class SlownessVector { public: double ux,uy; // base vector stored as components in s/km units SlownessVector(); SlownessVector(const SlownessVector&); double mag(); double azimuth(); double baz(); }; class RectangularSlownessGrid { public: string name; double uxlow, uylow; double dux, duy; int nux, nuy; RectangularSlownessGrid(); // generic default is defined RectangularSlownessGrid(string nm, double uxl, double uxh, double du1,double du2,int n1, int n2); RectangularSlownessGrid(Pf *pf,string tag); RectangularSlownessGrid(const RectangularSlownessGrid&); double ux(int i) {return(uxlow+i*dux);}; double uy(int i) {return(uylow+i*duy);}; SlownessVector slow(int i, int j); };
Slowness vectors are a common concept in array processing. The SlownessVector object encapsulates this concept. The slowness vector is defined by a local geographical coordinate system with +x pointing east and +y pointing north. The azimuth function returns a geographical azimuth (0 is north for an azimuth) for the slowness vector defined by the components ux and uy in the local cartesian system. Similarly baz returns the back azimuth.
In array processing slowness grids are commonly used to find a best beam. The RectangularSlownessGrid object defines one particular class of such a grid. Slowness space in the Cartesian system (ux and uy) is gridded in a rectangular area with (uxlow, uylow) defining the lower left corner of the grid. The slowness grid is then uniformly spaced in units of dux (for x) and duy (for y). nux and nuy define the total number of grid points in each of the x and y directions. Slowness vectors for the grid can be obtained by calling the component functions (ux and uy) the slow function which returns a SlownessVector object.
The default constructor for a SlownessVector initializes ux and uy to zero.
The RectangularSlownessGrid object has a fully parameterized constructor which loads all the data in the object directly. I trust it's usage is obvious.
A less obvious usage is the parameter file based constructor for a RectangularSlownessGrid object. In that usage pf is a pointer to an Antelope pf and tag is a string used to define the block of the parameter file to load the data from. The example below is the best way to document this.
To use the parameter file constructor for a RectangularSlownessGrid object follow this template.
Slowness_Grid_Example &Arr{ #Here the tag is Slowness_Grid_Example Slowness_Grid_Name test # name of the grid object # This creates a 21 x 21 grid from -0.1 to 0.1 in increments of .01 uxlow -0.1 uylow -0.1 nux 21 nuy 21 dux 0.01 duy 0.01 }
None of these objects currently will throw an exception.
The default constructor sets the slowness vector components to zero. The azimuth and baz functions will silently return 0 in this situation.
Gary L. Pavlis Department of Geological Sciences Indiana University pavlis@indiana.edu