public class VelocityModel
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected double |
cmbDepth
Depth (km) of the cmb (core mantle boundary).
|
static double |
DEFAULT_CMB |
static double |
DEFAULT_IOCB |
static double |
DEFAULT_MOHO |
protected double |
iocbDepth
Depth (km) of the iocb (inner core outer core boundary).
|
protected java.util.List<VelocityLayer> |
layer
expandable array to hold the layers
|
protected double |
maxRadius
maximum radius of the model (km), default 6371.0
|
protected double |
minRadius
minimum radius of the model (km), default 0.0
|
protected java.lang.String |
modelName
name of the velocity model.
|
protected double |
mohoDepth
Depth (km) of the moho.
|
protected double |
radiusOfEarth
reference radius (km), usually radius of the earth, by default 6371
kilometers.
|
protected boolean |
spherical
is this a spherical model? Default is true.
|
protected static int |
vectorLength
the initial length of the layer vector.
|
Constructor and Description |
---|
VelocityModel(java.lang.String modelName,
double radiusOfEarth,
double mohoDepth,
double cmbDepth,
double iocbDepth,
double minRadius,
double maxRadius,
boolean spherical,
java.util.List<VelocityLayer> layer) |
Modifier and Type | Method and Description |
---|---|
double |
depthAtBottom(int layerNumber)
returns the depth at the bottom of the given layer.
|
double |
depthAtTop(int layerNumber)
returns the depth at the top of the given layer.
|
VelocityModel |
earthFlattenTransform()
Returns a flat velocity model object equivalent to the spherical velocity
model via the earth flattening transform.
|
double |
evaluateAbove(double depth,
char materialProperty)
returns the value of the given material property, usually P or S
velocity, at the given depth.
|
double |
evaluateAtBottom(int layerNumber,
char materialProperty)
returns the value of the given material property, usually P or S
velocity, at the bottom of the given layer.
|
double |
evaluateAtTop(int layerNumber,
char materialProperty)
returns the value of the given material property, usually P or S
velocity, at the top of the given layer.
|
double |
evaluateBelow(double depth,
char materialProperty)
returns the value of the given material property, usually P or S
velocity, at the given depth.
|
boolean |
fixDisconDepths()
resets depths of major discontinuities to match those existing in the
input velocity model.
|
double |
getCmbDepth() |
double[] |
getDisconDepths() |
double |
getIocbDepth() |
VelocityLayer[] |
getLayers() |
double |
getMaxRadius() |
double |
getMinRadius() |
java.lang.String |
getModelName()
get the model name.
|
static java.lang.String |
getModelNameFromFileName(java.lang.String filename) |
double |
getMohoDepth() |
int |
getNumLayers()
Returns the number of layers in this velocity model.
|
double |
getRadiusOfEarth()
gets radius of the earth (km), by default 6371 kilometers.
|
boolean |
getSpherical() |
VelocityLayer |
getVelocityLayer(int layerNum) |
VelocityLayer |
getVelocityLayerClone(int layerNum) |
boolean |
isDisconDepth(double depth) |
int |
layerNumberAbove(double depth)
Finds the layer containing the given depth.
|
int |
layerNumberBelow(double depth)
Finds the layer containing the given depth.
|
void |
print() |
void |
printGMT(java.io.PrintWriter dos)
prints out the velocity model into a file in a for suitable for plotting
with GMT.
|
void |
printGMT(java.lang.String filename)
prints out the velocity model into a file in a form suitable for plotting
with GMT.
|
static VelocityModel |
readNDFile(java.io.File file)
This method reads in a velocity model from a "nd" ASCII text file, the
format used by Xgbm.
|
static VelocityModel |
readNDFile(java.io.Reader in,
java.lang.String modelName) |
static VelocityModel |
readTVelFile(java.io.File file)
This method reads in a velocity model from a "tvel" ASCII text file.
|
static VelocityModel |
readTVelFile(java.io.Reader in,
java.lang.String modelName) |
static VelocityModel |
readVelocityFile(java.lang.String filename,
java.lang.String fileType)
Reads in a velocity file.
|
VelocityModel |
replaceLayers(VelocityLayer[] newLayers,
java.lang.String name,
boolean matchTop,
boolean matchBot) |
void |
setCmbDepth(double cmbDepth) |
void |
setIocbDepth(double iocbDepth) |
void |
setMaxRadius(double maxRadius) |
void |
setMinRadius(double minRadius) |
void |
setModelName(java.lang.String modelName)
set the model name.
|
void |
setMohoDepth(double mohoDepth) |
void |
setRadiusOfEarth(double radiusOfEarth)
sets radius of the earth (km), by default 6371 kilometers.
|
void |
setSpherical(boolean spherical) |
java.lang.String |
toString() |
boolean |
validate()
Performs internal consistency checks on the velocity model.
|
protected java.lang.String modelName
protected double radiusOfEarth
public static final double DEFAULT_MOHO
public static final double DEFAULT_CMB
public static final double DEFAULT_IOCB
protected double mohoDepth
protected double cmbDepth
protected double iocbDepth
protected double minRadius
protected double maxRadius
protected boolean spherical
protected static int vectorLength
protected java.util.List<VelocityLayer> layer
public VelocityModel(java.lang.String modelName, double radiusOfEarth, double mohoDepth, double cmbDepth, double iocbDepth, double minRadius, double maxRadius, boolean spherical, java.util.List<VelocityLayer> layer)
public java.lang.String getModelName()
public void setModelName(java.lang.String modelName)
public void setRadiusOfEarth(double radiusOfEarth)
public double getRadiusOfEarth()
public boolean isDisconDepth(double depth)
public double[] getDisconDepths()
public double getMohoDepth()
public void setMohoDepth(double mohoDepth)
public double getCmbDepth()
public void setCmbDepth(double cmbDepth)
public double getIocbDepth()
public void setIocbDepth(double iocbDepth)
public double getMinRadius()
public void setMinRadius(double minRadius)
public double getMaxRadius()
public void setMaxRadius(double maxRadius)
public boolean getSpherical()
public void setSpherical(boolean spherical)
public VelocityLayer getVelocityLayerClone(int layerNum)
public VelocityLayer getVelocityLayer(int layerNum)
public int getNumLayers()
public VelocityLayer[] getLayers()
public int layerNumberAbove(double depth) throws NoSuchLayerException
NoSuchLayerException
- occurs if no layer contains the given depth.public int layerNumberBelow(double depth) throws NoSuchLayerException
NoSuchLayerException
- occurs if no layer contains the given depth.public double evaluateAbove(double depth, char materialProperty) throws NoSuchLayerException, NoSuchMatPropException
NoSuchLayerException
- occurs if no layer contains the given depth.NoSuchMatPropException
- occurs if the material property is not recognized.public double evaluateBelow(double depth, char materialProperty) throws NoSuchLayerException, NoSuchMatPropException
NoSuchLayerException
- occurs if no layer contains the given depth.NoSuchMatPropException
- occurs if the material property is not recognized.public double evaluateAtTop(int layerNumber, char materialProperty) throws NoSuchMatPropException
NoSuchMatPropException
- occurs if the material property is not recognized.public double evaluateAtBottom(int layerNumber, char materialProperty) throws NoSuchMatPropException
NoSuchMatPropException
- occurs if the material property is not recognized.public double depthAtTop(int layerNumber)
public double depthAtBottom(int layerNumber) throws NoSuchMatPropException
NoSuchMatPropException
- occurs if the material property is not recognized.public VelocityModel replaceLayers(VelocityLayer[] newLayers, java.lang.String name, boolean matchTop, boolean matchBot) throws NoSuchLayerException
NoSuchLayerException
public void printGMT(java.lang.String filename) throws java.io.IOException
java.io.IOException
public void printGMT(java.io.PrintWriter dos) throws java.io.IOException
java.io.IOException
public boolean validate()
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public static java.lang.String getModelNameFromFileName(java.lang.String filename)
public static VelocityModel readVelocityFile(java.lang.String filename, java.lang.String fileType) throws java.io.IOException, VelocityModelException
VelocityModelException
- if the type of file cannot be determined.java.io.IOException
public static VelocityModel readTVelFile(java.io.File file) throws java.io.IOException, VelocityModelException
VelocityModelException
- occurs if an EOL should have been read but wasn't. This
may indicate a poorly formatted tvel file.java.io.IOException
public static VelocityModel readTVelFile(java.io.Reader in, java.lang.String modelName) throws java.io.IOException, VelocityModelException
java.io.IOException
VelocityModelException
public static VelocityModel readNDFile(java.io.File file) throws java.io.IOException, VelocityModelException
VelocityModelException
- occurs if an EOL should have been read but wasn't. This
may indicate a poorly formatted model file.java.io.IOException
public static VelocityModel readNDFile(java.io.Reader in, java.lang.String modelName) throws java.io.IOException, VelocityModelException
java.io.IOException
VelocityModelException
public boolean fixDisconDepths()
public VelocityModel earthFlattenTransform() throws VelocityModelException
VelocityModelException
- occurs ???.