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

bin_magnitudes

Rounds values in the magnitude column of the catalog to a given precision delta_m.

drop_ids

Drop event, origin, and magnitude IDs from the catalog.

drop_uncertainties

Drop uncertainty columns from the catalog.

estimate_a

Estimates a-value of the Gutenberg-Richter (GR) law, using the magnitudes in the Catalog.

estimate_b

Estimates b-value of the Gutenberg-Richter (GR) law, using the magnitudes in the Catalog.

estimate_mc_b_stability

Estimates the completeness magnitude (mc) using b-value stability.

estimate_mc_ks

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.

estimate_mc_maxc

Returns the completeness magnitude (mc) estimate using the maximum curvature method.

from_dict

Create a Catalog from a list of dictionaries.

from_openquake

Create a (seismostats) Catalog from an openquake Catalogue.

from_quakeml

Create a Catalog from a QuakeML file.

plot_cum_count

Plots cumulative count of earthquakes in given catalog above given Mc through time.

plot_cum_fmd

Plots cumulative frequency magnitude distribution, optionally with a corresponding theoretical Gutenberg-Richter (GR) distribution.

plot_fmd

Plots frequency magnitude distribution.

plot_in_space

This function plots seismicity on a surface.

plot_mags_in_time

Creates a scatter plot, each dot is an event.

plot_mc_vs_b

Plots the estimated b-value in dependence of the completeness magnitude.

strip

Remove all columns except the required ones defined in _required_cols.

to_openquake

Converts the Catalog to an openquake Catalogue The optional dependency group openquake is required for this method.

to_quakeml

Convert the catalog to QuakeML format.