Beispiel #1
0
    Sea09YCr = []
    Pea11r = []
    A12r = []
    AA13r = []
    Bea14r = []
    YA15r = []
    G90WAr = []
    G90SEAr = []
    G90WArPGV = []
    G90SEArPGV = []

    for i, r in enumerate(rrup):

        # get ground motion estimates from GMPEs
        Tea02imt, C03imt, AB06imt, Sea09imt, Sea09YCimt, Pea11imt, A12imt, Bea14imt , YA15imt, SP16imt \
            = scr_gsims(mag, dep, ztor, dip, rake, rrup[i], rjb[i], vs30)
        # get one of the NGA-W2 GMMs
        # get ground motion estimates from GMPEs
        G90WAimt, G90SEAimt, G90INDimt, G90WA_PGVimt, G90SEA_PGVimt, G90IND_PGVimt = gaull1990_gsim(
            mag, dep, rrup[i])
        if t == 0.0:
            #Tea02r.append(Tea02imt['pga'][0])
            Tea02r.append(Tea02imt['sa'][0])
            #C03r.append(C03imt['pga'][0])
            C03r.append(C03imt['sa'][0])
            AB06r.append(AB06imt['pga'][0])
            Sea09r.append(Sea09imt['pga'][0])
            Sea09YCr.append(Sea09YCimt['pga'][0])
            Pea11r.append(nan)
            A12r.append(A12imt['sa'][0])
            Bea14r.append(Bea14imt['pga'][0])
        ab03 = []
        gea05 = []
        mp10 = []
        a15 = []
        ab06 = []
        bea14 = []
        sea09 = []
        a12 = []
        a17 = []
        for rr in rrup:
            rjb = sqrt(rr**2 - 50**2)
            YYea97imt, AB03imt, AB03CISimt, Gea05imt, Zea06imt, Zea06CISimt, MP10imt, Aea15imt \
                = inslab_gsims(mplt, dep, 40, 30., 90., rr, rjb, 760)

            Tea02imt, C03imt, AB06imt, Sea09imt, Sea09YCimt, Pea11imt, A12imt, Bea14imt, YA15imt, SP16imt \
                = scr_gsims(mplt, dep, 40, 30., 90., rr, rjb, 760)

            # subduction gmms
            ab03.append(interp(Tplt, AB03imt['per'], AB03imt['sa']))
            gea05.append(interp(Tplt, Gea05imt['per'], Gea05imt['sa']))
            mp10.append(interp(Tplt, MP10imt['per'], MP10imt['sa']))
            a15.append(interp(Tplt, Aea15imt['per'], Aea15imt['sa']))

            # scr gmms
            ab06.append(interp(Tplt, AB06imt['per'], AB06imt['sa']))
            sea09.append(interp(Tplt, Sea09imt['per'], Sea09imt['sa']))
            a12.append(interp(Tplt, A12imt['per'], A12imt['sa']))

            # plt nga-w2
            bea14.append(interp(Tplt, Bea14imt['per'], Bea14imt['sa']))
Beispiel #3
0
# parse chimney file
csvfile = 'Chimney_RJB_GMPE.csv'
data = loadtxt(csvfile, skiprows=1, delimiter=',')
rjbs = data[:,1]
n_chim = data[:,0]

txt = '#CHIMNEY,RJB,Gea90SEA,Gea90WA,AB06,Sea09NC,Sea09YC,A12,Bea14,Tea19,NGA-E\n'

for chim, rjb in zip(n_chim, rjbs):
    print(chim)
    rrup = sqrt(rjb**2 + ztor**2)
    rhyp = rrup = sqrt(rjb**2 + dep**2) # assume for now as need site locations

    Tea02imt, C03imt, AB06imt, AB11imt, Sea09imt_SS14, Sea09YCimt_SS14, Pea11imt, A12imt, A12imt_SS14, Bea14imt \
             = scr_gsims(mag, dep, ztor, dip, rake, rrup, rjb, vs30)
    
    Tea19 = tang2019_cam_gsim(mag, dep, rrup, vs30)
    
    G90WAimt, G90SEAimt, G90INDimt, G90WA_PGVimt, G90SEA_PGVimt, G90IND_PGVimt = gaull1990_gsim(mag, dep, rhyp)
    
    # adjust some GMMs using Seyhan & Stewart 2014
    #A12imt = adjust_gmm_with_SS14(A12imt, 820., vs30) - corrected in gsim code
    #Sea09imt = adjust_gmm_with_SS14(Sea09imt, 865., vs30)
    
    '''
    # get mean USGS NGA-E
    nga_e_imt = nga_east_mean(mag, dep, dip, rake, rrup, vs30)
    #plt.loglog(nga_e_imt['per'], exp(nga_e_imt['sa']),'--' , lw=1.5, color=cs[5]) # for testing amp factors
    nga_e_imt_hold = nga_e_imt
    
def makesubplt(i, fig, plt, sta, sps, mag, dep, ztor, dip, rake, rhyp, vs30):
    import matplotlib
    matplotlib.rc('xtick', labelsize=8)
    matplotlib.rc('ytick', labelsize=8)

    rrup = rhyp
    rjb = sqrt(rrup**2 - dep**2)  # assume point source; i.e. repi = rjb

    # get ground motion estimates from GMPEs
    Yea97imt, AB03imt, AB03CISimt, Gea05imt, Zea06imt, Zea06CISimt, MP10imt, Aea15imt, Zea16imt \
             = inslab_gsims(mag, dep, ztor, dip, rake, rhyp, rjb, vs30)

    Tea02imt, C03imt, AB06imt, Sea09imt, Sea09YCimt, Pea11imt, A12imt, Bea14imt \
             = scr_gsims(mag, dep, ztor, dip, rake, rrup, rjb, vs30)

    A19imt = calc_nac_gmm_spectra(mag, rhyp, dep)  # use rrup
    #print(exp(A19imt['sa']))

    ax = plt.subplot(3, 3, i)
    if colTrue == 'True':
        '''
        plt.loglog(Yea97imt['per'], exp(Yea97imt['sa']), '.-' , lw=1., color=cs[0])
        plt.loglog(AB03imt['per'], exp(AB03imt['sa']),     '--', lw=1.,  color=cs[1])
        plt.loglog(Gea05imt['per'], exp(Gea05imt['sa']),   '-.', lw=1.,  color=cs[2])
        plt.loglog(Zea06imt['per'], exp(Zea06imt['sa']), '-' , lw=1.,  color=cs[3])
        plt.loglog(MP10imt['per'], exp(MP10imt['sa']), '-' , lw=2.5, color=cs[4])
        plt.loglog(Aea15imt['per'], exp(Aea15imt['sa']),     '-.', lw=2.5, color=cs[5])
        plt.loglog(Bea14imt['per'], exp(Bea14imt['sa']), '--', lw=2.5, color=cs[6])
        plt.loglog(YA15imt['per'], exp(YA15imt['sa']),   ':' , lw=2.5, color=cs[7])
        '''
        plt.loglog(Yea97imt['per'][:-1],
                   exp(Yea97imt['sa'][:-1]),
                   '-',
                   lw=1.5,
                   color=cs[0])
        plt.loglog(AB03imt['per'][:-1],
                   exp(AB03imt['sa'][:-1]),
                   '-',
                   lw=1.5,
                   color=cs[1])
        plt.loglog(A12imt['per'], exp(A12imt['sa']), '-', lw=1.5, color=cs[2])
        plt.loglog(Zea06imt['per'],
                   exp(Zea06imt['sa']),
                   '-',
                   lw=1.5,
                   color=cs[3])
        plt.loglog(AB06imt['per'],
                   exp(AB06imt['sa']),
                   '-',
                   lw=1.5,
                   color=cs[4])
        plt.loglog(Aea15imt['per'],
                   exp(Aea15imt['sa']),
                   '-',
                   lw=1.5,
                   color=cs[5])
        plt.loglog(A19imt['per'], exp(A19imt['sa']), '-', lw=1.5, color=cs[6])
    else:
        plt.loglog(Yea97imt['per'],
                   exp(Yea97imt['sa']),
                   '-',
                   lw=1.5,
                   color='0.35')
        plt.loglog(AB03imt['per'],
                   exp(AB03imt['sa']),
                   '--',
                   lw=1.5,
                   color='0.15')
        plt.loglog(Gea05imt['per'],
                   exp(Gea05imt['sa']),
                   '-.',
                   lw=1.5,
                   color='0.15')
        plt.loglog(CY08imt['per'],
                   exp(CY08imt['sa']),
                   '-',
                   lw=1.5,
                   color='0.65')
        plt.loglog(Zea06imt['per'],
                   exp(Zea06imt['sa']),
                   '--',
                   lw=1.5,
                   color='0.65')
        plt.loglog(MP10imt['per'],
                   exp(MP10imt['sa']),
                   '-.',
                   lw=1.5,
                   color='0.65')
        plt.loglog(Aea15imt['per'],
                   exp(Aea15imt['sa']),
                   '--',
                   lw=1.5,
                   color='0.35')

    # get recorded process_waves.py psa data
    T, geomean, pga, rhyp = get_site_geomean(sta, folder)
    plt.loglog(T, geomean, lw=1.5, color='k')

    if i >= 7:
        plt.xlabel('Period (s)', fontsize=9)
    if i == 1 or i == 4 or i == 7:
        plt.ylabel('Spectral Acceleration (g)', fontsize=9)

    plt.xlim([0.02, 10])
    #plt.title(' '.join((sta+'; MW =',str("%0.1f" % mag)+'; Rrup =',str(rrup),'km')), fontsize=9)
    plt.title(' '.join((sta + '; Rhyp =', str(rhyp), 'km')), fontsize=9)
    plt.grid(which='both', color='0.75')

    if i == 1:
        plt.legend([
            'Yea97', 'AB03', 'A12imt', 'Zea06', 'AB06', 'Aea15', 'A19', 'Data'
        ],
                   loc=3,
                   fontsize=7.)
        '''
def makesubplt(i, fig, plt, sta, sps, mag, dep, ztor, dip, rake, rhyp, vs30):
    import matplotlib 
    matplotlib.rc('xtick', labelsize=8) 
    matplotlib.rc('ytick', labelsize=8) 
    
    rrup = rhyp # subtract for misc distance to rup
    rjb = sqrt(rrup**2 - dep**2) # assume point source; i.e. repi = rjb
    
    # get ground motion estimates from GMPEs
    print(mag, dep, ztor, dip, rake, rrup, rjb, vs30)
    Tea02imt, C03imt, AB06imt, Sea09imt, Sea09YCimt, Pea11imt, A12imt, Bea14imt \
             = scr_gsims(mag, dep, ztor, dip, rake, rrup, rjb, vs30)
    
    Tea19 = tang2019_cam_gsim(mag, dep, rrup, vs30)
    
    # adjust some GMMs using Seyhan & Stewart 2014
    A12imt = adjust_gmm_with_SS14(A12imt, 820., vs30)
    Sea09imt = adjust_gmm_with_SS14(Sea09imt, 865., vs30)
    
    # get mean USGS NGA-E
    nga_e_imt = nga_east_mean(mag, dep, dip, rake, rrup, vs30)
    #plt.loglog(nga_e_imt['per'], exp(nga_e_imt['sa']),'--' , lw=1.5, color=cs[5]) # for testing amp factors
    nga_e_imt_hold = nga_e_imt
    
    # adjust NGA-E from 3000 -> target
    nga_e_imt = adjust_gmm_with_nga_east(nga_e_imt, vs30)
    
    #print(nga_e_imt['per'])
    #print(exp(nga_e_imt['sa']) / exp(nga_e_imt_hold['sa']))
    
    ax = plt.subplot(3, 3, i)
    syms = ['s', 'x', '+', '1', '2', 'o']
    if colTrue == 'True':
        plt.loglog(AB06imt['per'], exp(AB06imt['sa']), syms[0], ls='-', lw=1., color=cs[0], \
                   ms=4, mec=cs[0], mfc='none',  mew=1., markevery=5)
        plt.loglog(Sea09imt['per'], exp(Sea09imt['sa']), syms[1], ls='-', lw=1., color=cs[1], \
                   ms=5, mec=cs[1], mfc='none',  mew=1., markevery=5)
        plt.loglog(A12imt['per'], exp(A12imt['sa']),syms[2], ls='-', lw=1., color=cs[2], \
                   ms=5, mec=cs[2], mfc='none',  mew=1., markevery=4)
        plt.loglog(Bea14imt['per'], exp(Bea14imt['sa']),syms[3], ls='-', lw=1., color=cs[3], \
                   ms=6, mec=cs[3], mfc='none',  mew=1., markevery=10)
        #plt.loglog(YA15imt['per'], exp(YA15imt['sa']),'-' , lw=1., color=cs[4])
        plt.loglog(nga_e_imt['per'], exp(nga_e_imt['sa']),syms[4], ls='-', lw=1., color=cs[5], \
                   ms=6, mec=cs[5], mfc='none',  mew=1., markevery=5)
        plt.loglog(Tea19['per'], exp(Tea19['sa']),syms[5], ls='-', lw=1., color=cs[6], \
                   ms=4, mec=cs[6], mfc='none',  mew=1., markevery=5)
        
        
    # get recorded process_waves.py psa data
    T, geomean, pga, rhyp, zcomp = get_site_geomean(sta, folder)
    plt.loglog(T, geomean, lw=1.5, color='k')

    if i >= 7:
        plt.xlabel('Period (s)', fontsize=9)
    if i == 1 or i == 4 or i == 7:
        plt.ylabel('Spectral Acceleration (g)', fontsize=9)
    
    plt.xlim([0.01, 10])
    #plt.title(' '.join((sta+'; MW =',str("%0.1f" % mag)+'; Rrup =',str(rrup),'km')), fontsize=9)
    if zcomp == True:
        sta += '*'
    plt.title(' '.join((sta+'; Rhyp =',str(rhyp),'km; VS30 =', str(int(round(vs30))))), fontsize=8)
    plt.grid(which='both', color='0.75')
    
    if i == 1:
        #plt.legend(['Yea97', 'AB06','A12imt','Aea16', 'A19 (BS)', 'A19 (NGH)', 'A19 (OB)','Data'],loc=3, fontsize=7.)
        plt.legend(['AB06','Sea09', 'A12','Bea14', 'NGA-E', 'Tea20', 'Data'],loc=3, fontsize=9., numpoints=1)
        
    return ax