Parameter¶
Parameter class definition.
-
class
Parameter
(lay_min, lay_max, par_min, par_max, par_rev, lay_type='thickness')¶ Bases:
object
Class for defining the bounds of an inversion parameter.
Variables: - par_type ({'FX', 'FTL', 'LN', 'LR', 'CT', 'CD'}) – String to denote how the layering was defined. Specifically, ‘FX’ = Fixed ‘FTL’ = Fixed Thickness Layers ‘LN’ = Layering by Number ‘LR’ = Layering Ratio ‘CT’ = Custom Thickness ‘CD’ = Custom Depth
- par_add_value (par_value,) – Numerical values to provide context about the type of layering selected. par_add_value only used for three letter parameter types (i.e., ‘FTL’).
- lay_max (lay_min,) – Minimum and maximum thickness or depth of each layer, respectively.
- par_max (par_min,) – Minimum and maximum potential value of the parameter, one float value per layer.
- par_rev (list) – Indicate whether to allow parameter reversals, one bool value per layer.
-
__init__
(lay_min, lay_max, par_min, par_max, par_rev, lay_type='thickness')¶ Initialize a Parameter object.
Parameters: - lay_min, lay_max (iterable) – Minimum and maximum thickness or depth of each layer, respectively.
- par_min, par_max (iterable) – Minimum and maximum potential value of the parameter, one float per layer.
- par_rev (iterable) – Indicate whether to allow parameter reversals, one bool per layer.
- lay_type ({‘thickness’, ‘depth’}, optional) – Indicate whether the layers are defined in terms of depth or thickness.
Returns: Parameter – Instantiated Parameter object.
-
static
check_depth_factor
(depth_factor)¶ Check input value for factor.
-
static
check_layers
(lower_name, lower, upper_name, upper)¶ Check layering input.
- Specifically:
- Check that lower and upper are the same length.
2. Ensure that each value for lower is less than the corresponding value for upper.
-
classmethod
clone
(parameter)¶ Copy provided Parameter object.
-
static
depth_ftl
(nlayers, thickness)¶ Calculate min and max thicknesses for each layer using FTL.
Parameters: - nlayers (int) – Desired number of layers.
- thickness (float) – Thickness of each layer.
Returns: Tuple – Tuple of lists indicating thicknesses of the form ([minthickness…], [maxthickness…]).
-
static
depth_ln
(wmin, wmax, nlayers, depth_factor=2)¶ Calculate min and max depth for each layer using LN.
Parameters: - wmin, wmax (float) – Minimum and maximum measured wavelength from the fundamental mode Rayleigh wave disperison.
- nlayers (int) – Desired number of layers.
- depth_factor ([float, int], optional) – Factor by which the maximum wavelength is divided to estimate the maximum depth of profiling, default is 2.
Returns: Tuple – Tuple of lists indicating depths of the form ([mindepth…], [maxdepth…]).
-
static
depth_lr
(wmin, wmax, lr, depth_factor=2)¶ Return minimum and maximum depth for each layer using the Layering Ratio approach developed by Cox and Teague (2016).
Note that the Layering Ratio approach implemented here has been modified slightly to ensure the maximum depth of the last layer does not exceed dmax. Suggestions for solving this issue are hinted at in Cox and Teague (2016), but not provided explicitly.
Parameters: - wmin, wmax (float) – Minimum and maximum measured wavelength from the fundamental mode Rayleigh wave dispersion.
- lr (float) – Layering Ratio, this controls the number of layers and their potential thicknesses, refer to Cox and Teague 2016 for details.
- depth_factor ([float, int], optional) – Factor by which the maximum wavelength is divided to estimate the maximum depth of profiling, default is 2.
Returns: Tuple – Tuple of lists indicating depths of the form ([mindepth…], [maxdepth…]).
-
classmethod
from_ftl
(nlayers, thickness, par_min, par_max, par_rev=False)¶ Create Parameter using Fixed Thickness Layering (FTL).
Parameters: - nlayers (int) – Number of desired layers.
- thickness (float) – Thickness of all layers in meters.
- par_min, par_max (float) – Minimum and maximum potential value of the parameter, applied to all layers.
- par_rev (bool, optional) – Indicate whether layers are allowed to reverse or not, default is False (i.e., no reversal allowed).
Returns: Parameter – Instantiated Parameter object.
Note
If a more detailed parameterization is desired than available here use the dinver user inferface to tweak the resulting .param file.
-
classmethod
from_fx
(value)¶ Create Parameter using Fixed (FX) layering.
Parameters: value ({float, int}) – Value assigned to the parameter at all depths. Value will not be allowed to change with depth. Returns: Parameter – Instantiated Parameter object.
-
classmethod
from_ln
(wmin, wmax, nlayers, par_min, par_max, par_rev, depth_factor=2)¶ Create Parameter using Layering by Number (LN).
Parameters: - wmin, wmax (float) – Minimum and maximum measured wavelength from the fundamental mode Rayleigh wave disperison.
- nlayers (int) – Desired number of layers.
- par_min, par_max (float) – Minimum and maximum potential value of the parameter, applied to all layers.
- par_rev (bool, optional) – Indicate whether layers are allowed to reverse or not, default is False (i.e., no reversal allowed).
- depth_factor ([float, int], optional) – Factor by which the maximum wavelength is divided to estimate the maximum depth of profiling, default is 2.
Returns: Parameter – Instantiated Parameter object.
-
classmethod
from_lr
(wmin, wmax, lr, par_min, par_max, par_rev, depth_factor=2)¶ Alternate constructor to instantiate a Parameter using LR.
Use Layering Ratio (LR) to define the Parameter.
Parameters: - wmin, wmax (float) – Minimum and maximum measured wavelength from the fundamental mode Rayleigh wave dispersion.
- lr (float) – Layering Ratio, this controls the number of layers and their potential thicknesses, refer to Cox and Teague (2016) for details.
- par_min, par_max (float) – Minimum and maximum potential value of the parameter, applied to all layers.
- par_rev (bool, optional) – Indicate whether layers are allowed to reverse or not, default is False (i.e., no reversal allowed).
- depth_factor ([float, int], optional) – Factor by which the maximum wavelength is divided to estimate the maximum depth of profiling, default is 2.
Returns: Parameter – Instantiated Parameter object.
Note
If a more detailed parameterization is desired than available here use the dinver user inferface to tweak the resulting .param file.
-
classmethod
from_parameter_and_link
(par_min, par_max, par_rev, existing_parameter, ptype='vs')¶ Create Parameter from an existing Parameter and link.
Parameters: - par_min, par_max (float) – Minimum and maximum potential value of the parameter, applied to all layers.
- par_rev (bool, optional) – Indicate whether layers are allowed to reverse or not, default is False (i.e., no reversal allowed).
- existing_parameter (Parameter) – Instantiated Parameter object to which you wish to link the current parameter.
- ptype ({‘vs’, ‘pr’, ‘rh’, ‘vp’}, optional) – Inversion parameter, represented by the existing_parameter, default is vs.
Returns: Parameter – Instantiated Parameter with the same layering as existing_parameter, but different bounds.
Note
If a more detailed parameterization is desired than available here use the dinver user inferface to tweak the resulting .param file.
-
lay_type
¶
-
static
make_rectangle
(left, right, upper, lower)¶
-
static
min_max_rev
(nlayers, par_min, par_max, par_rev)¶ Create list for par_min, par_max, par_rev.
-
plot
(ax=None, show_example=True)¶