示例#1
0
def event_create(event_c):
    trace_start_lat = ones((event_c)) * -38.15
    trace_start_lon = ones((event_c)) * 146.5

    azimuth = ones((event_c)) * 217.2
    dip = ones((event_c)) * 60.2
    weight = ones((event_c)) * 18.1
    event_activity = ones((event_c)) * 0.1
    recurrence = ones((event_c)) * 5.3

    Mw = ones((event_c)) * 6.9
    lat0 = ones((event_c)) * -38.31
    lon0 = ones((event_c)) * 146.3

    depth = ones((event_c)) * 6.5
    rx = ones((event_c)) * 25.3
    ry = ones((event_c)) * 3.8

    length = ones((event_c)) * 50.6
    width = ones((event_c)) * 15.
    event_activity = ones((event_c)) * 9.

    event_set = Event_Set.create(depth=depth,
                                 rupture_centroid_lat=lat0,
                                 rupture_centroid_lon=lon0,
                                 azimuth=azimuth,
                                 dip=dip,
                                 ML=None,
                                 Mw=Mw,
                                 fault_width=15.0)
    event_set.event_activity = ones((event_c)) * 0.8
    pseudo_event_set = Pseudo_Event_Set.split_logic_tree(
        event_set, ['Gaull_1990_WA'], [1])
    pseudo_event_set.source_zone_id = ones((event_c)) * 9.
    return pseudo_event_set, event_activity
示例#2
0
def event_create(event_c):
    trace_start_lat = ones((event_c))* -38.15
    trace_start_lon = ones((event_c))* 146.5
   
    azimuth = ones((event_c))* 217.2
    dip = ones((event_c))* 60.2
    weight = ones((event_c))* 18.1
    event_activity = ones((event_c))* 0.1
    recurrence = ones((event_c))* 5.3
    
    Mw = ones((event_c))* 6.9
    lat0 = ones((event_c))* -38.31
    lon0 = ones((event_c))* 146.3
    
    depth = ones((event_c))* 6.5
    rx = ones((event_c))* 25.3
    ry = ones((event_c))* 3.8
    
    length = ones((event_c))* 50.6
    width = ones((event_c))* 15.
    event_activity = ones((event_c))* 9.

    event_set = Event_Set.create(depth=depth,rupture_centroid_lat=lat0,
                        rupture_centroid_lon=lon0,azimuth=azimuth,
                        dip=dip,ML=None,Mw=Mw,fault_width=15.0)
    event_set.event_activity =  ones((event_c))* 0.8
    pseudo_event_set = Pseudo_Event_Set.split_logic_tree(event_set,
                                                         ['Gaull_1990_WA'],
                                                         [1])
    pseudo_event_set.source_zone_id =  ones((event_c))* 9.
    return pseudo_event_set, event_activity
示例#3
0
    def create_analysis_objects(self):
        # Parameters
        rupture_centroid_lat = asarray([-30])
        rupture_centroid_lon = asarray([150])
        length = asarray([1.0])
        azimuth = asarray([2.0])
        width = asarray([3.0])
        dip = asarray([4.0])
        depth = asarray([5.0])
        Mw = asarray([6.0])
        atten_models = asarray([
            'Allen', 'Toro_1997_midcontinent', 'Sadigh_97',
            'Youngs_97_interface', 'Youngs_97_intraslab'
        ])
        atten_model_weights = asarray([0.2, 0.2, 0.2, 0.2, 0.2])
        atten_periods = asarray([0, 1.0, 2.0])
        sites_lat = asarray([-31])
        sites_lon = asarray([150])

        # Event Set
        event_set = Event_Set.create(rupture_centroid_lat=rupture_centroid_lat,
                                     rupture_centroid_lon=rupture_centroid_lon,
                                     azimuth=azimuth,
                                     dip=dip,
                                     Mw=Mw,
                                     depth=depth,
                                     area=length * width,
                                     width=width,
                                     length=length)

        # Event Activity
        event_activity = Event_Activity(len(event_set))
        event_activity.set_scenario_event_activity()

        # Source Model
        source_model = Source_Model.create_scenario_source_model(
            len(event_set))
        source_model.set_attenuation(atten_models, atten_model_weights)
        source_model.set_ground_motion_calcs(atten_periods)
        event_set.scenario_setup()
        event_activity.ground_motion_model_logic_split(source_model, True)

        # Sites
        sites = Sites(sites_lat, sites_lon)

        # SA
        # Set up synthetic SA figures
        # Dimensions -  spawn, gmm, rm, sites, events, period
        motion = zeros((1, len(atten_models), 1, len(sites), len(event_set),
                        len(atten_periods)),
                       dtype=float)
        # Allen
        motion[:, 0, :, :, :, 0] = 0  # period 0
        motion[:, 0, :, :, :, 1] = 1  # period 1.0
        motion[:, 0, :, :, :, 2] = 2  # period 2.0
        # Toro_1997_midcontinent
        motion[:, 1, :, :, :, 0] = 3  # period 0
        motion[:, 1, :, :, :, 1] = 4  # period 1.0
        motion[:, 1, :, :, :, 2] = 5  # period 2.0
        # Sadigh_97
        motion[:, 2, :, :, :, 0] = 6  # period 0
        motion[:, 2, :, :, :, 1] = 7  # period 1.0
        motion[:, 2, :, :, :, 2] = 8  # period 2.0
        # Youngs_97_interface
        motion[:, 3, :, :, :, 0] = 9  # period 0
        motion[:, 3, :, :, :, 1] = 10  # period 1.0
        motion[:, 3, :, :, :, 2] = 11  # period 2.0
        # Young_97_intraslab
        motion[:, 4, :, :, :, 0] = 12  # period 0
        motion[:, 4, :, :, :, 1] = 13  # period 1.0
        motion[:, 4, :, :, :, 2] = 14  # period 2.0

        # A minimal set of eqrm_flags so create_parameter_data passes
        # We only care about atten_models -> everything else are dummy values
        eqrm_flags = {}
        eqrm_flags['run_type'] = 'hazard'
        eqrm_flags['is_scenario'] = True
        eqrm_flags['output_dir'] = self.dir
        eqrm_flags['input_dir'] = self.dir
        eqrm_flags['site_tag'] = 'different_to_function'
        eqrm_flags['return_periods'] = [0.0]
        eqrm_flags['use_amplification'] = False
        eqrm_flags['zone_source_tag'] = 'not_used'
        eqrm_flags['atten_periods'] = atten_periods
        eqrm_flags['atten_models'] = atten_models

        return (event_set, event_activity, source_model, sites, motion,
                eqrm_flags)
示例#4
0
 def create_analysis_objects(self):
     # Parameters
     rupture_centroid_lat = asarray([-30])
     rupture_centroid_lon = asarray([150])
     length = asarray([1.0])
     azimuth = asarray([2.0])
     width = asarray([3.0])
     dip = asarray([4.0])
     depth = asarray([5.0])
     Mw = asarray([6.0])
     atten_models = asarray(['Allen', 
                             'Toro_1997_midcontinent', 
                             'Sadigh_97', 
                             'Youngs_97_interface', 
                             'Youngs_97_intraslab'])
     atten_model_weights = asarray([0.2, 0.2, 0.2, 0.2, 0.2])
     atten_periods = asarray([0, 1.0, 2.0])
     sites_lat = asarray([-31])
     sites_lon = asarray([150])
     
     # Event Set
     event_set = Event_Set.create(rupture_centroid_lat=rupture_centroid_lat,
                                  rupture_centroid_lon=rupture_centroid_lon,
                                  azimuth=azimuth,
                                  dip=dip,
                                  Mw=Mw,
                                  depth=depth,
                                  area=length*width,
                                  width=width, 
                                  length=length)
     
     # Event Activity
     event_activity = Event_Activity(len(event_set))
     event_activity.set_scenario_event_activity()
     
     # Source Model
     source_model = Source_Model.create_scenario_source_model(len(event_set))
     source_model.set_attenuation(atten_models, atten_model_weights)
     source_model.set_ground_motion_calcs(atten_periods)
     event_set.scenario_setup()
     event_activity.ground_motion_model_logic_split(source_model, True)
     
     # Sites
     sites = Sites(sites_lat, sites_lon)
     
     # SA
     # Set up synthetic SA figures
     # Dimensions -  spawn, gmm, rm, sites, events, period
     motion = zeros((1, 
                     len(atten_models), 
                     1, 
                     len(sites), 
                     len(event_set),
                     len(atten_periods)), dtype=float)
     # Allen
     motion[:,0,:,:,:,0] = 0 # period 0
     motion[:,0,:,:,:,1] = 1 # period 1.0
     motion[:,0,:,:,:,2] = 2 # period 2.0
     # Toro_1997_midcontinent
     motion[:,1,:,:,:,0] = 3 # period 0
     motion[:,1,:,:,:,1] = 4 # period 1.0
     motion[:,1,:,:,:,2] = 5 # period 2.0
     # Sadigh_97
     motion[:,2,:,:,:,0] = 6 # period 0
     motion[:,2,:,:,:,1] = 7 # period 1.0
     motion[:,2,:,:,:,2] = 8 # period 2.0
     # Youngs_97_interface
     motion[:,3,:,:,:,0] = 9  # period 0
     motion[:,3,:,:,:,1] = 10 # period 1.0
     motion[:,3,:,:,:,2] = 11 # period 2.0
     # Young_97_intraslab
     motion[:,4,:,:,:,0] = 12 # period 0
     motion[:,4,:,:,:,1] = 13 # period 1.0
     motion[:,4,:,:,:,2] = 14 # period 2.0
     
     # A minimal set of eqrm_flags so create_parameter_data passes
     # We only care about atten_models -> everything else are dummy values
     eqrm_flags = {}
     eqrm_flags['run_type'] = 'hazard'
     eqrm_flags['is_scenario'] = True
     eqrm_flags['output_dir'] = self.dir
     eqrm_flags['input_dir'] = self.dir
     eqrm_flags['site_tag'] = 'different_to_function'
     eqrm_flags['return_periods'] = [0.0]
     eqrm_flags['use_amplification'] = False
     eqrm_flags['zone_source_tag'] = 'not_used'
     eqrm_flags['atten_periods'] = atten_periods
     eqrm_flags['atten_models'] = atten_models
     
     return (event_set, 
             event_activity, 
             source_model, 
             sites, 
             motion, 
             eqrm_flags)