public abstract class SlownessModel
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowInnerCoreS
Should we allow J phases, S waves in the inner core? If true, then the
slowness sampling for S will use the S velocity structure for the inner
core.
|
protected java.util.List<CriticalDepth> |
criticalDepths
Stores the layer number for layers in the velocity model with a critical
point at their top.
|
static boolean |
DEBUG
True to enable debugging output.
|
static double |
DEFAULT_SLOWNESS_TOLERANCE |
protected java.util.List<DepthRange> |
fluidLayerDepths
Stores depth ranges that are fluid, ie S velocity is zero.
|
protected java.util.List<DepthRange> |
highSlownessLayerDepthsP
Stores depth ranges that contains a high slowness zone for P.
|
protected java.util.List<DepthRange> |
highSlownessLayerDepthsS
Stores depth ranges that contains a high slowness zone for S.
|
protected double |
maxDeltaP
Maximum difference between successive slowness samples.
|
protected double |
maxDepthInterval
Maximum difference between successive depth samples, default is 115 km.
|
protected double |
maxInterpError |
protected double |
maxRangeInterval
Maximum difference between successive ranges, in radians.
|
protected double |
minDeltaP
Minimum difference between successive slowness samples.
|
protected java.util.List<SlownessLayer> |
PLayers
Stores the final slowness-depth layers for P waves.
|
static boolean |
PWAVE
Just useful for calling methods that need to know whether to use P or S
waves.
|
protected double |
radiusOfEarth
Radius of the Earth in km, usually input from the velocity model.
|
protected java.util.List<SlownessLayer> |
SLayers
Stores the final slowness-depth layers for S waves.
|
protected double |
slownessTolerance
Tolerance for slownesses.
|
static boolean |
SWAVE
Just useful for calling methods that need to know whether to use P or S
waves.
|
protected static int |
vectorLength
Initial length of the slowness vectors.
|
static boolean |
verbose
True to enable verbose output.
|
protected VelocityModel |
vMod
Velocity Model used to get slowness model.
|
Constructor and Description |
---|
SlownessModel(double radiusOfEarth,
VelocityModel vMod,
java.util.List<CriticalDepth> criticalDepth,
java.util.List<DepthRange> highSlownessLayerDepthsP,
java.util.List<DepthRange> highSlownessLayerDepthsS,
java.util.List<DepthRange> fluidLayerDepths,
java.util.List<SlownessLayer> pLayers,
java.util.List<SlownessLayer> sLayers,
double minDeltaP,
double maxDeltaP,
double maxDepthInterval,
double maxRangeInterval,
double maxInterpError,
boolean allowInnerCoreS,
double slownessTolerance) |
SlownessModel(VelocityModel vMod,
double minDeltaP,
double maxDeltaP,
double maxDepthInterval,
double maxRangeInterval,
double maxInterpError,
boolean allowInnerCoreS,
double slownessTolerance) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSlowness(double p,
boolean isPWave)
Adds the given ray parameter, p, to the slowness sampling for the given
waveType.
|
TimeDist |
approxDistance(int slownessTurnLayer,
double p,
boolean isPWave)
generate approximate distance, in radians, for a ray from a surface
source that turns at the bottom of the given slowness layer.
|
protected void |
coarseSample()
Creates a coarse slowness sampling of the velocity model (vMod).
|
protected void |
depthIncCheck()
Checks to make sure no slowness layer spans more than maxDepthInterval.
|
boolean |
depthInFluid(double depth)
Determines if the given depth is contained within a fluid zone.
|
boolean |
depthInFluid(double depth,
DepthRange fluidZoneDepth)
Determines if the given depth is contained within a fluid zone.
|
boolean |
depthInHighSlowness(double depth,
double rayParam,
boolean isPWave)
Determines if the given depth and corresponding slowness is contained
within a high slowness zone.
|
boolean |
depthInHighSlowness(double depth,
double rayParam,
DepthRange highSZoneDepth,
boolean isPWave)
Determines if the given depth and corresponding slowness is contained
within a high slowness zone.
|
protected void |
distanceCheck()
Checks to make sure no slowness layer spans more than maxRangeInterval
and that the (estimated) error due to linear interpolation is less than
maxInterpError.
|
protected void |
findCriticalPoints()
Finds all critical points within a velocity model.
|
double |
findDepth(double rayParam,
boolean isPWave)
Finds a depth corresponding to a slowness over the whole VelocityModel.
|
double |
findDepth(double rayParam,
double topDepth,
double botDepth,
boolean isPWave)
Finds a depth corresponding to a slowness between two given depths in the
Velocity Model.
|
double |
findDepth(double p,
int topCriticalLayer,
int botCriticalLayer,
boolean isPWave)
Finds a depth corresponding to a slowness between two given velocity
layers, including the top and the bottom.
|
protected void |
fixCriticalPoints()
Resets the slowness layers that correspond to critical points.
|
protected java.util.List<SlownessLayer> |
getAllSlownessLayers(boolean isPWave) |
CriticalDepth |
getCriticalDepth(int i) |
DepthRange[] |
getHighSlowness(boolean isPWave) |
double |
getMaxDeltaP() |
double |
getMaxDepthInterval() |
double |
getMaxInterpError()
gets the maximum value of the estimated error due to linear
interpolation.
|
double |
getMaxRangeInterval() |
double |
getMinDeltaP() |
double |
getMinRayParam(double depth,
boolean isPWave) |
double |
getMinTurnRayParam(double depth,
boolean isPWave) |
int |
getNumCriticalDepths() |
int |
getNumLayers(boolean isPWave) |
double |
getRadiusOfEarth() |
protected SlownessLayer |
getSlownessLayer(int layerNum,
boolean isPWave)
Returns the SlownessLayer of the requested waveType.
|
double |
getSlownessTolerance() |
VelocityModel |
getVelocityModel() |
abstract double |
interpolate(double p,
double topVelocity,
double topDepth,
double slope) |
boolean |
isAllowInnerCoreS() |
int |
layerNumberAbove(double depth,
boolean isPWave)
Finds the index of the slowness layer that contains the given depth Note
that if the depth is a layer boundary, it returns the shallower of the
two or possibly more (since total reflections are zero thickness layers)
layers.
|
int |
layerNumberBelow(double depth,
boolean isPWave)
Finds the index of the slowness layer that contains the given depth Note
that if the depth is a layer boundary, it returns the deeper of the two
or possibly more (since total reflections are zero thickness layers)
layers.
|
int |
layerNumForDepth(double depth,
boolean isPWave)
finds a layer that contains the depth.
|
TimeDist |
layerTimeDist(double rayParam,
int layerNum,
boolean isPWave) |
abstract TimeDist |
layerTimeDist(double rayParam,
int layerNum,
boolean isPWave,
boolean downgoing) |
abstract TimeDist |
layerTimeDistAllowTurn(double rayParam,
int layerNum,
boolean isPWave,
boolean downgoing) |
protected void |
rayParamIncCheck()
Checks to make sure that no slowness layer spans more than maxDeltaP.
|
void |
setAllowInnerCoreS(boolean allowInnerCoreS) |
void |
setMaxDeltaP(double maxDeltaP) |
void |
setMaxDepthInterval(double maxDepthInterval) |
void |
setMaxInterpError(double maxInterpError)
sets the maximum value of the estimated error due to linear
interpolation.
|
void |
setMaxRangeInterval(double maxRangeInterval)
sets the maximum range interval for surface focus turning waves between
slowness samples, input in degrees.
|
void |
setMinDeltaP(double minDeltaP) |
void |
setRadiusOfEarth(double radiusOfEarth) |
void |
setSlownessTolerance(double slownessTolerance) |
SplitLayerInfo |
splitLayer(double depth,
boolean isPWave) |
abstract double |
toSlowness(double velocity,
double depth) |
abstract SlownessLayer |
toSlownessLayer(VelocityLayer vLayer,
boolean isPWave) |
java.lang.String |
toString() |
abstract double |
toVelocity(double slowness,
double depth) |
boolean |
validate()
Performs consistency check on the slowness model.
|
public static transient boolean DEBUG
public static transient boolean verbose
protected double radiusOfEarth
protected VelocityModel vMod
protected java.util.List<CriticalDepth> criticalDepths
CriticalDepth
protected java.util.List<DepthRange> highSlownessLayerDepthsP
DepthRange
protected java.util.List<DepthRange> highSlownessLayerDepthsS
DepthRange
protected java.util.List<DepthRange> fluidLayerDepths
DepthRange
protected static int vectorLength
protected java.util.List<SlownessLayer> PLayers
SlownessLayer
protected java.util.List<SlownessLayer> SLayers
SlownessLayer
protected double minDeltaP
protected double maxDeltaP
protected double maxDepthInterval
protected double maxRangeInterval
radiusOfEarth
protected double maxInterpError
protected boolean allowInnerCoreS
public static final double DEFAULT_SLOWNESS_TOLERANCE
protected double slownessTolerance
public static final boolean PWAVE
public static final boolean SWAVE
public SlownessModel(VelocityModel vMod, double minDeltaP, double maxDeltaP, double maxDepthInterval, double maxRangeInterval, double maxInterpError, boolean allowInnerCoreS, double slownessTolerance) throws NoSuchMatPropException, NoSuchLayerException, SlownessModelException
public SlownessModel(double radiusOfEarth, VelocityModel vMod, java.util.List<CriticalDepth> criticalDepth, java.util.List<DepthRange> highSlownessLayerDepthsP, java.util.List<DepthRange> highSlownessLayerDepthsS, java.util.List<DepthRange> fluidLayerDepths, java.util.List<SlownessLayer> pLayers, java.util.List<SlownessLayer> sLayers, double minDeltaP, double maxDeltaP, double maxDepthInterval, double maxRangeInterval, double maxInterpError, boolean allowInnerCoreS, double slownessTolerance)
public void setRadiusOfEarth(double radiusOfEarth)
public void setMinDeltaP(double minDeltaP)
public void setMaxDeltaP(double maxDeltaP)
public void setMaxDepthInterval(double maxDepthInterval)
public void setMaxRangeInterval(double maxRangeInterval)
public void setMaxInterpError(double maxInterpError)
public void setAllowInnerCoreS(boolean allowInnerCoreS)
public void setSlownessTolerance(double slownessTolerance)
public VelocityModel getVelocityModel()
public final double getRadiusOfEarth()
public final double getMinDeltaP()
public final double getMaxDeltaP()
public final double getMaxDepthInterval()
public final double getMaxRangeInterval()
public final double getMaxInterpError()
public final boolean isAllowInnerCoreS()
public final double getSlownessTolerance()
public final int getNumCriticalDepths()
public final CriticalDepth getCriticalDepth(int i)
public final int getNumLayers(boolean isPWave)
public double getMinTurnRayParam(double depth, boolean isPWave) throws NoSuchLayerException, SlownessModelException
NoSuchLayerException
SlownessModelException
public double getMinRayParam(double depth, boolean isPWave) throws NoSuchLayerException, SlownessModelException
NoSuchLayerException
SlownessModelException
public DepthRange[] getHighSlowness(boolean isPWave)
protected SlownessLayer getSlownessLayer(int layerNum, boolean isPWave)
protected java.util.List<SlownessLayer> getAllSlownessLayers(boolean isPWave)
public abstract double toSlowness(double velocity, double depth) throws SlownessModelException
SlownessModelException
public abstract double toVelocity(double slowness, double depth) throws SlownessModelException
SlownessModelException
public final TimeDist layerTimeDist(double rayParam, int layerNum, boolean isPWave) throws SlownessModelException
SlownessModelException
public abstract TimeDist layerTimeDist(double rayParam, int layerNum, boolean isPWave, boolean downgoing) throws SlownessModelException
SlownessModelException
public abstract TimeDist layerTimeDistAllowTurn(double rayParam, int layerNum, boolean isPWave, boolean downgoing) throws SlownessModelException
SlownessModelException
public abstract SlownessLayer toSlownessLayer(VelocityLayer vLayer, boolean isPWave) throws SlownessModelException
SlownessModelException
public abstract double interpolate(double p, double topVelocity, double topDepth, double slope) throws SlownessModelException
SlownessModelException
public TimeDist approxDistance(int slownessTurnLayer, double p, boolean isPWave) throws NoSuchLayerException, SlownessModelException
NoSuchLayerException
- occurs if no layer in the velocity model contains the
given depth.SlownessModelException
- occurs if getNumLayers() == 0 as we cannot compute a
distance without a layer.public boolean depthInHighSlowness(double depth, double rayParam, boolean isPWave)
public boolean depthInHighSlowness(double depth, double rayParam, DepthRange highSZoneDepth, boolean isPWave)
public boolean depthInFluid(double depth)
depthInFluid(double, DepthRange)
public boolean depthInFluid(double depth, DepthRange fluidZoneDepth)
public SplitLayerInfo splitLayer(double depth, boolean isPWave) throws SlownessModelException, NoSuchLayerException
protected void findCriticalPoints() throws SlownessModelException
SlownessModelException
- occurs if validate() returns false, this indicates a bug
in the code.public double findDepth(double rayParam, boolean isPWave) throws SlownessModelException
SlownessModelException
public double findDepth(double rayParam, double topDepth, double botDepth, boolean isPWave) throws SlownessModelException
SlownessModelException
public double findDepth(double p, int topCriticalLayer, int botCriticalLayer, boolean isPWave) throws SlownessModelException
SlownessModelException
- occurs if topCriticalLayer > botCriticalLayer because
there are no layers to search, or if there is an increase
in slowness, ie a negative velocity gradient, that just
balances the decrease in slowness due to the spherical
earth, or if the ray parameter p is not contained within
the specified layer range.protected void coarseSample() throws SlownessModelException, NoSuchLayerException, NoSuchMatPropException
protected void rayParamIncCheck() throws SlownessModelException, NoSuchLayerException
protected void depthIncCheck() throws SlownessModelException, NoSuchLayerException
protected void distanceCheck() throws SlownessModelException, NoSuchMatPropException, NoSuchLayerException
protected void addSlowness(double p, boolean isPWave) throws SlownessModelException, NoSuchLayerException
protected void fixCriticalPoints() throws NoSuchLayerException
NoSuchLayerException
public int layerNumForDepth(double depth, boolean isPWave) throws NoSuchLayerException
NoSuchLayerException
public int layerNumberAbove(double depth, boolean isPWave) throws NoSuchLayerException
NoSuchLayerException
- occurs if no layer in the slowness model contains the
given depth.public int layerNumberBelow(double depth, boolean isPWave) throws NoSuchLayerException
NoSuchLayerException
- occurs if no layer in the slowness model contains the
given depth.public boolean validate() throws SlownessModelException
SlownessModelException
- if any check failspublic java.lang.String toString()
toString
in class java.lang.Object