diff --git a/Dockerfile b/Dockerfile index 5a9a779..801f27b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ghcr.io/earthscope/strain-scipy-notebook WORKDIR /home/jovyan/ LABEL authors = "Mike Gottlieb, Earthscope Inc. mike.gottlieb@earthscope.org" -RUN pip install 'earthscopestraintools[mseed,tiledb]'==0.1.19 +RUN pip install 'earthscopestraintools[mseed,tiledb]'==0.1.34 RUN mkdir examples/ COPY notebooks/level2.ipynb examples/level2.ipynb diff --git a/build_docker.sh b/build_docker.sh index faa2b83..81a832a 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -28,6 +28,7 @@ docker run \ -it \ -p 8888:8888 \ --name='strain-processing-notebooks-container' \ + -v ${PWD}/notebooks:/home/jovyan/notebooks \ ghcr.io/earthscope/strain-processing-notebooks #-v ${PWD}/notebooks:/home/jovyan/notebooks \ diff --git a/notebooks/earthscopestraintools-access.ipynb b/notebooks/earthscopestraintools-access.ipynb new file mode 100644 index 0000000..ff76928 --- /dev/null +++ b/notebooks/earthscopestraintools-access.ipynb @@ -0,0 +1,106 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from earthscopestraintools.mseed_tools import ts_from_mseed\n", + "from earthscopestraintools.gtsm_metadata import GtsmMetadata\n", + "\n", + "import logging\n", + "logger = logging.getLogger()\n", + "logging.basicConfig(\n", + " format=\"%(message)s\", level=logging.INFO\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "network = \n", + "station = \n", + "location = \n", + "channel = \n", + "start=\"2023-11-01T00:00:00\"\n", + "end = \"2023-11-08T00:00:00\"\n", + "\n", + "meta = GtsmMetadata(network,station)\n", + "meta.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "strain_raw = ts_from_mseed(network=network, \n", + " station=station, \n", + " location=location, \n", + " channel=channel,\n", + " start=start, \n", + " end=end)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "strain_raw.stats()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "strain_raw.data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "strain_raw.plot()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/notebooks/obspy-access.ipynb b/notebooks/obspy-access.ipynb new file mode 100644 index 0000000..76e3199 --- /dev/null +++ b/notebooks/obspy-access.ipynb @@ -0,0 +1,92 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from obspy.clients.fdsn import Client\n", + "from obspy import UTCDateTime\n", + "\n", + "client = Client(\"IRIS\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "network = \n", + "station = \n", + "location = \n", + "channel = \n", + "start = UTCDateTime(\"2023-11-01T00:00:00\")\n", + "end = UTCDateTime(\"2023-11-08T00:00:00\")\n", + "st = client.get_waveforms(network=network,\n", + " station=station, \n", + " location=location,\n", + " channel=channel,\n", + " starttime=start,\n", + " endtime=end)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "st" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for tr in st:\n", + " print(tr.data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result = st.plot()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/run_docker.sh b/run_docker.sh index 66f0545..23b426e 100755 --- a/run_docker.sh +++ b/run_docker.sh @@ -17,7 +17,7 @@ docker run \ -it \ -p 8888:8888 \ --name='strain-processing-notebooks' \ - -v ${PWD}/notebooks:/home/jovyan/notebooks \ + -v ${PWD}/notebooks:/home/jovyan/notebooks \ ghcr.io/earthscope/strain-processing-notebooks echo *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*