Esempio n. 1
0
    ####################################################

    ## Figure Properties #######
    width = 12
    height = 9
    legsize = width + 3
    ###########################
    ## Prep Data
    arg = Args()
    arg.addQuery("status", "eq", "processed-ok")
    # Load station params
    d = Params(stnfile, ["hk::H","hk::R"], arg)

    arg = Args()
    m = Params(moonfile, ["H","Vp"])
    m.filter(arg.addQuery("geoprov", "not in", "oceanic"))
    m.filter(arg.addQuery("geoprov", "not in", "Shelf"))

    #######################################################################
    # F0
    # CANADA
    if plotnum[0]:
    ## Kanamori Poisson Histogram
        # Set figure
        fig = plt.figure( figsize = (width, height) )
        ax = plt.subplot(111)
        # Get data
        dk, avgdk, bins, ptype = getdata("kan", d, m, vdict, "Canada")
        ptype.settitle("Canada Total")

        n, bins, patches = plt.hist(dk, bins = bins, facecolor='green', alpha=0.75, label = ptype.histlabel)
Esempio n. 2
0
    ####################################################

    ## Figure Properties #######
    width = 12
    height = 5
    legsize = height + 3
    ###########################
    ## Prep Data
    arg = Args()
    arg.addQuery("status", "eq", "processed-ok")
    # Load station params
    d = Params(stnfile, ["hk::H", "hk::R"], arg)

    arg = Args()
    m = Params(moonfile, ["H", "Vp"])
    m.filter(arg.addQuery("geoprov", "not in", "oceanic"))
    m.filter(arg.addQuery("geoprov", "not in", "Shelf"))

    #######################################################################
    # F0
    # CANADA
    if plotnum[0]:
        ## Kanamori Poisson Histogram
        # Set figure
        fig = plt.figure(figsize=(width, height))
        ax = plt.subplot(111)
        # Get data
        dk, avgdk, bins, ptype = getdata("kan", d, m, vdict, "Canada")
        ptype.settitle("Canada Total")

        n, bins, patches = plt.hist(dk, bins=bins, facecolor="green", alpha=0.75, label=ptype.histlabel)
Esempio n. 3
0
    plt.plot(m.mb_H, m.mb_Vp, 'ob', lw = 4, ms = 12, label = "Bostock (2010) Vp against H estimate")
    plt.plot(xpt, ypt,'--r', lw = 4, label="Principal Component Vector")
#    plt.plot([0, coeff[1,0] * 2] + am[0], [0, coeff[1,1]*2] + am[1],'--k', lw = 4)

    plt.title("Correlated Error in Dataset: Moving up the Vp, H Trade Off Curve", size = 18)
    plt.legend(loc= 2)
    plt.ylabel("Station Vp [km/s]")
    plt.xlabel("Station Thickness H [km]")
    plt.grid(True)


    #############################################################################
    # Vp estimates and controlled source
    ##############################################################################
    arg = Args().stations(["ALE","ALGO","ARVN","BANO","CBRQ","DAWY","DELO","FCC","FFC","HAL","KGNO","KSVO","LMN","MBC","MNT","MOBC","ORIO","PEMO","PGC","PLVO","PMB","PTCO","SJNN","SUNO","ULM","ULM2","WAPA ","WHY","WSLR ","YKW1","YOSQ"])
    m.filter(arg)
    m.filter(Args().addQuery("mb::Vp", "gt", "5.5"))
    m.filter(Args().addQuery("mb::stdVp", "lt", "0.8"))

    c = Params(csfile, ["H","Vp"])
    c.sync(m)

    stdVp = 2 * m.mb_stdVp # 2 stdError
    t = np.arange(len(m.mb_Vp[0:11]))

    corr = spearmanr(m.mb_Vp[0:11], c.Vp[0:11])
    fig = plt.figure( figsize = (width, height) )
    plt.plot(t, m.mb_Vp[0:11], '-ob', lw = 4, ms = 12, label = "Bostock (2010) Vp estimate")
    plt.errorbar(t, m.mb_Vp[0:11], yerr=stdVp[0:11], xerr=None, fmt=None, ecolor = 'blue',
                 elinewidth = 2, capsize = 7, mew = 2, label = "2 std dev Bootstrap")
    plt.plot(t, c.Vp[0:11], '-og', lw = 4, ms = 12, label = "Proximal active source estimate")
# IMPORTS
###########################################################################
import os, json
import numpy as np
import matplotlib.pyplot as plt
from plotTools import Args, Params


stnfile = os.environ['HOME'] + '/thesis/data/stations.json'
#stdict = json.loads( dbfile.read() )

lim = 0.055

# Load station params
d = Params(stnfile, ["hk::H","hk::R", "hk::stdR", "hk::c0R", "hk::c1R"])
d.filter(Args().addQuery("status", "in", "processed"))

ix1 = np.abs(d.hk_c0R - d.hk_R) < 2*d.hk_stdR
ix2 = np.abs(d.hk_c1R - d.hk_R) < 2*d.hk_stdR
ix3 = np.abs(d.hk_c1R - d.hk_c0R) < lim

ixfail3 = ( np.logical_not(ix1) | np.logical_not(ix2) ) & np.logical_not(ix3)
ixfail2 = ( np.logical_not(ix1) | np.logical_not(ix2) ) & ix3
ixpass3 = (ix1 & ix2) & ix3
ixpass2 = (ix1 & ix2) & np.logical_not(ix3)


msg = [
    "For stations failing (1) or (2) and (3) there is a likely significant lateral heterogeneity or some processing flaw and the station may be marked as unused.",
    "For stations failing (1) or (2) but passing (3) the data may be reasonable but my bootstrap error estimate is much too kind. Readjustment of error required.",
    "For station passing (1) and (2) and (3), Great.",
Esempio n. 5
0
###########################################################################
# IMPORTS
###########################################################################
import os, json
import numpy as np
import matplotlib.pyplot as plt
from plotTools import Args, Params

stnfile = os.environ['HOME'] + '/thesis/data/stations.json'
#stdict = json.loads( dbfile.read() )

lim = 0.055

# Load station params
d = Params(stnfile, ["hk::H", "hk::R", "hk::stdR", "hk::c0R", "hk::c1R"])
d.filter(Args().addQuery("status", "in", "processed"))

ix1 = np.abs(d.hk_c0R - d.hk_R) < 2 * d.hk_stdR
ix2 = np.abs(d.hk_c1R - d.hk_R) < 2 * d.hk_stdR
ix3 = np.abs(d.hk_c1R - d.hk_c0R) < lim

ixfail3 = (np.logical_not(ix1) | np.logical_not(ix2)) & np.logical_not(ix3)
ixfail2 = (np.logical_not(ix1) | np.logical_not(ix2)) & ix3
ixpass3 = (ix1 & ix2) & ix3
ixpass2 = (ix1 & ix2) & np.logical_not(ix3)

msg = [
    "For stations failing (1) or (2) and (3) there is a likely significant lateral heterogeneity or some processing flaw and the station may be marked as unused.",
    "For stations failing (1) or (2) but passing (3) the data may be reasonable but my bootstrap error estimate is much too kind. Readjustment of error required.",
    "For station passing (1) and (2) and (3), Great.",
    "For stations passing (1) and (2) but failing (3) the cluster Vp/Vs difference may be above the arbitrary cut-off of +\- 0.05 but could be included provided the std Vp/Vs error is not above some other arbitrarily chosen cap."
Esempio n. 6
0
    ####################################################

    ## Figure Properties #######
    width = 12
    height = 5
    legsize = height + 3
    ###########################
    ## Prep Data
    arg = Args()
    arg.addQuery("status", "eq", "processed-ok")
    # Load station params
    d = Params(stnfile, ["hk::H","hk::R"], arg)

    arg = Args()
    m = Params(moonfile, ["H","Vp"])
    m.filter(arg.addQuery("geoprov", "not in", "oceanic"))
    m.filter(arg.addQuery("geoprov", "not in", "Shelf"))

    #######################################################################
    # F0
    # CANADA
    if plotnum[0]:
    ## Kanamori Poisson Histogram
        # Set figure
        fig = plt.figure( figsize = (width, height) )
        ax = plt.subplot(111)
        # Get data
        dk, avgdk, bins, ptype = getdata("kan", d, m, vdict, "Canada")
        ptype.settitle("Canada Total")

        n, bins, patches = plt.hist(dk, bins = bins, facecolor='green', alpha=0.75, label = ptype.histlabel)
Esempio n. 7
0
#        ax2.legend(prop={'size': leg})
        ax2.set_xlabel("Stations", size = label)
        ax2.set_ylabel("H [km]", size = label)

#        ax2.axis("tight")


#############################################################################
    # FIG 3: FG Vp/Vs versus Kan Vp/Vs
    ##############################################################################
    if 0:
        f = Params(stnfile, ["fg::H","fg::R", "fg::stdR", "fg::stdH", "fg::Vp"])
        k = Params(stnfile, ["hk::H","hk::R", "hk::stdR", "hk::stdH", "wm::Vp"])

        maxerr = 0.06
        f.filter(Args().addQuery("fg::stdR", "lt", str(maxerr)))
        k.sync(f)

        stdR = 2 * f.fg_stdR # 2 stdError
        t = np.arange(len(f.fg_R))

        corr = pearsonr(f.fg_R, k.hk_R)
        print "FullGrid to ZK R with stddev limit {} and {} stations, correlation = {}".format(maxerr, len(k.stns), corr[0])

        fig = plt.figure( figsize = (figwidth, figheight) )
        ax = plt.subplot(111)

        plt.plot(t, f.fg_R, '-ob', lw = lw, ms = ms, label = "Full Gridsearch Vp/Vs estimate")
        plt.errorbar(t, f.fg_R, yerr= stdR, xerr=None, fmt=None, ecolor = 'blue',
                     elinewidth = elw, capsize = caplen, mew = capwid, label = "2 std dev Bootstrap")
        plt.plot(t, k.hk_R, '-og', lw = lw, ms = ms, label = "ZK Vp/Vs estimate")