Esempio n. 1
0
###    Source Model
###


if add_sourcemodel:
    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)    
    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)
Esempio n. 2
0
# 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, 'Source Models')
# Add fault sources
#basemap1.add_source_model(fault_model, overlay=True)
# Add area sources
basemap1.add_source_model(area_model, area_border='b-')

# <codecell>

# Load in the catalogue
from hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueParser

input_file = 'data_input/hmtk_bsb2013.csv'
parser = CsvCatalogueParser(input_file)
catalogue = parser.read_file()
print 'Input complete: %s events in catalogue' % catalogue.get_number_events()
print 'Catalogue Covers the Period: %s to %s' % (catalogue.start_year,
                                                 catalogue.end_year)

# <codecell>
Esempio n. 3
0
llon, ulon, llat, ulat = catalogue_clean.get_bounding_box()
#map_config = {'min_lon': np.floor(llon), 'max_lon': np.ceil(ulon),
#             'min_lat': np.floor(llat), 'max_lat': np.ceil(ulat), 'resolution':'c'}
map_config = {
    'min_lon': np.floor(100),
    'max_lon': np.ceil(160),
    'min_lat': np.floor(-45),
    'max_lat': np.ceil(-4),
    'resolution': 'c'
}
# Creating a basemap - input a cconfiguration and (if desired) a title
basemap1 = HMTKBaseMap(map_config, 'Earthquake Catalogue')

# Adding the seismic sources
basemap1.add_source_model(source_model,
                          area_border='r-',
                          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)
Esempio n. 4
0
# Import an Area Source Model
area_source_file = 'snippets/s03.xml'
parser = nrmlSourceModelParser(area_source_file)
area_model = parser.read_file()

# <codecell>

# 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, 'Source Models')
# Add fault sources
#basemap1.add_source_model(fault_model, overlay=True)
# Add area sources
basemap1.add_source_model(area_model, area_border='b-')

# <codecell>

# Load in the catalogue
from hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueParser

input_file = 'data_input/hmtk_bsb2013.csv'
parser = CsvCatalogueParser(input_file)
catalogue = parser.read_file()
print 'Input complete: %s events in catalogue' % catalogue.get_number_events()
print 'Catalogue Covers the Period: %s to %s' % (catalogue.start_year, catalogue.end_year)

# <codecell>

area_model.sources[0].catalogue = 'data_input/hmtk_bsb2013.csv'