obspy.io.csv.core

Note

This module can be easily extended to write and read more event information. If you are interested, please send a PR to the github repository.

  1. Add ‘extended’ or similar key to FIELDS dict, e.g. as a start use
    ‘extended’: (

    ‘{time!s:.25} {lat:.6f} {lat_err:.6f} {lon:.6f} {lon_err:.6f} ‘ ‘{dep:.3f} {dep_err:.3f} {mag:.2f} {mag_err:.2f} {magtype} {id}’ )

    You can also test by just passing the string to fields option.

  2. Implement writing functionality in write_csv by adding the new properties to the dict d. Missing values have to be handled.

  3. Implement reading functionality for the new properties in read_csv.

  4. Write some tests testing all new properties. Check that an event with all new properties defined or missing can be written and read again.

Similar can be done for the picks using PFIELDS, _write_picks, _read_picks

Public Functions

load_csv

Load CSV or CSZ file into numpy array

load_eventtxt

Load EVENTTXT file into numpy array

Private Functions

Warning

Private functions are mainly for internal/developer use and their API might change without notice.

_events2array

Convert ObsPy catalog to numpy array

_evid

_is_csv

_is_csz

_is_eventtxt

_names_sequence

_open

Accept files or file names or pathlib objects

_origin

_read_csv

Read a CSV file and return ObsPy catalog

_read_csz

Read a CSZ file and return ObsPy catalog with picks

_read_eventtxt

Read EVENTTXT file and return ObsPy catalog

_read_picks

Read picks from CSV file and add them to event

_string

_write_csv

Write ObsPy catalog to CSV file

_write_csz

Write ObsPy catalog to CSZ file

_write_eventtxt

Write ObsPy catalog to EVENTTXT file

_write_picks

Write picks from event to a CSV file