Exemplo n.º 1
0
                  #excludelist, deletechars, replace_space, autostrip, 
                  #case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise,
                  )

x = d[:,0]
y = d[:,1]
h = d[:,2]

# gal (cm/s^2) -> g (10 m/s^2) <==> h *= 1e-3
h = h*1.e-3

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

from map import hazard_map

m = hazard_map(x, y, h, "PGA (poe 10%, 50 years) [ dourado2014, crisis2007 ]", 
               (50, 50), catalogue=catalogue, origin='lower')


from hmtk.parsers.source_model.nrml04_parser import nrmlSourceModelParser

source_model_file = "/Users/pirchiner/dev/pshab/dourado_reproduction/source_model.xml"

# read source model file
parser = nrmlSourceModelParser(source_model_file)
source_model = parser.read_file(2.0)

# add source model
#basemap1.add_source_model(source_model, area_border, border_width, point_marker, point_size, overlay)    
m.basemap.add_source_model(source_model, border_width=0.5, overlay=True)    
    
Exemplo n.º 2
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 hazard_map
title = "PGA (poe 10%, 50 years) [ helmstetter2012 ]"

# m = hazard_map(x, y, h2-h, title, 
#                (50, 50), origin='lower')
m = hazard_map(x, y, h, title,
               (50, 50), origin='lower',
#               (100, 100), origin='lower',
               catalogue=catalogue)
m.show()
Exemplo n.º 3
0
#                   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 hazard_map
title = "PGA (poe 10%, 50 years) [ helmstetter2012 ]"

# m = hazard_map(x, y, h2-h, title,
#                (50, 50), origin='lower')
m = hazard_map(
    x,
    y,
    h,
    title,
    (50, 50),
    origin='lower',
    #               (100, 100), origin='lower',
    catalogue=catalogue)
m.show()