SeisCat API

Start here to navigate the SeisCat source code.

seiscat

Main script for seiscat.

copyright:

2022-2023 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.scripts.seiscat.download_and_store(client, config, initdb)[source]

Download events and store them in the database.

Parameters:
  • client – FDSN client

  • config – config object

  • initdb – if True, create new database file

seiscat.scripts.seiscat.main()[source]

Main function. Catch KeyboardInterrupt.

seiscat.scripts.seiscat.parse_arguments()[source]

Parse command line arguments.

seiscat.scripts.seiscat.run()[source]

Run seiscat.

fdsnws

FDSN webservices functions for seiscat.

copyright:

2022-2023 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.fdsnws.open_fdsn_connection(config)[source]

Open FDSN connection. Return a FDSN client object.

Parameters:

config – config object

Returns:

FDSN client object

seiscat.fdsnws.query_events(client, config, first_query=True)[source]

Query events from FDSN client based on criteria in config.

Parameters:
  • client – FDSN client object

  • config – config object

  • first_query – True if this is the first query

Returns:

obspy Catalog object

db

Database functions for seiscat.

copyright:

2022-2023 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

seiscat.db.write_catalog_to_db(cat, config, initdb)[source]

Write catalog to database.

Parameters:
  • cat – obspy Catalog object

  • config – config object

  • initdb – if True, create new database file

print

Printing functions for seiscat.

copyright:

2022-2023 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.print.print_catalog(config)[source]

Pretty-print the catalog as a table.

Parameters:

config – config object

plot

Plotting functions for seiscat.

copyright:

2022-2023 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.plot.plot_catalog_map(config)[source]

Plot the catalog map.

Parameters:

config – config object

utils

Utility functions for seiscat.

copyright:

2022-2023 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.utils.err_exit(msg)[source]

Print an error message and exit.

Parameters:

msg – error message

seiscat.utils.parse_configspec()[source]

Parse the configspec file.

Returns:

configspec object

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

seiscat.utils.write_ok(filepath)[source]

Check if it is ok to write to a file.

Parameters:

filepath – path to the file

Returns:

True if it is ok to write to the file, False otherwise

seiscat.utils.write_sample_config(configspec, progname)[source]

Write a sample config file.

Parameters:
  • configspec – configspec object

  • progname – program name