Example 8: RVT SRA with simulated profiles

Use RVT with simulated profiles to compute the surface response spectrum and surface spectral ratio.

[1]:
import matplotlib.pyplot as plt
import numpy as np

import pystrata

%matplotlib inline
[2]:
# Increased figure sizes
plt.rcParams["figure.dpi"] = 120

Create a point source theory RVT motion

[3]:
m = pystrata.motion.SourceTheoryRvtMotion(6.0, 30, "wna")
m.calc_fourier_amps()

Create site profile

This is about the simplest profile that we can create. Linear-elastic soil and rock.

[4]:
profile = pystrata.site.Profile(
    [
        pystrata.site.Layer(
            pystrata.site.DarendeliSoilType(18.0, plas_index=0, ocr=1, stress_mean=100),
            10,
            400,
        ),
        pystrata.site.Layer(
            pystrata.site.DarendeliSoilType(18.0, plas_index=0, ocr=1, stress_mean=200),
            10,
            450,
        ),
        pystrata.site.Layer(
            pystrata.site.DarendeliSoilType(18.0, plas_index=0, ocr=1, stress_mean=400),
            30,
            600,
        ),
        pystrata.site.Layer(pystrata.site.SoilType("Rock", 24.0, None, 0.01), 0, 1200),
    ]
)

Create the site response calculator

[5]:
calc = pystrata.propagation.EquivalentLinearCalculator()

Initialize the variations

[6]:
var_thickness = pystrata.variation.ToroThicknessVariation()
var_velocity = pystrata.variation.ToroVelocityVariation.generic_model("USGS C")
var_soiltypes = pystrata.variation.SpidVariation(
    -0.5, std_mod_reduc=0.15, std_damping=0.30
)

Specify the output

[7]:
freqs = np.logspace(-1, 2, num=500)

outputs = pystrata.output.OutputCollection(
    [
        pystrata.output.ResponseSpectrumOutput(
            # Frequency
            freqs,
            # Location of the output
            pystrata.output.OutputLocation("outcrop", index=0),
            # Damping
            0.05,
        ),
        pystrata.output.ResponseSpectrumRatioOutput(
            # Frequency
            freqs,
            # Location in (denominator),
            pystrata.output.OutputLocation("outcrop", index=-1),
            # Location out (numerator)
            pystrata.output.OutputLocation("outcrop", index=0),
            # Damping
            0.05,
        ),
        pystrata.output.InitialVelProfile(),
    ]
)

Perform the calculation

[8]:
count = 20
for p in pystrata.variation.iter_varied_profiles(
    profile,
    count,
    var_thickness=var_thickness,
    var_velocity=var_velocity,
    var_soiltypes=var_soiltypes,
):
    # Here we auto-descretize the profile for wave propagation purposes
    p = p.auto_discretize()
    calc(m, p, p.location("outcrop", index=-1))
    outputs(calc)

Plot the outputs

Create a few plots of the output.

[9]:
for o in outputs[:-1]:
    ax = o.plot(style="stats")
../_images/examples_example-08_16_0.png
../_images/examples_example-08_16_1.png
[10]:
ax = outputs[-1].plot(style="stats")
../_images/examples_example-08_17_0.png

The statistics of the output can be also retrieved and returned as either a dict or pandas.DataFrame.

[11]:
outputs[-1].calc_stats()
[11]:
{'ref': array([ 0.        ,  0.10273973,  0.20547945,  0.30821918,  0.4109589 ,
         0.51369863,  0.61643836,  0.71917808,  0.82191781,  0.92465753,
         1.02739726,  1.13013699,  1.23287671,  1.33561644,  1.43835616,
         1.54109589,  1.64383562,  1.74657534,  1.84931507,  1.95205479,
         2.05479452,  2.15753425,  2.26027397,  2.3630137 ,  2.46575342,
         2.56849315,  2.67123288,  2.7739726 ,  2.87671233,  2.97945205,
         3.08219178,  3.18493151,  3.28767123,  3.39041096,  3.49315068,
         3.59589041,  3.69863014,  3.80136986,  3.90410959,  4.00684932,
         4.10958904,  4.21232877,  4.31506849,  4.41780822,  4.52054795,
         4.62328767,  4.7260274 ,  4.82876712,  4.93150685,  5.03424658,
         5.1369863 ,  5.23972603,  5.34246575,  5.44520548,  5.54794521,
         5.65068493,  5.75342466,  5.85616438,  5.95890411,  6.06164384,
         6.16438356,  6.26712329,  6.36986301,  6.47260274,  6.57534247,
         6.67808219,  6.78082192,  6.88356164,  6.98630137,  7.0890411 ,
         7.19178082,  7.29452055,  7.39726027,  7.5       ,  7.60273973,
         7.70547945,  7.80821918,  7.9109589 ,  8.01369863,  8.11643836,
         8.21917808,  8.32191781,  8.42465753,  8.52739726,  8.63013699,
         8.73287671,  8.83561644,  8.93835616,  9.04109589,  9.14383562,
         9.24657534,  9.34931507,  9.45205479,  9.55479452,  9.65753425,
         9.76027397,  9.8630137 ,  9.96575342, 10.06849315, 10.17123288,
        10.2739726 , 10.37671233, 10.47945205, 10.58219178, 10.68493151,
        10.78767123, 10.89041096, 10.99315068, 11.09589041, 11.19863014,
        11.30136986, 11.40410959, 11.50684932, 11.60958904, 11.71232877,
        11.81506849, 11.91780822, 12.02054795, 12.12328767, 12.2260274 ,
        12.32876712, 12.43150685, 12.53424658, 12.6369863 , 12.73972603,
        12.84246575, 12.94520548, 13.04794521, 13.15068493, 13.25342466,
        13.35616438, 13.45890411, 13.56164384, 13.66438356, 13.76712329,
        13.86986301, 13.97260274, 14.07534247, 14.17808219, 14.28082192,
        14.38356164, 14.48630137, 14.5890411 , 14.69178082, 14.79452055,
        14.89726027, 15.        , 15.10273973, 15.20547945, 15.30821918,
        15.4109589 , 15.51369863, 15.61643836, 15.71917808, 15.82191781,
        15.92465753, 16.02739726, 16.13013699, 16.23287671, 16.33561644,
        16.43835616, 16.54109589, 16.64383562, 16.74657534, 16.84931507,
        16.95205479, 17.05479452, 17.15753425, 17.26027397, 17.3630137 ,
        17.46575342, 17.56849315, 17.67123288, 17.7739726 , 17.87671233,
        17.97945205, 18.08219178, 18.18493151, 18.28767123, 18.39041096,
        18.49315068, 18.59589041, 18.69863014, 18.80136986, 18.90410959,
        19.00684932, 19.10958904, 19.21232877, 19.31506849, 19.41780822,
        19.52054795, 19.62328767, 19.7260274 , 19.82876712, 19.93150685,
        20.03424658, 20.1369863 , 20.23972603, 20.34246575, 20.44520548,
        20.54794521, 20.65068493, 20.75342466, 20.85616438, 20.95890411,
        21.06164384, 21.16438356, 21.26712329, 21.36986301, 21.47260274,
        21.57534247, 21.67808219, 21.78082192, 21.88356164, 21.98630137,
        22.0890411 , 22.19178082, 22.29452055, 22.39726027, 22.5       ,
        22.60273973, 22.70547945, 22.80821918, 22.9109589 , 23.01369863,
        23.11643836, 23.21917808, 23.32191781, 23.42465753, 23.52739726,
        23.63013699, 23.73287671, 23.83561644, 23.93835616, 24.04109589,
        24.14383562, 24.24657534, 24.34931507, 24.45205479, 24.55479452,
        24.65753425, 24.76027397, 24.8630137 , 24.96575342, 25.06849315,
        25.17123288, 25.2739726 , 25.37671233, 25.47945205, 25.58219178,
        25.68493151, 25.78767123, 25.89041096, 25.99315068, 26.09589041,
        26.19863014, 26.30136986, 26.40410959, 26.50684932, 26.60958904,
        26.71232877, 26.81506849, 26.91780822, 27.02054795, 27.12328767,
        27.2260274 , 27.32876712, 27.43150685, 27.53424658, 27.6369863 ,
        27.73972603, 27.84246575, 27.94520548, 28.04794521, 28.15068493,
        28.25342466, 28.35616438, 28.45890411, 28.56164384, 28.66438356,
        28.76712329, 28.86986301, 28.97260274, 29.07534247, 29.17808219,
        29.28082192, 29.38356164, 29.48630137, 29.5890411 , 29.69178082,
        29.79452055, 29.89726027, 30.        , 30.10273973, 30.20547945,
        30.30821918, 30.4109589 , 30.51369863, 30.61643836, 30.71917808,
        30.82191781, 30.92465753, 31.02739726, 31.13013699, 31.23287671,
        31.33561644, 31.43835616, 31.54109589, 31.64383562, 31.74657534,
        31.84931507, 31.95205479, 32.05479452, 32.15753425, 32.26027397,
        32.3630137 , 32.46575342, 32.56849315, 32.67123288, 32.7739726 ,
        32.87671233, 32.97945205, 33.08219178, 33.18493151, 33.28767123,
        33.39041096, 33.49315068, 33.59589041, 33.69863014, 33.80136986,
        33.90410959, 34.00684932, 34.10958904, 34.21232877, 34.31506849,
        34.41780822, 34.52054795, 34.62328767, 34.7260274 , 34.82876712,
        34.93150685, 35.03424658, 35.1369863 , 35.23972603, 35.34246575,
        35.44520548, 35.54794521, 35.65068493, 35.75342466, 35.85616438,
        35.95890411, 36.06164384, 36.16438356, 36.26712329, 36.36986301,
        36.47260274, 36.57534247, 36.67808219, 36.78082192, 36.88356164,
        36.98630137, 37.0890411 , 37.19178082, 37.29452055, 37.39726027,
        37.5       , 37.60273973, 37.70547945, 37.80821918, 37.9109589 ,
        38.01369863, 38.11643836, 38.21917808, 38.32191781, 38.42465753,
        38.52739726, 38.63013699, 38.73287671, 38.83561644, 38.93835616,
        39.04109589, 39.14383562, 39.24657534, 39.34931507, 39.45205479,
        39.55479452, 39.65753425, 39.76027397, 39.8630137 , 39.96575342,
        40.06849315, 40.17123288, 40.2739726 , 40.37671233, 40.47945205,
        40.58219178, 40.68493151, 40.78767123, 40.89041096, 40.99315068,
        41.09589041, 41.19863014, 41.30136986, 41.40410959, 41.50684932,
        41.60958904, 41.71232877, 41.81506849, 41.91780822, 42.02054795,
        42.12328767, 42.2260274 , 42.32876712, 42.43150685, 42.53424658,
        42.6369863 , 42.73972603, 42.84246575, 42.94520548, 43.04794521,
        43.15068493, 43.25342466, 43.35616438, 43.45890411, 43.56164384,
        43.66438356, 43.76712329, 43.86986301, 43.97260274, 44.07534247,
        44.17808219, 44.28082192, 44.38356164, 44.48630137, 44.5890411 ,
        44.69178082, 44.79452055, 44.89726027, 45.        , 45.10273973,
        45.20547945, 45.30821918, 45.4109589 , 45.51369863, 45.61643836,
        45.71917808, 45.82191781, 45.92465753, 46.02739726, 46.13013699,
        46.23287671, 46.33561644, 46.43835616, 46.54109589, 46.64383562,
        46.74657534, 46.84931507, 46.95205479, 47.05479452, 47.15753425,
        47.26027397, 47.3630137 , 47.46575342, 47.56849315, 47.67123288,
        47.7739726 , 47.87671233, 47.97945205, 48.08219178, 48.18493151,
        48.28767123, 48.39041096, 48.49315068, 48.59589041, 48.69863014,
        48.80136986, 48.90410959, 49.00684932, 49.10958904, 49.21232877,
        49.31506849, 49.41780822, 49.52054795, 49.62328767, 49.7260274 ,
        49.82876712, 49.93150685, 50.03424658, 50.1369863 , 50.23972603,
        50.34246575, 50.44520548, 50.54794521, 50.65068493, 50.75342466,
        50.85616438, 50.95890411, 51.06164384, 51.16438356, 51.26712329,
        51.36986301, 51.47260274, 51.57534247, 51.67808219, 51.78082192,
        51.88356164, 51.98630137, 52.0890411 , 52.19178082, 52.29452055,
        52.39726027, 52.5       ]),
 'median': array([403.06621204, 403.06621204, 403.06621204, 416.35545679,
        410.88054358, 410.88054358, 416.85383017, 416.85383017,
        416.85383017, 411.50405055, 409.72594672, 409.72594672,
        409.72594672, 409.72594672, 409.72594672, 409.72594672,
        409.72594672, 410.23846433, 410.23846433, 410.23846433,
        410.23846433, 413.04975657, 413.04975657, 419.82681207,
        428.80910939, 428.80910939, 428.80910939, 431.6781363 ,
        431.6781363 , 431.6781363 , 431.6781363 , 442.67520471,
        457.6186067 , 457.6186067 , 465.36951887, 459.21201227,
        458.63288194, 465.59716694, 472.18611431, 472.18611431,
        472.18611431, 475.66156228, 475.66156228, 475.66156228,
        475.66156228, 475.66156228, 475.66156228, 485.05415427,
        485.05415427, 485.05415427, 477.95410504, 477.95410504,
        477.95410504, 477.95410504, 477.95410504, 477.95410504,
        469.6633983 , 469.6633983 , 469.6633983 , 469.6633983 ,
        469.6633983 , 469.6633983 , 469.6633983 , 469.6633983 ,
        469.6633983 , 469.6633983 , 465.21973725, 465.21973725,
        465.21973725, 465.21973725, 465.21973725, 454.78589748,
        454.78589748, 460.94418748, 460.94418748, 461.68038486,
        478.16008592, 478.16008592, 487.04152255, 487.04152255,
        487.04152255, 487.04152255, 487.04152255, 487.04152255,
        487.04152255, 487.04152255, 485.74926635, 485.74926635,
        475.76475324, 475.76475324, 475.76475324, 475.76475324,
        475.76475324, 488.27469989, 488.27469989, 488.27469989,
        490.81461113, 490.81461113, 487.36090013, 482.39842896,
        482.39842896, 483.67627334, 483.67627334, 483.67627334,
        497.2998405 , 497.2998405 , 497.2998405 , 497.2998405 ,
        497.2998405 , 497.2998405 , 497.2998405 , 497.2998405 ,
        497.2998405 , 497.2998405 , 497.2998405 , 497.2998405 ,
        497.2998405 , 490.31474081, 490.31474081, 490.31474081,
        490.31474081, 492.03000092, 492.03000092, 492.03000092,
        492.03000092, 492.03000092, 492.03000092, 492.03000092,
        497.63014696, 497.63014696, 497.63014696, 497.84631878,
        497.84631878, 497.84631878, 497.84631878, 496.11222819,
        496.11222819, 496.11222819, 502.49763223, 502.49763223,
        508.84703143, 508.84703143, 508.84703143, 508.84703143,
        508.84703143, 508.84703143, 508.84703143, 508.84703143,
        509.13143317, 509.13143317, 509.13143317, 509.13143317,
        518.78870016, 518.78870016, 518.78870016, 518.78870016,
        518.78870016, 518.78870016, 518.78870016, 518.78870016,
        518.78870016, 518.78870016, 518.78870016, 518.78870016,
        522.89262135, 522.89262135, 522.89262135, 533.25534794,
        533.25534794, 533.25534794, 533.25534794, 533.25534794,
        529.2710443 , 529.2710443 , 529.2710443 , 529.2710443 ,
        529.2710443 , 529.2710443 , 529.2710443 , 520.53399165,
        520.53399165, 520.53399165, 520.53399165, 520.53399165,
        508.90538236, 508.90538236, 508.90538236, 519.53556176,
        501.17078751, 501.17078751, 497.66900945, 497.66900945,
        513.09064987, 513.09064987, 513.09064987, 513.09064987,
        516.12432699, 516.12432699, 516.12432699, 516.12432699,
        505.59900745, 505.59900745, 520.40959984, 520.40959984,
        520.40959984, 517.56708941, 517.56708941, 517.56708941,
        517.56708941, 519.65539325, 521.26691031, 521.26691031,
        533.85904928, 533.85904928, 533.85904928, 533.85904928,
        533.85904928, 533.85904928, 533.85904928, 533.85904928,
        533.85904928, 533.85904928, 533.85904928, 533.85904928,
        532.13604557, 532.13604557, 523.96547529, 523.96547529,
        523.96547529, 523.96547529, 523.96547529, 523.96547529,
        535.03061436, 535.03061436, 535.03061436, 535.03061436,
        553.10267016, 553.10267016, 546.24972276, 546.24972276,
        546.24972276, 546.24972276, 546.24972276, 546.24972276,
        546.24972276, 551.80964642, 551.80964642, 551.80964642,
        521.55881513, 511.73129501, 511.73129501, 511.73129501,
        511.73129501, 511.73129501, 511.73129501, 511.73129501,
        511.73129501, 511.6524382 , 511.6524382 , 511.6524382 ,
        517.19065528, 517.19065528, 517.19065528, 517.19065528,
        517.19065528, 517.19065528, 517.19065528, 517.19065528,
        515.95153569, 515.95153569, 515.95153569, 515.95153569,
        515.95153569, 515.95153569, 516.33272812, 516.33272812,
        516.33272812, 526.8645225 , 524.54866257, 524.54866257,
        524.54866257, 524.54866257, 524.54866257, 524.54866257,
        524.54866257, 524.54866257, 524.54866257, 524.54866257,
        524.54866257, 524.54866257, 524.54866257, 524.54866257,
        524.54866257, 524.54866257, 524.54866257, 534.78993164,
        534.78993164, 534.78993164, 534.78993164, 534.78993164,
        534.78993164, 534.29099647, 534.29099647, 534.29099647,
        534.29099647, 522.24339343, 522.24339343, 522.24339343,
        522.24339343, 522.24339343, 522.24339343, 522.24339343,
        522.24339343, 523.00967227, 523.00967227, 523.00967227,
        523.00967227, 523.00967227, 522.99517495, 522.99517495,
        522.99517495, 515.12444043, 515.12444043, 515.12444043,
        515.13182209, 515.13182209, 515.13182209, 515.13182209,
        502.15441529, 502.15441529, 490.63181688, 490.63181688,
        490.63181688, 490.63181688, 490.63181688, 496.78402879,
        493.63415987, 493.63415987, 505.23117501, 505.23117501,
        521.52989405, 521.52989405, 521.52989405, 517.81485707,
        517.81485707, 517.81485707, 517.81485707, 517.81485707,
        517.81485707, 517.81485707, 517.81485707, 517.81485707,
        517.81485707, 517.81485707, 517.81485707, 517.81485707,
        517.81485707, 517.81485707, 523.54931421, 523.54931421,
        523.54931421, 523.54931421, 526.30598456, 526.30598456,
        526.30598456, 526.30598456, 526.30598456, 526.30598456,
        528.43403681, 528.43403681, 528.43403681, 528.43403681,
        524.26727284, 524.26727284, 524.26727284, 524.26727284,
        524.26727284, 524.26727284, 524.26727284, 524.26727284,
        524.26727284, 524.26727284, 524.26727284, 524.26727284,
        524.26727284, 524.26727284, 524.26727284, 524.26727284,
        557.51132782, 557.51132782, 557.51132782, 557.51132782,
        557.51132782, 565.0860946 , 565.0860946 , 565.0860946 ,
        565.0860946 , 565.0860946 , 565.0860946 , 565.0860946 ,
        565.0860946 , 565.0860946 , 565.0860946 , 565.0860946 ,
        583.41856289, 583.41856289, 583.41856289, 583.41856289,
        586.89310969, 586.89310969, 586.89310969, 586.89310969,
        586.89310969, 586.89310969, 586.89310969, 586.89310969,
        586.89310969, 586.89310969, 595.58017319, 601.26693538,
        601.26693538, 601.26693538, 601.26693538, 601.26693538,
        601.26693538, 601.26693538, 601.26693538, 601.26693538,
        601.26693538, 601.26693538, 602.67717328, 602.67717328,
        602.67717328, 602.67717328, 602.67717328, 602.67717328,
        602.67717328, 612.90554535, 612.90554535, 612.90554535,
        612.90554535, 612.90554535, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 619.39370255, 619.39370255,
        619.39370255, 619.39370255, 631.81159527, 631.81159527,
        631.81159527, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192,
        625.59994192, 625.59994192, 625.59994192, 625.59994192]),
 'ln_std': array([0.22613878, 0.22613878, 0.22613878, 0.27253292, 0.2694036 ,
        0.2694036 , 0.28565727, 0.28565727, 0.28565727, 0.29970327,
        0.29355096, 0.29355096, 0.29355096, 0.29355096, 0.29355096,
        0.29355096, 0.29355096, 0.29377282, 0.29377282, 0.29377282,
        0.29377282, 0.29211519, 0.29211519, 0.27899046, 0.28283188,
        0.28283188, 0.28283188, 0.27804683, 0.27804683, 0.27804683,
        0.27804683, 0.2769916 , 0.24869855, 0.24869855, 0.23548497,
        0.23293819, 0.23290909, 0.25361809, 0.26088376, 0.26088376,
        0.26088376, 0.25640649, 0.25640649, 0.25640649, 0.25640649,
        0.25640649, 0.25640649, 0.28122806, 0.28122806, 0.28122806,
        0.29166343, 0.29166343, 0.29166343, 0.29166343, 0.29166343,
        0.29166343, 0.32075247, 0.32075247, 0.32075247, 0.32075247,
        0.32075247, 0.32075247, 0.32075247, 0.32075247, 0.32075247,
        0.32075247, 0.34269226, 0.34269226, 0.34269226, 0.34269226,
        0.34269226, 0.3248342 , 0.3248342 , 0.33403628, 0.33403628,
        0.33385762, 0.32295615, 0.32295615, 0.33261297, 0.33261297,
        0.33261297, 0.33261297, 0.33261297, 0.33261297, 0.33261297,
        0.33261297, 0.33393496, 0.33393496, 0.32743823, 0.32743823,
        0.32743823, 0.32743823, 0.32743823, 0.27280557, 0.27280557,
        0.27280557, 0.26806033, 0.26806033, 0.27199616, 0.26251091,
        0.26251091, 0.25915869, 0.25915869, 0.25915869, 0.23493553,
        0.23493553, 0.23493553, 0.23493553, 0.23493553, 0.23493553,
        0.23493553, 0.23493553, 0.23493553, 0.23493553, 0.23493553,
        0.23493553, 0.23493553, 0.22806202, 0.22806202, 0.22806202,
        0.22806202, 0.23610377, 0.23610377, 0.23610377, 0.23610377,
        0.23610377, 0.23610377, 0.23610377, 0.24184091, 0.24184091,
        0.24184091, 0.24205815, 0.24205815, 0.24205815, 0.24205815,
        0.24529565, 0.24529565, 0.24529565, 0.24983346, 0.24983346,
        0.25474975, 0.25474975, 0.25474975, 0.25474975, 0.25474975,
        0.25474975, 0.25474975, 0.25474975, 0.2541889 , 0.2541889 ,
        0.2541889 , 0.2541889 , 0.25905824, 0.25905824, 0.25905824,
        0.25905824, 0.25905824, 0.25905824, 0.25905824, 0.25905824,
        0.25905824, 0.25905824, 0.25905824, 0.25905824, 0.25599307,
        0.25599307, 0.25599307, 0.25896438, 0.25896438, 0.25896438,
        0.25896438, 0.25896438, 0.25639539, 0.25639539, 0.25639539,
        0.25639539, 0.25639539, 0.25639539, 0.25639539, 0.26879301,
        0.26879301, 0.26879301, 0.26879301, 0.26879301, 0.26813909,
        0.26813909, 0.26813909, 0.26733073, 0.24317489, 0.24317489,
        0.23832106, 0.23832106, 0.25218937, 0.25218937, 0.25218937,
        0.25218937, 0.25956114, 0.25956114, 0.25956114, 0.25956114,
        0.26984374, 0.26984374, 0.31774302, 0.31774302, 0.31774302,
        0.3052654 , 0.3052654 , 0.3052654 , 0.3052654 , 0.30115189,
        0.30295364, 0.30295364, 0.30710964, 0.30710964, 0.30710964,
        0.30710964, 0.30710964, 0.30710964, 0.30710964, 0.30710964,
        0.30710964, 0.30710964, 0.30710964, 0.30710964, 0.30591747,
        0.30591747, 0.29571096, 0.29571096, 0.29571096, 0.29571096,
        0.29571096, 0.29571096, 0.28664962, 0.28664962, 0.28664962,
        0.28664962, 0.32688633, 0.32688633, 0.33238799, 0.33238799,
        0.33238799, 0.33238799, 0.33238799, 0.33238799, 0.33238799,
        0.32545466, 0.32545466, 0.32545466, 0.34291497, 0.34158621,
        0.34158621, 0.34158621, 0.34158621, 0.34158621, 0.34158621,
        0.34158621, 0.34158621, 0.3416576 , 0.3416576 , 0.3416576 ,
        0.33810388, 0.33810388, 0.33810388, 0.33810388, 0.33810388,
        0.33810388, 0.33810388, 0.33810388, 0.34036305, 0.34036305,
        0.34036305, 0.34036305, 0.34036305, 0.34036305, 0.34054237,
        0.34054237, 0.34054237, 0.3266363 , 0.32870829, 0.32870829,
        0.32870829, 0.32870829, 0.32870829, 0.32870829, 0.32870829,
        0.32870829, 0.32870829, 0.32870829, 0.32870829, 0.32870829,
        0.32870829, 0.32870829, 0.32870829, 0.32870829, 0.32870829,
        0.33484898, 0.33484898, 0.33484898, 0.33484898, 0.33484898,
        0.33484898, 0.33571783, 0.33571783, 0.33571783, 0.33571783,
        0.30666447, 0.30666447, 0.30666447, 0.30666447, 0.30666447,
        0.30666447, 0.30666447, 0.30666447, 0.30794201, 0.30794201,
        0.30794201, 0.30794201, 0.30794201, 0.30791401, 0.30791401,
        0.30791401, 0.31174234, 0.31174234, 0.31174234, 0.31173417,
        0.31173417, 0.31173417, 0.31173417, 0.30481817, 0.30481817,
        0.30561758, 0.30561758, 0.30561758, 0.30561758, 0.30561758,
        0.32519988, 0.32342207, 0.32342207, 0.3479946 , 0.3479946 ,
        0.3618187 , 0.3618187 , 0.3618187 , 0.34612444, 0.34612444,
        0.34612444, 0.34612444, 0.34612444, 0.34612444, 0.34612444,
        0.34612444, 0.34612444, 0.34612444, 0.34612444, 0.34612444,
        0.34612444, 0.34612444, 0.34612444, 0.34033787, 0.34033787,
        0.34033787, 0.34033787, 0.34061993, 0.34061993, 0.34061993,
        0.34061993, 0.34061993, 0.34061993, 0.34734539, 0.34734539,
        0.34734539, 0.34734539, 0.35097755, 0.35097755, 0.35097755,
        0.35097755, 0.35097755, 0.35097755, 0.35097755, 0.35097755,
        0.35097755, 0.35097755, 0.35097755, 0.35097755, 0.35097755,
        0.35097755, 0.35097755, 0.35097755, 0.41697414, 0.41697414,
        0.41697414, 0.41697414, 0.41697414, 0.41147855, 0.41147855,
        0.41147855, 0.41147855, 0.41147855, 0.41147855, 0.41147855,
        0.41147855, 0.41147855, 0.41147855, 0.41147855, 0.40398205,
        0.40398205, 0.40398205, 0.40398205, 0.39876694, 0.39876694,
        0.39876694, 0.39876694, 0.39876694, 0.39876694, 0.39876694,
        0.39876694, 0.39876694, 0.39876694, 0.39225889, 0.38489179,
        0.38489179, 0.38489179, 0.38489179, 0.38489179, 0.38489179,
        0.38489179, 0.38489179, 0.38489179, 0.38489179, 0.38489179,
        0.38463165, 0.38463165, 0.38463165, 0.38463165, 0.38463165,
        0.38463165, 0.38463165, 0.37710024, 0.37710024, 0.37710024,
        0.37710024, 0.37710024, 0.39251741, 0.39251741, 0.39251741,
        0.39251741, 0.39251741, 0.39251741, 0.39251741, 0.39251741,
        0.39251741, 0.39251741, 0.39251741, 0.39251741, 0.39251741,
        0.39251741, 0.39251741, 0.39251741, 0.39251741, 0.39251741,
        0.39251741, 0.39251741, 0.39251741, 0.39251741, 0.39251741,
        0.39251741, 0.39251741, 0.39251741, 0.39251741, 0.39251741,
        0.40746122, 0.40746122, 0.40746122, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649, 0.40330649, 0.40330649, 0.40330649,
        0.40330649, 0.40330649])}
[12]:
outputs[-1].calc_stats(as_dataframe=True)
[12]:
median ln_std
depth
0.000000 403.066212 0.226139
0.102740 403.066212 0.226139
0.205479 403.066212 0.226139
0.308219 416.355457 0.272533
0.410959 410.880544 0.269404
... ... ...
52.089041 625.599942 0.403306
52.191781 625.599942 0.403306
52.294521 625.599942 0.403306
52.397260 625.599942 0.403306
52.500000 625.599942 0.403306

512 rows × 2 columns

Repeat using a Generic Depth-Dependent Model

The generic DepthDependToroVelVariation follows the SPID guidance.

[13]:
var_velocity_dd = pystrata.variation.DepthDependToroVelVariation.generic_model("USGS C")
[14]:
outputs.reset()
count = 20
for p in pystrata.variation.iter_varied_profiles(
    profile,
    count,
    var_thickness=var_thickness,
    var_velocity=var_velocity_dd,
    var_soiltypes=var_soiltypes,
):
    p = p.auto_discretize()
    calc(m, p, p.location("outcrop", index=-1))
    outputs(calc)
[15]:
for o in outputs[:-1]:
    ax = o.plot(style="stats")
../_images/examples_example-08_25_0.png
../_images/examples_example-08_25_1.png
[16]:
ax = outputs[-1].plot(style="stats")
../_images/examples_example-08_26_0.png
[17]:
outputs[-1].calc_stats(as_dataframe=True)
[17]:
median ln_std
depth
0.000000 394.156620 0.285456
0.102740 391.023207 0.296315
0.205479 391.023207 0.296315
0.308219 396.472273 0.292163
0.410959 394.306993 0.288373
... ... ...
52.089041 562.994642 0.168696
52.191781 562.994642 0.168696
52.294521 562.994642 0.168696
52.397260 562.994642 0.168696
52.500000 562.994642 0.168696

512 rows × 2 columns

Repeat using a Specific Depth-Dependent Model

[18]:
var_velocity_dd = pystrata.variation.DepthDependToroVelVariation.generic_model(
    "USGS C", depth=[0, 10, 20], ln_std=[0.25, 0.15, 0.10]
)
[19]:
outputs.reset()
count = 20
for p in pystrata.variation.iter_varied_profiles(
    profile,
    count,
    var_thickness=var_thickness,
    var_velocity=var_velocity_dd,
    var_soiltypes=var_soiltypes,
):
    p = p.auto_discretize()
    calc(m, p, p.location("outcrop", index=-1))
    outputs(calc)
[20]:
for o in outputs[:-1]:
    ax = o.plot(style="stats")
../_images/examples_example-08_31_0.png
../_images/examples_example-08_31_1.png
[21]:
ax = outputs[-1].plot(style="stats")
../_images/examples_example-08_32_0.png
[22]:
outputs[-1].calc_stats(as_dataframe=True)
[22]:
median ln_std
depth
0.000000 452.515186 0.190721
0.102740 452.693883 0.190234
0.205479 452.693883 0.190234
0.308219 452.693883 0.190234
0.410959 456.275551 0.195627
... ... ...
52.089041 634.244060 0.088420
52.191781 634.244060 0.088420
52.294521 634.244060 0.088420
52.397260 634.244060 0.088420
52.500000 634.244060 0.088420

512 rows × 2 columns