Catalog#
- class seismostats.Catalog(data: Any | None = None, name: str | None = None, starttime: Timestamp | None = None, endtime: Timestamp | None = None, mc: float | None = None, delta_m: float | None = None, b_value: float | None = None, a_value: float | None = None, bounding_polygon: Polygon | str | None = None, depth_min: float | None = None, depth_max: float | None = None, **kwargs)#
A catalog of seismic events represented in tabular form, where each row corresponds to a single earthquake.
To be a valid Catalog object, it must have at least a magnitude column. Depending on the method the following columns are also required: longitude, latitude, depth, time, and magnitude .
- Parameters:
data – Data to initialize the catalog with.
name – Name of the catalog.
starttime – Start time of the catalog.
endtime – End time of the catalog.
mc – Completeness magnitude of the catalog.
delta_m – Magnitude binning of the catalog.
b_value – Gutenberg-Richter b-value of the catalog.
bounding_polygon – 2D boundary of the catalog.
depth_min – Minimum depth for which events are included in the catalog.
depth_max – Maximum depth for which events are included in the catalog.
kwargs – Additional keyword arguments to pass to pandas DataFrame constructor.
See also
The Catalog class is a subclass of
pandas.DataFrame, and inherits all of its methods and attributes.Examples
Create a Catalog from a dictionary.
>>> import pandas as pd >>> from seismostats import Catalog >>> data = {'longitude': [0, 1, 2], ... 'latitude': [0, 1, 2], ... 'depth': [0, 1, 2], ... 'time': pd.to_datetime(['2021-01-01 00:00:00', ... '2021-01-01 00:00:00', ... '2021-01-01 00:00:00']), ... 'magnitude': [1, 2, 3]} >>> catalog = Catalog(data) >>> catalog longitude latitude depth time magnitude 0 0 0 0 2021-01-01 00:00:00 1 1 1 1 1 2021-01-01 00:00:00 2 2 2 2 2 2021-01-01 00:00:00 3
- Variables:
name – Name of the catalog.
mc – Completeness magnitude of the catalog.
delta_m – Magnitude binning of the catalog.
b_value – Gutenberg-Richter b-value of the catalog.
a_value – Gutenberg-Richter a-value of the catalog.
starttime – Start time of the catalog.
endtime – End time of the catalog.
bounding_polygon – 2D boundary of the catalog.
depth_min – Minimum depth for which events are included in the catalog.
depth_max – Maximum depth for which events are included in the catalog.
logger – Logger for the catalog.
Methods
Rounds values in the
magnitudecolumn of the catalog to a given precisiondelta_m.Drop event, origin, and magnitude IDs from the catalog.
Drop uncertainty columns from the catalog.
Estimates a-value of the Gutenberg-Richter (GR) law, using the magnitudes in the Catalog.
Estimates b-value of the Gutenberg-Richter (GR) law, using the magnitudes in the Catalog.
Estimates the completeness magnitude (mc) using b-value stability.
Returns the smallest magnitude in a given list of completeness magnitudes for which the KS test is passed, i.e., where the null hypothesis that the sample of magnitudes is drawn from a Gutenberg-Richter law cannot be rejected.
Returns the completeness magnitude (mc) estimate using the maximum curvature method.
Create a Catalog from a list of dictionaries.
Create a (seismostats) Catalog from an openquake Catalogue.
Create a Catalog from a QuakeML file.
Plots cumulative count of earthquakes in given catalog above given Mc through time.
Plots cumulative frequency magnitude distribution, optionally with a corresponding theoretical Gutenberg-Richter (GR) distribution.
Plots frequency magnitude distribution.
This function plots seismicity on a surface.
Creates a scatter plot, each dot is an event.
Plots the estimated b-value in dependence of the completeness magnitude.
Remove all columns except the required ones defined in
_required_cols.Converts the Catalog to an openquake Catalogue The optional dependency group openquake is required for this method.
Convert the catalog to QuakeML format.