Skip to content

Commit

Permalink
Merge pull request #5 from EarthScope/test-nb
Browse files Browse the repository at this point in the history
update library to latest
  • Loading branch information
mikegottlieb84 authored Feb 21, 2024
2 parents 4660e81 + 169060f commit aba9f9b
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ghcr.io/earthscope/strain-scipy-notebook
WORKDIR /home/jovyan/
LABEL authors = "Mike Gottlieb, Earthscope Inc. [email protected]"

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
Expand Down
1 change: 1 addition & 0 deletions build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Expand Down
106 changes: 106 additions & 0 deletions notebooks/earthscopestraintools-access.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
92 changes: 92 additions & 0 deletions notebooks/obspy-access.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*
Expand Down

0 comments on commit aba9f9b

Please sign in to comment.