{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Event Bank\n", "\n", "The EventBank class is used to interact with a local directory of event files. The `get_events` method of Event Bank are compatible with the `get_events` method of the FDSN client in obspy. Additionally there are several useful features for managing events on disk. \n", "\n", "\n", "## Quickstart" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:54.163036Z", "iopub.status.busy": "2025-01-09T18:06:54.162869Z", "iopub.status.idle": "2025-01-09T18:06:55.186028Z", "shell.execute_reply": "2025-01-09T18:06:55.185348Z" } }, "outputs": [], "source": [ "import obspy\n", "\n", "import obsplus" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:55.188639Z", "iopub.status.busy": "2025-01-09T18:06:55.188075Z", "iopub.status.idle": "2025-01-09T18:06:55.309871Z", "shell.execute_reply": "2025-01-09T18:06:55.309371Z" } }, "outputs": [], "source": [ "%%capture\n", "# make sure the dataset is downloaded and supress output.\n", "obsplus.load_dataset(\"crandall_test\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:55.311640Z", "iopub.status.busy": "2025-01-09T18:06:55.311461Z", "iopub.status.idle": "2025-01-09T18:06:56.159781Z", "shell.execute_reply": "2025-01-09T18:06:56.159207Z" } }, "outputs": [ { "data": { "text/plain": [ "EventBank(base_path=/tmp/tmprg7scu3x/crandall_test/events, index_path=/tmp/tmprg7scu3x/crandall_test/events/.index.db)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# copy the Crandall dataset to a temporary directory\n", "crandall = obsplus.copy_dataset(\"crandall_test\")\n", "\n", "# path to directory where events are stored\n", "event_path = crandall.event_path\n", "\n", "# init an EventBank instance\n", "bank = obsplus.EventBank(event_path)\n", "\n", "# ensure index is up-to-date\n", "bank.update_index()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Accessing the index \n", "The index can be accessed directly to get a summary of the events contained in the archive. Depending on the task, it may be more natural to work with the index dataframe rather than the obspy catalog objects directly." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:56.187962Z", "iopub.status.busy": "2025-01-09T18:06:56.187558Z", "iopub.status.idle": "2025-01-09T18:06:56.216572Z", "shell.execute_reply": "2025-01-09T18:06:56.216066Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
timelatitudelongitudedepthmagnitudeevent_descriptionassociated_phase_countazimuthal_gapevent_idhorizontal_uncertainty...standard_errorused_phase_countstation_countvertical_uncertaintyupdatedauthoragency_idcreation_timeversionpath
02007-08-06 01:44:48.81039.4617-111.23786570.01.78LR0.0NaNsmi:local/248828NaN...0.89360.023.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:26:49.6426502007/08/06/2007-08-06T01-44-48_48828.xml
12007-08-06 10:47:25.60039.4615-111.23172050.01.57LR0.0NaNsmi:local/248843NaN...0.82370.029.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:33:27.1109142007/08/06/2007-08-06T10-47-25_48843.xml
22007-08-06 08:48:40.01039.4635-111.2277410.04.37LR0.0NaNsmi:local/248839NaN...1.73560.0134.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:33:13.6181112007/08/06/2007-08-06T08-48-40_48839.xml
32007-08-07 21:42:51.13039.4627-111.22004620.01.650.0NaNsmi:local/248925NaN...0.57040.019.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-11 22:08:54.2369162007/08/07/2007-08-07T21-42-51_48925.xml
42007-08-07 07:13:05.76039.4605-111.22423240.02.240.0NaNsmi:local/248891NaN...0.99010.035.0NaN2025-01-09 18:05:01.311870464NaT2007/08/07/2007-08-07T07-13-05_48891.xml
52007-08-07 02:05:04.49039.4648-111.22551790.02.08LR0.0NaNsmi:local/248882NaN...0.99350.035.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:15:19.1904042007/08/07/2007-08-07T02-05-04_48882.xml
62007-08-07 02:14:24.08039.4632-111.22304180.01.26LR0.0NaNsmi:local/248883NaN...0.88340.014.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:10:26.8640452007/08/07/2007-08-07T02-14-24_48883.xml
72007-08-07 03:44:18.47039.4625-111.21524160.01.45LR0.0NaNsmi:local/248887NaN...0.57160.015.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:10:27.5762042007/08/07/2007-08-07T03-44-18_48887.xml
\n", "

8 rows × 28 columns

\n", "
" ], "text/plain": [ " time latitude longitude depth magnitude \\\n", "0 2007-08-06 01:44:48.810 39.4617 -111.2378 6570.0 1.78 \n", "1 2007-08-06 10:47:25.600 39.4615 -111.2317 2050.0 1.57 \n", "2 2007-08-06 08:48:40.010 39.4635 -111.2277 410.0 4.37 \n", "3 2007-08-07 21:42:51.130 39.4627 -111.2200 4620.0 1.65 \n", "4 2007-08-07 07:13:05.760 39.4605 -111.2242 3240.0 2.24 \n", "5 2007-08-07 02:05:04.490 39.4648 -111.2255 1790.0 2.08 \n", "6 2007-08-07 02:14:24.080 39.4632 -111.2230 4180.0 1.26 \n", "7 2007-08-07 03:44:18.470 39.4625 -111.2152 4160.0 1.45 \n", "\n", " event_description associated_phase_count azimuthal_gap event_id \\\n", "0 LR 0.0 NaN smi:local/248828 \n", "1 LR 0.0 NaN smi:local/248843 \n", "2 LR 0.0 NaN smi:local/248839 \n", "3 0.0 NaN smi:local/248925 \n", "4 0.0 NaN smi:local/248891 \n", "5 LR 0.0 NaN smi:local/248882 \n", "6 LR 0.0 NaN smi:local/248883 \n", "7 LR 0.0 NaN smi:local/248887 \n", "\n", " horizontal_uncertainty ... standard_error used_phase_count \\\n", "0 NaN ... 0.8936 0.0 \n", "1 NaN ... 0.8237 0.0 \n", "2 NaN ... 1.7356 0.0 \n", "3 NaN ... 0.5704 0.0 \n", "4 NaN ... 0.9901 0.0 \n", "5 NaN ... 0.9935 0.0 \n", "6 NaN ... 0.8834 0.0 \n", "7 NaN ... 0.5716 0.0 \n", "\n", " station_count vertical_uncertainty updated author \\\n", "0 23.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "1 29.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "2 134.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "3 19.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "4 35.0 NaN 2025-01-09 18:05:01.311870464 \n", "5 35.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "6 14.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "7 15.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "\n", " agency_id creation_time version \\\n", "0 NIOSH 2018-10-10 20:26:49.642650 \n", "1 NIOSH 2018-10-10 20:33:27.110914 \n", "2 NIOSH 2018-10-10 20:33:13.618111 \n", "3 NIOSH 2018-10-11 22:08:54.236916 \n", "4 NaT \n", "5 NIOSH 2018-10-10 21:15:19.190404 \n", "6 NIOSH 2018-10-10 21:10:26.864045 \n", "7 NIOSH 2018-10-10 21:10:27.576204 \n", "\n", " path \n", "0 2007/08/06/2007-08-06T01-44-48_48828.xml \n", "1 2007/08/06/2007-08-06T10-47-25_48843.xml \n", "2 2007/08/06/2007-08-06T08-48-40_48839.xml \n", "3 2007/08/07/2007-08-07T21-42-51_48925.xml \n", "4 2007/08/07/2007-08-07T07-13-05_48891.xml \n", "5 2007/08/07/2007-08-07T02-05-04_48882.xml \n", "6 2007/08/07/2007-08-07T02-14-24_48883.xml \n", "7 2007/08/07/2007-08-07T03-44-18_48887.xml \n", "\n", "[8 rows x 28 columns]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "index = bank.read_index()\n", "index" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The index contains the following columns:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you are working from a data directory that doesn't have write access, you can specify a custom location for the index path:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:56.218787Z", "iopub.status.busy": "2025-01-09T18:06:56.218337Z", "iopub.status.idle": "2025-01-09T18:06:56.967219Z", "shell.execute_reply": "2025-01-09T18:06:56.966645Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
timelatitudelongitudedepthmagnitudeevent_descriptionassociated_phase_countazimuthal_gapevent_idhorizontal_uncertainty...standard_errorused_phase_countstation_countvertical_uncertaintyupdatedauthoragency_idcreation_timeversionpath
02007-08-06 01:44:48.81039.4617-111.23786570.01.78LR0.0NaNsmi:local/248828NaN...0.89360.023.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:26:49.6426502007/08/06/2007-08-06T01-44-48_48828.xml
12007-08-06 10:47:25.60039.4615-111.23172050.01.57LR0.0NaNsmi:local/248843NaN...0.82370.029.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:33:27.1109142007/08/06/2007-08-06T10-47-25_48843.xml
22007-08-06 08:48:40.01039.4635-111.2277410.04.37LR0.0NaNsmi:local/248839NaN...1.73560.0134.0NaN2025-01-09 18:05:01.310870528DCNIOSH2018-10-10 20:33:13.6181112007/08/06/2007-08-06T08-48-40_48839.xml
32007-08-07 21:42:51.13039.4627-111.22004620.01.650.0NaNsmi:local/248925NaN...0.57040.019.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-11 22:08:54.2369162007/08/07/2007-08-07T21-42-51_48925.xml
42007-08-07 07:13:05.76039.4605-111.22423240.02.240.0NaNsmi:local/248891NaN...0.99010.035.0NaN2025-01-09 18:05:01.311870464NaT2007/08/07/2007-08-07T07-13-05_48891.xml
52007-08-07 02:05:04.49039.4648-111.22551790.02.08LR0.0NaNsmi:local/248882NaN...0.99350.035.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:15:19.1904042007/08/07/2007-08-07T02-05-04_48882.xml
62007-08-07 02:14:24.08039.4632-111.22304180.01.26LR0.0NaNsmi:local/248883NaN...0.88340.014.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:10:26.8640452007/08/07/2007-08-07T02-14-24_48883.xml
72007-08-07 03:44:18.47039.4625-111.21524160.01.45LR0.0NaNsmi:local/248887NaN...0.57160.015.0NaN2025-01-09 18:05:01.311870464DCNIOSH2018-10-10 21:10:27.5762042007/08/07/2007-08-07T03-44-18_48887.xml
\n", "

8 rows × 28 columns

\n", "
" ], "text/plain": [ " time latitude longitude depth magnitude \\\n", "0 2007-08-06 01:44:48.810 39.4617 -111.2378 6570.0 1.78 \n", "1 2007-08-06 10:47:25.600 39.4615 -111.2317 2050.0 1.57 \n", "2 2007-08-06 08:48:40.010 39.4635 -111.2277 410.0 4.37 \n", "3 2007-08-07 21:42:51.130 39.4627 -111.2200 4620.0 1.65 \n", "4 2007-08-07 07:13:05.760 39.4605 -111.2242 3240.0 2.24 \n", "5 2007-08-07 02:05:04.490 39.4648 -111.2255 1790.0 2.08 \n", "6 2007-08-07 02:14:24.080 39.4632 -111.2230 4180.0 1.26 \n", "7 2007-08-07 03:44:18.470 39.4625 -111.2152 4160.0 1.45 \n", "\n", " event_description associated_phase_count azimuthal_gap event_id \\\n", "0 LR 0.0 NaN smi:local/248828 \n", "1 LR 0.0 NaN smi:local/248843 \n", "2 LR 0.0 NaN smi:local/248839 \n", "3 0.0 NaN smi:local/248925 \n", "4 0.0 NaN smi:local/248891 \n", "5 LR 0.0 NaN smi:local/248882 \n", "6 LR 0.0 NaN smi:local/248883 \n", "7 LR 0.0 NaN smi:local/248887 \n", "\n", " horizontal_uncertainty ... standard_error used_phase_count \\\n", "0 NaN ... 0.8936 0.0 \n", "1 NaN ... 0.8237 0.0 \n", "2 NaN ... 1.7356 0.0 \n", "3 NaN ... 0.5704 0.0 \n", "4 NaN ... 0.9901 0.0 \n", "5 NaN ... 0.9935 0.0 \n", "6 NaN ... 0.8834 0.0 \n", "7 NaN ... 0.5716 0.0 \n", "\n", " station_count vertical_uncertainty updated author \\\n", "0 23.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "1 29.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "2 134.0 NaN 2025-01-09 18:05:01.310870528 DC \n", "3 19.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "4 35.0 NaN 2025-01-09 18:05:01.311870464 \n", "5 35.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "6 14.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "7 15.0 NaN 2025-01-09 18:05:01.311870464 DC \n", "\n", " agency_id creation_time version \\\n", "0 NIOSH 2018-10-10 20:26:49.642650 \n", "1 NIOSH 2018-10-10 20:33:27.110914 \n", "2 NIOSH 2018-10-10 20:33:13.618111 \n", "3 NIOSH 2018-10-11 22:08:54.236916 \n", "4 NaT \n", "5 NIOSH 2018-10-10 21:15:19.190404 \n", "6 NIOSH 2018-10-10 21:10:26.864045 \n", "7 NIOSH 2018-10-10 21:10:27.576204 \n", "\n", " path \n", "0 2007/08/06/2007-08-06T01-44-48_48828.xml \n", "1 2007/08/06/2007-08-06T10-47-25_48843.xml \n", "2 2007/08/06/2007-08-06T08-48-40_48839.xml \n", "3 2007/08/07/2007-08-07T21-42-51_48925.xml \n", "4 2007/08/07/2007-08-07T07-13-05_48891.xml \n", "5 2007/08/07/2007-08-07T02-05-04_48882.xml \n", "6 2007/08/07/2007-08-07T02-14-24_48883.xml \n", "7 2007/08/07/2007-08-07T03-44-18_48887.xml \n", "\n", "[8 rows x 28 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import tempfile\n", "from pathlib import Path\n", "\n", "index_path = Path(tempfile.mkdtemp()) / \"index.db\"\n", "cust_ind_bank = obsplus.EventBank(event_path, index_path=index_path)\n", "cust_ind_bank.update_index()\n", "ind = cust_ind_bank.read_index()\n", "ind # Note that paths in the index are relative to event_path" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get events\n", "The `EventBank` can be used to get obspy event objects based on query parameters." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:56.969056Z", "iopub.status.busy": "2025-01-09T18:06:56.968865Z", "iopub.status.idle": "2025-01-09T18:06:57.382198Z", "shell.execute_reply": "2025-01-09T18:06:57.381639Z" } }, "outputs": [], "source": [ "catalog = bank.get_events(minmagnitude=2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Put events\n", "Events can be saved to disk using the `put_events` method. If an event with the same resource_id already exists in the bank it will be overwritten." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:57.384399Z", "iopub.status.busy": "2025-01-09T18:06:57.384208Z", "iopub.status.idle": "2025-01-09T18:06:57.462990Z", "shell.execute_reply": "2025-01-09T18:06:57.462341Z" } }, "outputs": [ { "data": { "text/plain": [ "EventBank(base_path=/tmp/tmprg7scu3x/crandall_test/events, index_path=/tmp/tmprg7scu3x/crandall_test/events/.index.db)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bank.put_events(obspy.read_events())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Organizing event directories\n", "`EventBank` can also be used to (re)organize event directories. The events are saved in the following structure by default: `{year/month/day/year-month-dayThour-minute-second-short_id.xml}` (where \"short_id\" means the last 5 characters of the event id). \n", "\n", "The structure of the event directories can be reorganized to `{year/month/short_id.xml}`. The following code demonstrates the process used in changing the event directory structure.\n", "\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:57.465334Z", "iopub.status.busy": "2025-01-09T18:06:57.464839Z", "iopub.status.idle": "2025-01-09T18:06:57.468141Z", "shell.execute_reply": "2025-01-09T18:06:57.467681Z" } }, "outputs": [], "source": [ "import tempfile\n", "from pathlib import Path\n", "\n", "temp_dir = Path(tempfile.mkdtemp())\n", "\n", "kwargs = dict(\n", " path_structure=\"{year}/{month}\",\n", " name_structure=\"{event_id_short}\",\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2025-01-09T18:06:57.470019Z", "iopub.status.busy": "2025-01-09T18:06:57.469716Z", "iopub.status.idle": "2025-01-09T18:06:58.961601Z", "shell.execute_reply": "2025-01-09T18:06:58.961009Z" } }, "outputs": [ { "data": { "text/plain": [ "EventBank(base_path=/tmp/tmp_9so6waz, index_path=/tmp/tmp_9so6waz/.index.db)" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bank2 = obsplus.EventBank(temp_dir, **kwargs)\n", "bank2.put_events(bank)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Notes\n", "Unlike the [WaveBank](wavebank.pynb), which uses HDF5 to index waveforms, EventBank uses a [SQLite](https://www.sqlite.org/index.html) which is more suitable for frequent updates and [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) usage patterns." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.16" } }, "nbformat": 4, "nbformat_minor": 4 }