示例#1
0
# load Rajabi SHMax vectors
###############################################################################

shmax_pref, shmax_sig = get_aus_shmax_vectors(src_codes, shapes)

# fix preferred upper/lower seismo depths from Domains
usd, lsd = get_ul_seismo_depths(src_codes, usd, lsd)

###############################################################################
# make some adjustments
###############################################################################

rte_adj_fact = ones_like(usd)
dep_u = 0. * ones_like(usd)
dep_l = 20. * ones_like(usd)
nclass = dom

###############################################################################
# write initial shapefile
###############################################################################

outshp = 'Mcomp_NSHA18_test.shp'
bval_fix = -99 * ones_like(rte_adj_fact)
bval_sig_fix = -99 * ones_like(rte_adj_fact)

build_source_shape(outshp, shapes, src_names, src_codes, nclass, \
                   rte_adj_fact, dep_b, dep_u, dep_l, usd, lsd, \
                   min_rmag, mmax, bval_fix, bval_sig_fix, \
                   ycomp, mcomp, stk, dip, rke, \
                   shmax_pref, shmax_sig, trt, dom, prefCat)
示例#2
0
# load Rajabi SHMax vectors
###############################################################################

shmax_pref, shmax_sig = get_aus_shmax_vectors(src_codes, shapes)

###############################################################################
# get rate adjustment factors
###############################################################################

origshp = 'Domains_Sep2011_edit.shp'
newField = 'code'
origField = 'CODE'
rte_adj_fact = get_rate_adjust_factor(domshp, newField, origshp, origField)

###############################################################################
# write initial shapefile
###############################################################################
if single_mc == 1:
    outshp = 'Domains_NSHA18_single_Mc.shp'
elif single_mc == 0:
    outshp = 'Domains_NSHA18_multi_Mc.shp'

bval_fix = -99 * ones_like(rte_adj_fact)
bval_sig_fix = -99 * ones_like(rte_adj_fact)

build_source_shape(outshp, shapes, src_names, src_codes, zone_class, \
                   rte_adj_fact, dep_b, dep_u, dep_l, usd, lsd, \
                   min_rmag, mmax, bval_fix, bval_sig_fix, \
                   ycomp, mcomp, pref_stk, pref_dip, pref_rke, \
                   shmax_pref, shmax_sig, trt_new, domains, prefCat)
示例#3
0
newField = 'CODE'
origField = 'CODE'
rte_adj_fact = get_rate_adjust_factor(domshp, newField, origshp, origField)
'''
###############################################################################
# write initial shapefile
###############################################################################

#outshp = 'ARUP_NSHA18.shp'
bval_fix = -99 * ones_like(array(min_rmag))
bval_sig_fix = -99 * ones_like(array(min_rmag))
rte_adj_fact = ones_like(array(min_rmag))
pref_stk = -99 * ones_like(array(min_rmag))
pref_dip = -99 * ones_like(array(min_rmag))
pref_rke = -99 * ones_like(array(min_rmag))

build_source_shape(outshp, shapes, src_names, src_codes, zone_class, \
                   rte_adj_fact, neo_dep_b, neo_dep_u, neo_dep_l, neo_usd, array(neo_lsd), \
                   min_rmag, neo_mmax, bval_fix, bval_sig_fix, \
                   ycomp, mcomp, pref_stk, pref_dip, pref_rke, \
                   shmax_pref, shmax_sig, neo_trt, neo_domains, prefCat)

# write projection file
print(outshp)
prjfile = outshp.strip().split('.shp')[0] + '.prj'
f = open(prjfile, 'w')
f.write(
    'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'
)
f.close()