SeisCat API
Start here to navigate the SeisCat source code.
seiscat
Main script for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
db
Database functions for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
- seiscat.db.check_db_exists(config, initdb)[source]
Check if database file exists.
- Parameters:
config – config object
initdb – if True, create new database file
- Raises:
ValueError – if db_file is not set in config file
RuntimeError – if user does not want to overwrite existing database
FileNotFoundError – if database file does not exist
- seiscat.db.delete_event_from_db(config, eventid, version=None)[source]
Delete an event from the database.
- Parameters:
config – config object
eventid – event id of the event to delete (if None, delete all events for the given version)
version – version of the event to delete (if None, delete all versions of the event)
- seiscat.db.get_catalog_stats(config)[source]
Get a string with catalog statistics.
- Parameters:
config – config object
- Returns:
string with catalog statistics
- seiscat.db.increment_event_in_db(config, eventid, version, field, value)[source]
Increment an event in the database.
- Parameters:
config – config object
eventid – event id of the event to update
version – version of the event to update
field – field to update
value – value to increment, must be a number
- Raises:
ValueError – if field is not found in database, or if value is not a number
- seiscat.db.read_events_from_db(config)[source]
Read events from database. Return a list of events.
- Parameters:
config – config object
- Returns:
list of events, each event is a dictionary
- seiscat.db.read_fields_and_rows_from_db(config, eventid=None, version=None)[source]
Read fields and rows from database. Return a list of fields and a list of rows.
- Parameters:
config – config object
eventid – limit to events with this evid
version – limit to events with this version
- Returns:
list of fields, list of rows
- Raises:
ValueError – if field is not found in database
- seiscat.db.replicate_event_in_db(config, eventid, version=1)[source]
Replicate an event in the database. The new event will have the same evid as the original event, but a different version.
- Parameters:
config – config object
eventid – event id of the original event
version – version of the original event
- Raises:
ValueError – if eventid/version is not found in database
- seiscat.db.update_event_in_db(config, eventid, version, field, value)[source]
Update an event in the database.
- Parameters:
config – config object
eventid – event id of the event to update
version – version of the event to update
field – field to update
value – new value
- Raises:
ValueError – if field is not found in database
download_event_details
Download event details from FDSN web services and store them to local files.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
download_event_waveforms
Uses ObsPy mass downloader to download event waveforms from FDSN web services.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
editdb
Edit functions for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
fdsnws
FDSN webservices functions for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
- class seiscat.fdsnws.QueryArgs(config, suffix, first_query)[source]
Bases:
objectBuild query arguments for FDSN client.
feeddb
Feed the database with events from FDSN web services.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
parse_arguments
Argument parsing for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
plot_map
Plot events on a map.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
plot_map_utils
Utility functions for the map modules.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
plot_map_cartopy
Plot events on a map using cartopy.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
plot_map_folium
Plot events on a map using folium.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
print
Printing functions for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
utils
Utility functions for seiscat.
- copyright:
2022-2024 Claudio Satriano <satriano@ipgp.fr>
- license:
GNU General Public License v3.0 or later (https://www.gnu.org/licenses/gpl-3.0-standalone.html)
- class seiscat.utils.ExceptionExit(additional_msg=None)[source]
Bases:
AbstractContextManagerContext manager to exit when an exception is raised.
- seiscat.utils.err_exit(msg)[source]
Print an error message and exit.
- Parameters:
msg – error message
- seiscat.utils.read_config(config_file, configspec=None)[source]
Read a config file.
- Parameters:
config_file – path to the config file
configspec – configspec object
- Returns:
config object