Example #1
0
def test_inputLengthCheck():
    M = [5.5, 6, 5]
    Rrup = [4, 5, 6]
    Rhyp = [5, 6, 7]
    eventType = [0, 1]
    Z = [10, 20, 30]
    Faba = [0, 0, 1]
    Vs30 = [700, 200]
    periods = [1, 2, 3, 4]
    bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
Example #2
0
def test_inputLengthCheck():
    M = [5.5, 6, 5]
    Rrup = [4, 5, 6]
    Rhyp = [5, 6, 7]
    eventType = [0, 1]
    Z = [10, 20, 30]
    Faba = [0, 0, 1]
    Vs30 = [700, 200]
    periods = [1, 2, 3, 4]
    bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
Example #3
0
def test_periodCheck():
    M = [5.5, 6, 5]
    Rrup = [4, 5, 6]
    Rhyp = [5, 6, 7]
    eventType = [0, 1, 1]
    Z = [1, 2, 3]
    Faba = [0, 0, 1]
    Vs30 = [1000, 1500, 300]
    periods = []
    bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
Example #4
0
def test_periodCheck():
    M = [5.5, 6, 5]
    Rrup = [4, 5, 6]
    Rhyp = [5, 6, 7]
    eventType = [0, 1, 1]
    Z = [1, 2, 3]
    Faba = [0, 0, 1]
    Vs30 = [1000, 1500, 300]
    periods = []
    bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
Example #5
0
def differentMags():
    M = [5, 6, 7, 8]
    Rrup = [10, 10, 10, 10]
    Rhyp = [10, 10, 10, 10]
    eventType = [0, 0, 0, 0]
    Z = [5, 5, 5, 5]
    Faba = [1, 1, 1, 1]
    Vs30 = [760, 760, 760, 760]
    periods = [0.01, 0.02, 0.05, 0.075, 0.1, 0.15, 0.2, 0.250, 0.3, 0.4, 0.5, 0.6, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.5, 10.0]
    spectra = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
    plt.loglog(periods, spectra[0] , 'r', periods, spectra[1] , '--r', periods, spectra[2] , 'g', periods, spectra[3] , '--g')
    plt.ylabel('Sa')
    plt.show()
Example #6
0
def check_tauValues(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba,
                                        Vs30, periods)
    tauValues = [[tauValue == 0.43 for tauValue in row] for row in tau]
    assert all(tauValues)
Example #7
0
def check_phiValues(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba,
                                        Vs30, periods)
    phiValues = [[phiValue == 0.6 for phiValue in row] for row in phi]
    assert all(phiValues)
Example #8
0
def check_tauLength(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba,
                                        Vs30, periods)
    assert len(tau) == len(M)
    assert len(tau[0]) == len(periods)
Example #9
0
def check_tauValues(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
    tauValues = [[tauValue == 0.43 for tauValue in row] for row in tau]
    assert all(tauValues)
Example #10
0
def check_phiValues(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
    phiValues = [[phiValue == 0.6 for phiValue in row] for row in phi]
    assert all(phiValues)
Example #11
0
def check_tauLength(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods):
    spectra, phi, tau = bchydro.spectra(M, Rrup, Rhyp, eventType, Z, Faba, Vs30, periods)
    assert len(tau) == len(M)
    assert len(tau[0]) == len(periods)