GRRateGrid#

class seismostats.GRRateGrid(data=None, *args, name=None, starttime: Timestamp | None = None, endtime: Timestamp | None = None, **kwargs)#

A subclass of pandas DataFrame that represents a grid where for each grid cell, the GR parameters a, b, and mc and number_events are stored.

To be a valid RateGrid object, the DataFrame must have the following columns: longitude_min, longitude_max, latitude_min, latitude_max, depth_min, depth_max, number_events, a, b, and mc.

Parameters:
  • data – array-like, Iterable, dict, or DataFrame, optional Data to initialize the catalog with.

  • name – Name of the catalog.

  • starttime – Start time of the catalog. If a string, it must be in a format that can be parsed by pandas.to_datetime.

  • endtime – End time of the catalog. If a string, it must be in a format that can be parsed by pandas.to_datetime.

  • kwargs – Additional arguments and keyword arguments to pass to pandas DataFrame constructor.

Notes

The RateGrid class is a subclass of pandas DataFrame, and inherits all of its methods and attributes.

Attributes

Methods

add_time_index

Create MultiIndex using starttime, optionally endtime and a cell number for each spatial block.

reindex_cell_id

If the RateGrid has a MultiIndex which includes cell_id as a level, this method will update the RateGrid's index to use unique cell_id values.

strip

Remove all columns except the required ones defined in _required_cols.