csep.core.catalogs.CSEPCatalog
- class csep.core.catalogs.CSEPCatalog(**kwargs)[source]
Standard catalog class for PyCSEP catalog operations.
- __init__(**kwargs)[source]
- Standard catalog format for CSEP catalogs. Primary event data are stored in structured numpy array. Additional
metadata are available by the event_id in the catalog metadata information.
- Parameters:
filename – location of catalog
catalog (numpy.ndarray or eventlist) – catalog data
catalog_id – catalog id number (used for stochastic event set forecasts)
format – identification used for serialization
name – human readable name of catalog
region – spatial and magnitude region
compute_stats – whether statistics should be computed for the catalog
filters (str or list) – filtering operations to apply to the catalog
metadata (dict) – additional information for events
date_accessed (str) – time string when catalog was accessed
Methods
__init__
(**kwargs)Standard catalog format for CSEP catalogs. Primary event data are stored in structured numpy array. Additional
apply_mct
(m_main, event_epoch[, mc])Applies time-dependent magnitude of completeness following a mainshock.
b_positive
()Implements the b-positive indicator from Nicholas van der Elst
filter
([statements, in_place])Filters the catalog based on statements.
filter_spatial
([region, update_stats, in_place])Removes events outside of the region.
from_dataframe
(df, **kwargs)Creates catalog from dataframe.
from_dict
(adict, **kwargs)Creates a class from the dictionary representation of the class state.
get_bbox
()Returns bounding box of all events in the catalog
get_bvalue
([mag_bins, return_error])Estimates the b-value of a catalog from Marzocchi and Sandri (2003).
Returns CSEP format for a catalog
Returns the cumulative number of events in the catalog.
Returns datetime object from timestamp representation in catalog
Returns depths of all events in catalog
Returns the datetime of the event as the UTC epoch time (aka unix timestamp)
get_event_ids
()Returns latitudes of all events in catalog
Returns longitudes of all events in catalog
get_mag_idx
()Return magnitude index from region magnitudes
Returns magnitudes of all events in catalog
get_number_of_events
()Computes the number of events from a catalog by checking its length.
get_spatial_idx
()Return spatial index of region for a longitudes and latitudes in catalog.
Returns catalog length in seconds assuming that the catalog is sorted by time.
load_ascii_catalogs
(filename, **kwargs)Loads multiple catalogs in csep-ascii format.
load_catalog
(filename[, loader])Loads catalog stored in CSEP1 ascii format
load_json
(filename, **kwargs)Loads catalog from JSON file
magnitude_counts
([mag_bins, tol, retbins])Computes the count of events within mag_bins
plot
([ax, show, extent, set_global, plot_args])Plot catalog according to plate-carree projection
Returns counts of events within discrete spatial region
spatial_event_probability
()spatial_magnitude_counts
([mag_bins, tol])Return counts of events in space-magnitude region.
to_dataframe
([with_datetime])Returns pandas Dataframe describing the catalog.
to_dict
()Serializes class to json dictionary.
Compute summary statistics of events in catalog
write_ascii
(filename[, write_header, ...])Write catalog in csep2 ascii format.
write_json
(filename)Writes catalog to json file
Attributes
catalog
data
dtype
Number of events in catalog
log