Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mt-course into 2024
  • Loading branch information
sgkang committed Oct 21, 2024
2 parents dd0497d + 6b4dc88 commit 45a3cda
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 30 deletions.
45 changes: 45 additions & 0 deletions data/transfer_functions/bs_eight_level.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
44
1 10 12
1 8 9
1 6 7
1 5 5
2 9 10
2 7 8
2 6 6
2 5 5
3 14 17
3 11 13
3 9 10
3 7 8
3 6 6
3 5 5
4 18 22
4 14 17
4 10 13
4 7 9
4 5 6
5 18 22
5 14 17
5 10 13
5 7 9
5 5 6
6 18 22
6 14 17
6 10 13
6 7 9
6 5 6
7 18 22
7 14 17
7 10 13
7 7 9
7 5 6
8 18 22
8 14 17
8 10 13
8 7 9
8 5 6
9 18 22
9 14 17
9 10 13
9 7 9
9 5 6
4 changes: 2 additions & 2 deletions notebooks/aurora/05_process_yellowstone.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"id": "85e4ce8b-e5b7-4e86-b691-92cc872272b2",
"metadata": {},
"source": [
"The mth5 file is created via the example in notebooks/mth5\n",
"The mth5 file is created via the example in `notebooks/mth5/05_make_mth5_from_iris_v0.2.0.ipynb`\n",
"\n",
"For now you can manually move the data here and then\n",
"mth5_path = Path(EM_WYYS2_MTF20_WYYS3_MTC20.h5\")\n",
Expand Down Expand Up @@ -6250,7 +6250,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down
8 changes: 8 additions & 0 deletions notebooks/aurora/06_yellowstone_1024Hz.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b8c4094b-becf-4fdc-b977-e5f5ae25f29b",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\"> <b>NOTE</b> The data for this notebook are not part of the 2024 short-coure curriculum. </div>"
]
},
{
"cell_type": "markdown",
"id": "869f5078-32de-4e58-aa77-181664514481",
Expand Down
49 changes: 41 additions & 8 deletions notebooks/aurora/07_lemi_magdelena.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
"\n",
"There is also a prototype LEMI data creation notebook in\n",
"\n",
"`mth5/docs/examples/notebooks/lemi_reader_magdelena_2.ipynb`"
"`mth5/docs/examples/notebooks/lemi_reader_magdelena_2.ipynb`\n",
"\n",
"and in the shortcourse :\n",
"\n",
"`notebooks/mth5/06_make_mth5_from_lemi.ipynb`\n",
"`notebooks/mth5/06a_make_mth5_from_lemi.ipynb`\n",
"\n",
"This notebook is set up to use the output from `notebooks/mth5/06_make_mth5_from_lemi.ipynb` (not 6a)."
]
},
{
Expand All @@ -26,6 +33,7 @@
"import numpy as np\n",
"from pathlib import Path\n",
"import pandas as pd\n",
"import shutil\n",
"import warnings\n",
"\n",
"from mth5.clients.make_mth5 import MakeMTH5\n",
Expand All @@ -48,6 +56,18 @@
"## Set up the path to the file"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "57a8a24e-2718-46f5-84f2-f3eb70f35e8e",
"metadata": {},
"outputs": [],
"source": [
"here = Path(\".\").absolute()\n",
"mth5_path = here.parent.joinpath(\"mth5\", \"from_lemi_02.h5\")\n",
"assert(mth5_path.exists())"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand All @@ -66,11 +86,24 @@
}
],
"source": [
"here = Path(\".\").absolute()\n",
"data_dir = here.parent.parent.joinpath(\"data/time_series/lemi\")\n",
"mth5_path = data_dir.joinpath(\"from_lemi.h5\")\n",
"# Sample code for moving files from shared drive\n",
"\n",
"# file_base = \"from_lemi.h5\"\n",
"# source_folder = Path().home().joinpath(\"shared\", \"shortcourses\", \"mt\", \"lemi\")\n",
"# source_file = source_folder.joinpath(file_base)\n",
"# assert(source_file.exists())\n",
"\n",
"# here = Path(\".\").absolute()\n",
"# target_folder = here.parent.parent.joinpath(\"data\", \"timeseries\", \"lemi\")\n",
"# target_folder.mkdir(exist_ok=True, parents=True)\n",
"# destination_file = target_folder.joinpath(file_base)\n",
"\n",
"# shutil.copyfile(source_file, destination_file)\n",
"\n",
"# mth5_path = destination_file\n",
"\n",
"\n",
"mth5_path.exists()"
"#mth5_path.exists()"
]
},
{
Expand Down Expand Up @@ -2950,9 +2983,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "penultimate_2024",
"display_name": "pypi",
"language": "python",
"name": "penultimate_2024"
"name": "pypi"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -2964,7 +2997,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.15"
"version": "3.9.20"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion notebooks/mth5/05_make_mth5_from_iris_v0.2.0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,7 @@
}
],
"source": [
"ex = mth5_object.from_reference(ch_df.iloc[-6].hdf5_reference).to_channel_ts()\n",
"ex = mth5_object.from_reference(ch_df.iloc[50].hdf5_reference).to_channel_ts()\n",
"print(ex)"
]
},
Expand Down
6 changes: 3 additions & 3 deletions notebooks/mth5/06_make_mth5_from_lemi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}
],
"source": [
"lemi_path = Path().cwd().parent.parent.parent.joinpath(\"shared\", \"shortcourses\", \"mt\", \"lemi\")\n",
"lemi_path = Path().home().joinpath(\"shared\", \"shortcourses\", \"mt\", \"lemi\")\n",
"print(lemi_path)"
]
},
Expand Down Expand Up @@ -2195,9 +2195,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "penultimate_2024",
"language": "python",
"name": "python3"
"name": "penultimate_2024"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 1 addition & 1 deletion notebooks/mth5/06a_make_mth5_from_lemi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"metadata": {},
"outputs": [],
"source": [
"lemi_path = Path().cwd().parent.parent.parent.joinpath(\"shared\", \"shortcourses\", \"mt\", \"lemi\")\n"
"lemi_path = Path().home().joinpath(\"shared\", \"shortcourses\", \"mt\", \"lemi\")\n"
]
},
{
Expand Down
27 changes: 20 additions & 7 deletions notebooks/mth5/07a_make_mth5_from_phoenix_from_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,25 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "6348263b-79f2-4bae-9981-cf4268d7a48b",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Source directory: /home/kkappler/shared/shortcourses/mt/phoenix\n",
"Target directory: /home/kkappler/software/irismt/earthscope-mt-course/data/timeseries/phoenix\n"
]
}
],
"source": [
"data_dir = Path().cwd().parent.parent.parent.joinpath(\"shared\", \"shortcourses\", \"mt\", \"phoenix\")"
"source_dir = Path.home().joinpath(\"shared\", \"shortcourses\", \"mt\", \"phoenix\")\n",
"target_dir = Path().cwd().parent.parent.joinpath(\"data\", \"timeseries\", \"phoenix\")\n",
"target_dir.mkdir(parents=True, exist_ok=True)\n",
"print(f\"Source directory: {source_dir}\")\n",
"print(f\"Target directory: {target_dir.absolute()}\")\n"
]
},
{
Expand Down Expand Up @@ -105,11 +118,11 @@
],
"source": [
"local_station = \"9043\"\n",
"local_station_dir = data_dir.joinpath(local_station)\n",
"local_station_dir = source_dir.joinpath(local_station)\n",
"\n",
"phx_mth5_fn = MakeMTH5.from_phoenix(\n",
" local_station_dir,\n",
" save_path=Path.cwd(),\n",
" save_path=target_dir,\n",
" mth5_filename=f\"from_phoenix_{local_station}.h5\",\n",
" sample_rates=[150, 24000],\n",
" receiver_calibration_dict=Path(local_station_dir.joinpath(\"calibrations\")),\n",
Expand Down Expand Up @@ -144,11 +157,11 @@
],
"source": [
"remote_station = \"remote\"\n",
"remote_station_dir = data_dir.joinpath(remote_station)\n",
"remote_station_dir = source_dir.joinpath(remote_station)\n",
"\n",
"phx_mth5_fn = MakeMTH5.from_phoenix(\n",
" remote_station_dir,\n",
" save_path=Path.cwd(),\n",
" save_path=target_dir,\n",
" mth5_filename=f\"from_phoenix_{remote_station}.h5\",\n",
" sample_rates=[150, 24000],\n",
" receiver_calibration_dict=Path(remote_station_dir.joinpath(\"calibrations\")),\n",
Expand Down
23 changes: 15 additions & 8 deletions notebooks/mtpy/12_aurora_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
"metadata": {},
"outputs": [],
"source": [
"survey_dir = Path(r\"c:\\\\Users\\\\jpeacock\\\\OneDrive - DOI\\\\mt\\\\mt_short_course\\\\data\\\\phx\")\n",
"edi_path = survey_dir.joinpath(\"EDI_Files_aurora\")\n",
"band_file = r\"c:\\\\Users\\\\jpeacock\\\\OneDrive - DOI\\\\MTData\\\\bandset.cfg\"\n",
"# survey_dir = Path(r\"c:\\\\Users\\\\jpeacock\\\\OneDrive - DOI\\\\mt\\\\mt_short_course\\\\data\\\\phx\")\n",
"survey_dir = Path().cwd().parent.parent.joinpath(\"data\", \"timeseries\", \"phoenix\")\n",
"\n",
"edi_path = survey_dir.joinpath(\"EDI_Files_aurora\")\n",
"edi_path.mkdir(exist_ok=True)\n",
"\n",
"# band_file = r\"c:\\\\Users\\\\jpeacock\\\\OneDrive - DOI\\\\MTData\\\\bandset.cfg\"\n",
"band_file = Path().cwd().parent.joinpath(\"aurora\", \"bs_256_29.cfg\")\n",
"\n",
"# Or try the alternative band file\n",
"band_file = Path().cwd().parent.parent.joinpath(\"data\", \"transfer_functions\", \"bs_eight_level.cfg\")\n",
"\n",
"# this is how the different transfer functions will be merged.\n",
"merge_dict = {\n",
Expand All @@ -62,8 +67,10 @@
"source": [
"ap = AuroraProcessing(merge_dictionary=merge_dict)\n",
"\n",
"ap.local_mth5_path = Path(r\"c:\\Users\\jpeacock\\OneDrive - DOI\\mt\\mt_short_course\\data\\phx\\9043\\phx_9043.h5\")\n",
"ap.remote_mth5_path = Path(r\"c:\\Users\\jpeacock\\OneDrive - DOI\\mt\\mt_short_course\\data\\phx\\remote\\remote_02.h5\")\n",
"# ap.local_mth5_path = Path(r\"c:\\Users\\jpeacock\\OneDrive - DOI\\mt\\mt_short_course\\data\\phx\\9043\\phx_9043.h5\")\n",
"# ap.remote_mth5_path = Path(r\"c:\\Users\\jpeacock\\OneDrive - DOI\\mt\\mt_short_course\\data\\phx\\remote\\remote_02.h5\")\n",
"ap.local_mth5_path = survey_dir.joinpath(\"from_phoenix_9043.h5\")\n",
"ap.remote_mth5_path = survey_dir.joinpath(\"from_phoenix_remote.h5\")\n",
"\n",
"ap.local_station_id = \"9043\"\n",
"ap.remote_station_id = \"1003\"\n",
Expand Down Expand Up @@ -1407,7 +1414,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "py39",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1421,9 +1428,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit 45a3cda

Please sign in to comment.