Пример #1
0
        setmin = False
        min_Mw = -999.0

else:
    # Basic characteristics of seismicity catalog
    m0total = 1.0e17
    max_m0 = math.pow(10.0, 19.5)
    minM = -1.0
    min_m0 = gr.calc_m0(minM)
    slope = 1.0

    root = 'random'

    # Define the Gutenberg-Richter relationship values
    gr_obj = gr.GutenbergRichter(b=slope,
                                 m0total=m0total,
                                 max_m0=max_m0,
                                 min_m0=min_m0)
    gr_obj.calc_a()

    # Make a plot of the chosen G-R relationship
    maxM = gr.calc_Mw(max_m0)
    Msamp = 0.25
    Mws = np.arange(minM, maxM + Msamp, Msamp)
    Ns = gr_obj.get_N(Mws)

    # Calculate probability of a given event per second
    Nsec = Ns / secyear

    # Generate catalog
    catlength = 2.0 * secday
    gr_obj.generate_catalog(catlength)
max_m0 = math.pow(10.0, 19.5) # Assuming a fixed corner, will calculate m0total
bvals = np.array([0.9, 0.95, 1.0, 1.05, 1.1])
avals = np.arange(2.5, 7.5, 0.25)
magmin = 1.0
magmax = 8.0
magstep = 0.5
magarray = np.arange(magmin, magmax, magstep)
m0array = gr.calc_m0(magarray)

nevents = np.zeros((len(avals), len(bvals), len(magarray)))
m0total = np.zeros((len(avals), len(bvals)))

# Fill in matrix of nevents and m0total
for i, a in enumerate(avals):
    for j, b in enumerate(bvals):
        gro = gr.GutenbergRichter(a=a, b=b, max_m0=max_m0)
        gro.calc_m0total()
        m0total[i, j] = gro.m0total
        nevents[i, j, :] = gro.get_N(magarray)
        # subtract events from next bin up to avoid double counting
        for k in range(len(magarray)): 
            if (k + 1 < len(magarray)):
                nevents[i, j, k] = nevents[i, j, k] - nevents[i, j, k + 1]
        
secday = 24.0*3600.0
secyear = secday*365.0

# Read in attenuation curve and sample on distarray
# model = 'DWAK'
model = 'EH45Tcold'
# model = 'EH45TcoldCrust1b'
Пример #3
0
max_dep = gr_obj.max_dep

# Define upper and lower bounds with an order of magnitude uncertainty on both
# m0total and max_m0
m0total_upper = m0total * 10.0
m0total_lower = m0total * 0.1
max_m0_upper = max_m0 * 10.0
max_m0_lower = max_m0 * 0.1

# Define the Gutenberg-Richter relationship values for uncertainty estimates
# gr_obj = gr.GutenbergRichter(b=slope, m0total=m0total, max_m0=max_m0,
#                              min_m0=min_m0)
# gr_obj.calc_a()

gr_obj_upper1 = gr.GutenbergRichter(b=slope,
                                    m0total=m0total_upper,
                                    max_m0=max_m0,
                                    min_m0=min_m0)
gr_obj_upper1.calc_a()
gr_obj_upper2 = gr.GutenbergRichter(b=slope,
                                    m0total=m0total_upper,
                                    max_m0=max_m0_lower,
                                    min_m0=min_m0)
gr_obj_upper2.calc_a()
gr_obj_lower1 = gr.GutenbergRichter(b=slope,
                                    m0total=m0total_lower,
                                    max_m0=max_m0,
                                    min_m0=min_m0)
gr_obj_lower1.calc_a()
gr_obj_lower2 = gr.GutenbergRichter(b=slope,
                                    m0total=m0total_lower,
                                    max_m0=max_m0_upper,