Catalog.to_openquake#
- Catalog.to_openquake() OQCatalogue#
Converts the Catalog to an openquake Catalogue The optional dependency group openquake is required for this method. The required columns are mapped to the openquake columns, except time is converted to ‘year’, ‘month’, ‘day’, ‘hour’, ‘minute’, ‘second’. ‘eventID’ is created if not present.
- Returns:
OQCatalogue – the converted Catalogue
Examples
>>> import pandas as pd >>> from seismostats import Catalog >>> cat = Catalog.from_dict({ ... 'longitude': [42.35, 1.35, 2.35], ... 'latitude': [3.34444, 5.135, 2.134], ... 'depth': [5.5, 10.52, 50.4], ... 'time': pd.to_datetime(['1900-01-01 05:05:13', ... '1982-04-07 07:07:15', ... '2020-11-30 12:30:59']), ... 'magnitude': [1.0, 2.5, 3.9] ... }) >>> oq_cat = cat.to_openquake() >>> type(oq_catalog) <class 'openquake.hmtk.seismicity.catalogue.Catalogue'>