# In[ ]: # Configure the limits of the map and the coastline resolution map_config = { 'min_lon': -80.0, 'max_lon': -30.0, 'min_lat': -37.0, 'max_lat': 14.0, 'resolution': 'l' } # Create a hmtk basemap basemap1 = HMTKBaseMap(map_config, 'Earthquake Catalogue') # Add a catalogue basemap1.add_catalogue(catalogue) # In[ ]: # Limit the catalogue to the time period 1960 - 2012 valid_time = np.logical_and(catalogue.data['year'] >= 1900, catalogue.data['year'] <= 2014) catalogue.select_catalogue_events(valid_time) plot_magnitude_time_density(catalogue, 0.2, 2.0) print 'Catalogue now contains %s events' % catalogue.get_number_events() # In[ ]: # Show distribution of magnitudes with time plot_magnitude_time_scatter(catalogue, fmt_string='.')
# add source model #basemap1.add_source_model(source_model, area_border, border_width, point_marker, point_size, overlay) basemap1.add_source_model(source_model, overlay=True) ### ### Catálogo ### x = catalogue.data['longitude'] y = catalogue.data['latitude'] z = catalogue.data['depth'] _idx = np.argsort(z) catalogue.select_catalogue_events(_idx) basemap1.add_catalogue(catalogue, alpha=0.1) #basemap1.add_colour_scaled_points(x, y, np.log(z+1), overlay=True) if savefig: basemap1.savemap("/Users/pirchiner/Desktop/teste.png") plt.show() #exit() # Limit the catalogue to the time period 1960 - 2012 #valid_time = np.logical_and(catalogue.data['year'] >= 1960, # catalogue.data['year'] <= 2014) #catalogue.select_catalogue_events(valid_time)
border_width=1.5, alpha=0.5) # Select catalogue from within sourcezone selector1 = CatalogueSelector(catalogue_depth_clean, create_copy=True) for source in source_model.sources: source.select_catalogue(selector1) llon, ulon, llat, ulat = source.catalogue.get_bounding_box() print llon, ulon, llat, ulat # Map the Source src_basemap = HMTKBaseMap(map_config, "Source: {:s}".format(source.name)) print "Source ID: %s Source Name: %s Number of Events: %g" % ( source.id, source.name, source.catalogue.get_number_events()) # Add on the catalogue src_basemap.add_catalogue(source.catalogue, overlay=False) completeness_table_a = np.array([[1990., 3.0], [1980., 3.5], [1965., 4.0]]) plot_magnitude_time_density(source.catalogue, 0.1, 1.0, completeness=completeness_table_a) grid_lims = [110., 160.0, 0.1, -45.0, -5.0, 0.1, 0., 20., 20.] try: os.remove("Aus1_tmp.hdf5") except OSError: pass config = { "bandwidth": 50,
# In[ ]: # Sort catalogue chronologically catalogue.sort_catalogue_chronologically() print 'Catalogue sorted chronologically!' # In[ ]: # Configure the limits of the map and the coastline resolution map_config = {'min_lon': -80.0, 'max_lon': -30.0, 'min_lat': -37.0, 'max_lat': 14.0, 'resolution':'l'} # Create a hmtk basemap basemap1 = HMTKBaseMap(map_config, 'Earthquake Catalogue') # Add a catalogue basemap1.add_catalogue(catalogue) # In[ ]: # Limit the catalogue to the time period 1960 - 2012 valid_time = np.logical_and(catalogue.data['year'] >= 1900, catalogue.data['year'] <= 2014) catalogue.select_catalogue_events(valid_time) plot_magnitude_time_density(catalogue, 0.2, 2.0) print 'Catalogue now contains %s events' % catalogue.get_number_events() # In[ ]: # Show distribution of magnitudes with time
for source in area_model.sources: # Selects the earthquakes within each polygon source.select_catalogue(selector) print 'Source Number %s - %s contains %8.0f events' % ( source.id, source.name, source.catalogue.get_number_events()) # <codecell> # Example - show earthquakes in the Gulf of Corinth zone map_config_goc = { 'min_lon': 21.0, 'max_lon': 25.0, 'min_lat': 37.0, 'max_lat': 39.0, 'resolution': 'h' } # Configure the limits of the map and the coastline resolution map_config_goc = { 'min_lon': -58.9, 'max_lon': -55.5, 'min_lat': -13.8, 'max_lat': -10.0, 'resolution': 'l' } basemap2 = HMTKBaseMap(map_config_goc, 'MatoGrosso') basemap2.add_catalogue(area_model.sources[0].catalogue, overlay=True) basemap2.add_source_model(area_model, area_border='k-') # <codecell>
# <codecell> from hmtk.seismicity.selector import CatalogueSelector # Create an instance of the selector class selector = CatalogueSelector(catalogue, create_copy=True) # <codecell> for source in area_model.sources: # Selects the earthquakes within each polygon source.select_catalogue(selector) print 'Source Number %s - %s contains %8.0f events' %(source.id, source.name, source.catalogue.get_number_events()) # <codecell> # Example - show earthquakes in the Gulf of Corinth zone map_config_goc = {'min_lon': 21.0, 'max_lon': 25.0, 'min_lat': 37.0, 'max_lat': 39.0, 'resolution':'h'} # Configure the limits of the map and the coastline resolution map_config_goc = {'min_lon': -58.9, 'max_lon': -55.5, 'min_lat': -13.8, 'max_lat': -10.0, 'resolution':'l'} basemap2 = HMTKBaseMap(map_config_goc, 'MatoGrosso') basemap2.add_catalogue(area_model.sources[0].catalogue, overlay=True) basemap2.add_source_model(area_model, area_border='k-') # <codecell>