All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.sc.seis.TauP.VelocityModel

edu.sc.seis.TauP.VelocityModel

public class VelocityModel
This class defines basic classes to store and manipulate a velocity model.


Constructor Index

 o VelocityModel()

Method Index

 o clone()
 o depthAtBottom(int)
returns the depth at the bottom of the given layer.
 o depthAtTop(int)
returns the depth at the top of the given layer.
 o earthFlattenTransform()
Returns a flat velocity model object equivalent to the spherical velocity model via the earth flattening transform.
 o evaluateAbove(double, char)
returns the value of the given material property, usually P or S velocity, at the given depth.
 o evaluateAtBottom(int, char)
returns the value of the given material property, usually P or S velocity, at the bottom of the given layer.
 o evaluateAtTop(int, char)
returns the value of the given material property, usually P or S velocity, at the top of the given layer.
 o evaluateBelow(double, char)
returns the value of the given material property, usually P or S velocity, at the given depth.
 o fixDisconDepths()
resets depths of major discontinuities to match those existing in the input velocity model.
 o getCmbDepth()
 o getDisconDepths()
 o getG()
 o getIocbDepth()
 o getMaxRadius()
 o getMeanDensity()
 o getMinRadius()
 o getModelName()
get the model name.
 o getMohoDepth()
 o getNumLayers()
Returns the number of layers in this velocity model.
 o getRadiusOfEarth()
gets radius of the earth (km), by default 6371 kilometers.
 o getSpherical()
 o getVelocityLayer(int)
 o getVelocityLayerClone(int)
 o layerNumberAbove(double)
Finds the layer containing the given depth.
 o layerNumberBelow(double)
Finds the layer containing the given depth.
 o main(String[])
Just for debugging purposes.
 o print()
 o printGMT(DataOutputStream)
prints out the velocity model into a file in a for suitable for plotting with GMT.
 o printGMT(String)
prints out the velocity model into a file in a form suitable for plotting with GMT.
 o readCubicSplineFile(String, String)
Reads in a cubic spline file, the original format of the ttimes code.
 o readFromStream(DataInputStream)
 o readFromStream(String)
 o readNDFile(String)
This method reads in a velocity model from a "nd" ASCII text file, the format used by Xgbm.
 o readTVelFile(String)
This method reads in a velocity model from a "tvel" ASCII text file.
 o readVelocityFile(String)
Reads in a velocity file.
 o replaceLayers(VelocityLayer[], boolean, boolean)
 o setCmbDepth(double)
 o setFileType(String)
sets file type, either "nd" for named discontinuities or "tvel" for ttimes tvel models.
 o setG(double)
 o setIocbDepth(double)
 o setMaxRadius(double)
 o setMeanDensity(double)
 o setMinRadius(double)
 o setModelName(String)
set the model name.
 o setMohoDepth(double)
 o setRadiusOfEarth(double)
sets radius of the earth (km), by default 6371 kilometers.
 o setSpherical(boolean)
 o toString()
 o validate()
Performs internal consistency checks on the velocity model.
 o writeToStream(DataOutputStream)
 o writeToStream(String)

Constructors

 o VelocityModel
 public VelocityModel()

Methods

 o getModelName
 public String getModelName()
get the model name.

 o setModelName
 public void setModelName(String modelName)
set the model name.

 o setFileType
 public void setFileType(String fileType)
sets file type, either "nd" for named discontinuities or "tvel" for ttimes tvel models.

 o setRadiusOfEarth
 public void setRadiusOfEarth(double radiusOfEarth)
sets radius of the earth (km), by default 6371 kilometers.

 o getRadiusOfEarth
 public double getRadiusOfEarth()
gets radius of the earth (km), by default 6371 kilometers.

 o getDisconDepths
 public double[] getDisconDepths()
Returns:
s the depths of discontinuities within the velocity model
 o getMohoDepth
 public double getMohoDepth()
Returns:
s depth (km) of the moho. It can be input from velocity model (*.nd) or should be explicitly set. By default it is 35 kilometers (from Iasp91). For phase naming, the tau model will choose the closest 1st order discontinuity. Thus for most simple earth models these values are satisfactory. Take proper care if your model has a thicker crust and a discontinuity near 35 km depth.
 o setMohoDepth
 public void setMohoDepth(double mohoDepth)
 o getCmbDepth
 public double getCmbDepth()
Returns:
s depth (km) of the cmb (core mantle boundary). It can be input from velocity model (*.nd) or should be explicitly set. By default it is 2889 kilometers (from Iasp91). For phase naming, the tau model will choose the closest 1st order discontinuity. Thus for most simple earth models these values are satisfactory.
 o setCmbDepth
 public void setCmbDepth(double cmbDepth)
 o getIocbDepth
 public double getIocbDepth()
Returns:
s the depth (km) of the iocb (inner core outer core boundary). It can be input from velocity model (*.nd) or should be explicitly set. By default it is 5153.9 kilometers (from Iasp91). For phase naming, the tau model will choose the closest 1st order discontinuity. Thus for most simple earth models these values are satisfactory.
 o setIocbDepth
 public void setIocbDepth(double iocbDepth)
 o getMeanDensity
 public double getMeanDensity()
 o setMeanDensity
 public void setMeanDensity(double meanDensity)
 o getMinRadius
 public double getMinRadius()
 o setMinRadius
 public void setMinRadius(double minRadius)
 o getMaxRadius
 public double getMaxRadius()
 o setMaxRadius
 public void setMaxRadius(double maxRadius)
 o getG
 public double getG()
 o setG
 public void setG(double G)
 o getSpherical
 public boolean getSpherical()
 o setSpherical
 public void setSpherical(boolean spherical)
 o getVelocityLayerClone
 public VelocityLayer getVelocityLayerClone(int layerNum)
 o getVelocityLayer
 public VelocityLayer getVelocityLayer(int layerNum)
 o getNumLayers
 public int getNumLayers()
Returns the number of layers in this velocity model.

 o layerNumberAbove
 public int layerNumberAbove(double depth) throws NoSuchLayerException
Finds the layer containing the given depth. Note this returns the upper layer if the depth happens to be at a layer boundary.

Returns:
the layer number
Throws: NoSuchLayerException
occurs if no layer contains the given depth.
 o layerNumberBelow
 public int layerNumberBelow(double depth) throws NoSuchLayerException
Finds the layer containing the given depth. Note this returns the lower layer if the depth happens to be at a layer boundary.

Returns:
the layer number
Throws: NoSuchLayerException
occurs if no layer contains the given depth.
 o evaluateAbove
 public double evaluateAbove(double depth,
                             char materialProperty) throws NoSuchLayerException, NoSuchMatPropException
returns the value of the given material property, usually P or S velocity, at the given depth. Note this returns the value at the bottom of the upper layer if the depth happens to be at a layer boundary.

Returns:
the value of the given material property
Throws: NoSuchLayerException
occurs if no layer contains the given depth.
Throws: NoSuchMatPropException
occurs if the material property is not recognized.
 o evaluateBelow
 public double evaluateBelow(double depth,
                             char materialProperty) throws NoSuchLayerException, NoSuchMatPropException
returns the value of the given material property, usually P or S velocity, at the given depth. Note this returns the value at the top of the lower layer if the depth happens to be at a layer boundary.

Returns:
the value of the given material property
Throws: NoSuchLayerException
occurs if no layer contains the given depth.
Throws: NoSuchMatPropException
occurs if the material property is not recognized.
 o evaluateAtTop
 public double evaluateAtTop(int layerNumber,
                             char materialProperty) throws NoSuchMatPropException
returns the value of the given material property, usually P or S velocity, at the top of the given layer.

Returns:
the value of the given material property
Throws: NoSuchMatPropException
occurs if the material property is not recognized.
 o evaluateAtBottom
 public double evaluateAtBottom(int layerNumber,
                                char materialProperty) throws NoSuchMatPropException
returns the value of the given material property, usually P or S velocity, at the bottom of the given layer.

Returns:
the value of the given material property
Throws: NoSuchMatPropException
occurs if the material property is not recognized.
 o depthAtTop
 public double depthAtTop(int layerNumber)
returns the depth at the top of the given layer.

Returns:
the depth.
 o depthAtBottom
 public double depthAtBottom(int layerNumber) throws NoSuchMatPropException
returns the depth at the bottom of the given layer.

Returns:
the depth.
Throws: NoSuchMatPropException
occurs if the material property is not recognized.
 o replaceLayers
 public void replaceLayers(VelocityLayer newLayers[],
                           boolean matchTop,
                           boolean matchBot) throws NoSuchLayerException
 o printGMT
 public void printGMT(String filename) throws IOException
prints out the velocity model into a file in a form suitable for plotting with GMT.

 o printGMT
 public void printGMT(DataOutputStream dos) throws IOException
prints out the velocity model into a file in a for suitable for plotting with GMT.

 o validate
 public boolean validate()
Performs internal consistency checks on the velocity model.

 o toString
 public String toString()
 o clone
 public Object clone()
 o print
 public void print()
 o readVelocityFile
 public void readVelocityFile(String filename) throws IOException, VelocityModelException
Reads in a velocity file. The type of file is determined by the fileType var. Calls readTVelFile or readNDFile.

Throws: VelocityModelException
if the type of file cannot be determined.
 o readCubicSplineFile
 public void readCubicSplineFile(String filename,
                                 String lookForModelName) throws IOException
Reads in a cubic spline file, the original format of the ttimes code. not yet implemented since linear interpolation (.tvel) files are conceptually simpler.

 o readTVelFile
 public void readTVelFile(String filename) throws IOException, VelocityModelException
This method reads in a velocity model from a "tvel" ASCII text file. The name of the model file for model "modelname" should be "modelname.tvel". The format of the file is: comment line - generally info about the P velocity model comment line - generally info about the S velocity model depth pVel sVel Density depth pVel sVel Density . . . The velocities are assumed to be linear between sample points. Because this type of model file doesn't give complete information we make the following assumptions: modelname - from the filename, with ".tvel" dropped if present radiusOfEarth - the largest depth in the model meanDensity - 5517.0 G - 6.67e-11 Also, because this method makes use of the string tokenizer, comments are allowed. # as well as // signify that the rest of the line is a comment. C style slash-star comments are also allowed.

Throws: VelocityModelException
occurs if an EOL should have been read but wasn't. This may indicate a poorly formatted tvel file.
 o readNDFile
 public void readNDFile(String filename) throws IOException, VelocityModelException
This method reads in a velocity model from a "nd" ASCII text file, the format used by Xgbm. The name of the model file for model "modelname" should be "modelname.nd". The format of the file is: depth pVel sVel Density Qp Qs depth pVel sVel Density Qp Qs . . . with each major boundary separated with a line with "mantle", "outer-core" or "inner-core". This feature makes phase interpretation much easier to code. Also, as they are not needed for travel time calculations, the density, Qp and Qs may be omitted. The velocities are assumed to be linear between sample points. Because this type of model file doesn't give complete information we make the following assumptions: modelname - from the filename, with ".nd" dropped, if present radiusOfEarth - the largest depth in the model Also, because this method makes use of the string tokenizer, comments are allowed. # as well as // signify that the rest of the line is a comment. C style slash-star comments are also allowed.

Throws: VelocityModelException
occurs if an EOL should have been read but wasn't. This may indicate a poorly formatted model file.
 o fixDisconDepths
 public boolean fixDisconDepths()
resets depths of major discontinuities to match those existing in the input velocity model. The initial values are set such that if there is no discontinuity within the top 100 km then the moho is set to 0.0. Similarly, if there are no discontinuities at al then the cmb is set to the radius of the earth. Similarly for the iocb, except it must be a fluid to solid boundary and deeper than 100km to avoid problems with shallower fluid layers, eg oceans.

 o earthFlattenTransform
 public VelocityModel earthFlattenTransform() throws VelocityModelException
Returns a flat velocity model object equivalent to the spherical velocity model via the earth flattening transform.

Returns:
the flattened VelocityModel object.
Throws: VelocityModelException
occurs ???.
 o writeToStream
 public void writeToStream(String filename) throws IOException
 o writeToStream
 public void writeToStream(DataOutputStream dos) throws IOException
 o readFromStream
 public static VelocityModel readFromStream(String filename) throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
 o readFromStream
 public static VelocityModel readFromStream(DataInputStream dis) throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException
 o main
 public static void main(String args[])
Just for debugging purposes.


All Packages  Class Hierarchy  This Package  Previous  Next  Index