Esempio n. 1
0
    config,
    completeness_table=comp_table,
    smoothing_kernel=IsotropicGaussian(),
    #increment = False,
)

x = o[:, 0]
y = o[:, 1]
r = o[:, 4]  #/ (res**2)

r = np.array([np.log10(r) if r > 0 else np.NaN for r in r])
#r = np.log10(r)
r[r < 0] = 0.
#r =

#print np.sqrt(len(x))

from map import rate_map

m = rate_map(x,
             y,
             r,
             "a-value [frankel1995]", (nx, ny),
             catalogue=catalogue,
             origin='lower')
m.show()

#print output_data
# export results
model.write_to_csv(OUTPUT_FILE)
Esempio n. 2
0
import numpy as np

smooth = np.genfromtxt("../data_output/hmtk_bsb2013_pp_decluster_woo1996.csv", delimiter=",", skip_header=True)
smooth = np.genfromtxt("../data_output/hmtk_bsb2013_decluster_frankel1995.csv", delimiter=",", skip_header=True)
# smooth = np.genfromtxt("../data_output/hmtk_bsb2013_pp_decluster_woo1996.csv", delimiter=",",skip_header=True)
smooth = np.genfromtxt(
    "/Users/pirchiner/dev/helmstetter/output/conan/rates_2_280.csv", delimiter=",", skip_header=True, skiprows=2
)
# filename = "/Users/pirchiner/dev/helmstetter/output/conan/rates_1_235.csv"


o = np.array(smooth)

x = o[:, 0]
y = o[:, 1]
r = o[:, 2]
# r = o[:, 2] / (res**2)
# r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])
# r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])

# print np.sqrt(len(x))

from map import rate_map

# print len(x), len(y), len(r), sqrt()
# m = rate_map(x, y, r, "a-value [Woo1996]  $h(m) = %.2f e^{(%.2f m)}$ km"%(model.c, model.d),
m = rate_map(x, y, r, "a-value [Frankel1995]", (100, 100), origin="lower")
m.show()
Esempio n. 3
0
                              b_val=1.0),
            nodal_plane_dist=None,
            hypo_depth_dist=None)

        sources.append(p)

s = source_model.mtkSourceModel(identifier="04",
                                name="PSHAB-Smoothed Helmstetter2012",
                                sources=sources)

s.serialise_to_nrml(
    filename="helmstetter2012/source_model_pshab_helmstetter2012.xml",
    use_defaults=True)

o = np.array(o)

x = o[:, 0]
y = o[:, 1]
r = o[:, 2]

from map import rate_map

#print len(x), len(y), len(r), sqrt()
m = rate_map(x,
             y,
             r,
             "a-value [Helmstetter2012]", (n, n),
             catalogue=catalogue,
             origin='lower')
m.show()
Esempio n. 4
0
# config
config = {"Length_Limit": 3.0, "BandWidth": 150.0, "increment": True, "magnitude_increment": 0.5}
# smoothing
o = model.run_analysis(
    catalogue,
    config,
    completeness_table=comp_table,
    smoothing_kernel=IsotropicGaussian(),
    # increment = False,
)

x = o[:, 0]
y = o[:, 1]
r = o[:, 4]  # / (res**2)

r = np.array([np.log10(r) if r > 0 else np.NaN for r in r])
# r = np.log10(r)
r[r < 0] = 0.0
# r =

# print np.sqrt(len(x))

from map import rate_map

m = rate_map(x, y, r, "a-value [frankel1995]", (nx, ny), catalogue=catalogue, origin="lower")
m.show()

# print output_data
# export results
model.write_to_csv(OUTPUT_FILE)
Esempio n. 5
0
# ax.set_xlabel("distances [km]")
# ax.set_ylabel("times [days]")
#
#
# plt.scatter(_d, _h, s=np.exp(_m), cmap=plt.cm.RdYlGn,
#                  marker='o', facecolors='none', edgecolors=color, #alpha=0.3,
#                  )
# #plt.colorbar(cs)
# plt.show()

exit()

from map import rate_map
m = rate_map(x,
             y,
             r,
             "alpha [Helmstetter2012]", (nx, ny),
             s.learning_catalogue,
             origin='lower')
m.show()

# m.m.scatter(_x, _y, s=_h,
#             marker='o', facecolors='none', edgecolors='k', alpha=0.1
#             )
# m.m.scatter(_x, _y, s=_d,
#             marker='o', facecolors='none', edgecolors='b', alpha=0.1
#             )

m = rate_map(x,
             y,
             a,
             "a-value [Helmstetter2012]", (nx, ny),
                              a_val= _a , 
                              b_val=1.0),
            nodal_plane_dist=None,
            hypo_depth_dist=None)
      
        sources.append(p)
  
s = source_model.mtkSourceModel(identifier="04", 
                                name = "PSHAB-Smoothed Helmstetter2012", 
                                sources = sources)
  
s.serialise_to_nrml(filename = "helmstetter2012/source_model_pshab_helmstetter2012.xml", 
                    use_defaults = True)
        
        

o = np.array(o)

x = o[:, 0]
y = o[:, 1]
r = o[:, 2]
       
from map import rate_map

#print len(x), len(y), len(r), sqrt()
m = rate_map(x, y, r, "a-value [Helmstetter2012]", 
             (n,n), catalogue=catalogue, origin='lower')
m.show()

       
Esempio n. 7
0
                       delimiter=",",
                       skip_header=True)
smooth = np.genfromtxt("../data_output/hmtk_bsb2013_decluster_frankel1995.csv",
                       delimiter=",",
                       skip_header=True)
#smooth = np.genfromtxt("../data_output/hmtk_bsb2013_pp_decluster_woo1996.csv", delimiter=",",skip_header=True)
smooth = np.genfromtxt(
    "/Users/pirchiner/dev/helmstetter/output/conan/rates_2_280.csv",
    delimiter=",",
    skip_header=True,
    skiprows=2)
#filename = "/Users/pirchiner/dev/helmstetter/output/conan/rates_1_235.csv"

o = np.array(smooth)

x = o[:, 0]
y = o[:, 1]
r = o[:, 2]
#r = o[:, 2] / (res**2)
#r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])
#r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])

#print np.sqrt(len(x))

from map import rate_map

#print len(x), len(y), len(r), sqrt()
#m = rate_map(x, y, r, "a-value [Woo1996]  $h(m) = %.2f e^{(%.2f m)}$ km"%(model.c, model.d),
m = rate_map(x, y, r, "a-value [Frankel1995]", (100, 100), origin='lower')
m.show()
Esempio n. 8
0
y = d[:,1]
h = d[:,2]

# d2 = np.genfromtxt(fname=filename2, 
#                  #comments='#',
#                   delimiter=',', 
#                   skiprows = 2, 
#                   #skip_header = 1, 
#                   #skip_footer, 
#                   #converters, missing, missing_values, filling_values, usecols, names, 
#                   #excludelist, deletechars, replace_space, autostrip, 
#                   #case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise,
#                   )
#  
# x2 = d2[:,0]
# y2 = d2[:,1]
# h2 = d2[:,2]

#print len(x), np.sqrt(len(x))

from map import rate_map
title = "PGA (poe 10%, 50 years) [ helmstetter2012 ]"

# m = hazard_map(x, y, h2-h, title, 
#                (50, 50), origin='lower')
m = rate_map(x, y, h*1000, title,
#               (50, 50), origin='lower',
               (100, 100), origin='lower',
               catalogue=catalogue)
m.show()
Esempio n. 9
0
# plt.colorbar()
# plt.show()

#r = o[:, 2] / (res**2)
#r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])
#r = np.array([ np.log10(r) if  r >= 1 else 0 for r in r ])
 
#print np.sqrt(len(x))
 
from map import rate_map
 
#print len(x), len(y), len(r), sqrt()
#print model.c, model.d
#m = rate_map(x, y, r, "a-value [Woo1996]  $h(m) = %.2f e^{(%.2f m)}$ km"%(model.c, model.d), 
print nx, ny, len(x), len(y)
m = rate_map(x, y, r, "a-value [Woo1996]", 
             (nx,ny), catalogue=model.catalogue, origin='lower')
m.show()
 
 
# export results
model.write_to_csv(OUTPUT_FILE)
#model.write_rates(OUTPUT_FILE)
 
#print model.grid
#print model.catalogue
#print model.beta
#print model.data
#print model.kernel
#print output_data

Esempio n. 10
0
# ax.set_title("DistanceTime Bandwidth Distribution")
# ax.set_xlabel("distances [km]")
# ax.set_ylabel("times [days]")
#  
#  
# plt.scatter(_d, _h, s=np.exp(_m), cmap=plt.cm.RdYlGn,
#                  marker='o', facecolors='none', edgecolors=color, #alpha=0.3,
#                  )
# #plt.colorbar(cs)
# plt.show()


exit()

from map import rate_map
m = rate_map(x, y, r, "alpha [Helmstetter2012]", 
             (nx,ny), s.learning_catalogue, origin='lower')
m.show()


# m.m.scatter(_x, _y, s=_h, 
#             marker='o', facecolors='none', edgecolors='k', alpha=0.1
#             )
# m.m.scatter(_x, _y, s=_d, 
#             marker='o', facecolors='none', edgecolors='b', alpha=0.1
#             )

m = rate_map(x, y, a, "a-value [Helmstetter2012]", 
             (nx,ny), s.learning_catalogue, origin='lower')
m.show()

#print output_data