示例#1
0
            src_code = src_code[:3] + '_' + src_code[3:]

    new_src_codes.append(src_code)

    # now match zone class based on lookup table
    zone_class[i] = aggregate_intraslab_sources(src_code, zone_class[i])

# supplant new source codes
del src_codes
src_codes = array(new_src_codes).copy()

###############################################################################
# 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'
示例#2
0
             dy,
             head_width=30000,
             head_length=head_length,
             lw=0.3,
             fc='0.2',
             fill=True,
             length_includes_head=True)

##########################################################################################
# get average per zone and plot
##########################################################################################

src_codes = get_field_data(sfz, 'CODE', 'str')
src_shapes = sfz.shapes()

av_shmax, sig_shmax = get_aus_shmax_vectors(src_codes, src_shapes)

# get centroid and plot
alen = 180000
head_length = 60000

for i, shape in enumerate(src_shapes):
    centroid = Polygon(shape.points).centroid.wkt
    centroid = centroid.strip('PIONT').replace('(', ' ').replace(')',
                                                                 ' ').split()
    cx, cy = m(float(centroid[0]), float(centroid[1]))

    dy = alen * cos(radians(av_shmax[i])) + head_length * cos(
        radians(av_shmax[i]))
    dx = alen * sin(radians(av_shmax[i])) + head_length * sin(
        radians(av_shmax[i]))