Skip to content

Commit

Permalink
renamed notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
kujaku11 committed Sep 26, 2024
1 parent b3dac60 commit 572300d
Showing 1 changed file with 39 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@
"source": [
"# MTpy Example 02\n",
"\n",
"## Plot Basics\n",
"## Data Querying\n",
"\n",
"Now that we have an `MTCollection` stored in an `MTH5` we can now plot interesting things. All the plotting functions can be called directly from the `MTCollection` object. "
"Now that we have an `MTCollection` stored in an `MTH5` we can now work with the collection of transfer functions. We can query the data for transfer functions with the same survey name, or set a bounding box to get all transfer functions in a given area, etc. You can query the Pandas Dataframe provided by `MTCollection`.\n",
"\n",
"`MTCollection` provides a few dataframes to use. \n",
"\n",
" - `master_dataframe` which never changes and contains all the transfer functions in the file.\n",
" - `working_dataframe` which is the dataframe that contains only the stations you have queried for from the `master_dataframe`. By default it is initially equal to the `master_dataframe`.\n",
" - `dataframe` is an alias for working dataframe. \n",
"\n",
"### MTCollection vs MTData\n",
"\n",
"`MTCollection` is meant to be the archive and database where the transfer functions are stored. This object is stored in memory.\n",
"\n",
"`MTData` is meant to be the working object for analyzing, plotting, and creating input files for modeling. If you want to store the manipulated transfer functions you can put into the `MTCollection`. This object is stored in RAM. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "1ea2092d-0d64-473f-9a56-cbd85da0d246",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/kkappler/software/irismt/mtpy-v2/mtpy/modeling/simpeg/recipes/inversion_2d.py:39: UserWarning: Pardiso not installed see https://github.com/simpeg/pydiso/blob/main/README.md.\n",
" warnings.warn(\n"
]
}
],
"outputs": [],
"source": [
"from pathlib import Path\n",
"from mtpy import MTCollection\n",
Expand All @@ -51,7 +54,7 @@
"outputs": [],
"source": [
"mc = MTCollection()\n",
"mc.open_collection(Path().cwd().parent.parent.joinpath(\"data\", \"transfer_functions\", \"yellowstone_mt_collection.h5\"))"
"mc.open_collection(Path().cwd().parent.parent.joinpath(\"data\", \"transfer_functions\", \"yellowstone_mt_collection_02.h5\"))"
]
},
{
Expand Down Expand Up @@ -2466,6 +2469,26 @@
"mc.dataframe"
]
},
{
"cell_type": "markdown",
"id": "8ae412c9",
"metadata": {},
"source": [
"## MTData Object\n",
"\n",
"Now that we have queried the data to just the stations we want, lets convert those stations to a `MTData` object so we can plot and analyze the data. In the next series of notebooks we will demonstrate how to plot and analyze the data from the `MTData` object."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "08329643",
"metadata": {},
"outputs": [],
"source": [
"mt_data = mc.to_mt_data()"
]
},
{
"cell_type": "markdown",
"id": "c9214e8a-cf8e-481f-8e1e-5f59530b6d06",
Expand All @@ -2478,29 +2501,21 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "6c4b252a-23d3-41da-8613-97f3dcd200f3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1m24:09:21T13:15:09 | INFO | line:771 |mth5.mth5 | close_mth5 | Flushing and closing /home/kkappler/software/irismt/earthscope-mt-course/data/transfer_functions/yellowstone_mt_collection.h5\u001b[0m\n"
"\u001b[1m24:09:26T12:14:22 | INFO | line:777 |mth5.mth5 | close_mth5 | Flushing and closing c:\\Users\\jpeacock\\OneDrive - DOI\\Documents\\GitHub\\iris-mt-course-2022\\data\\transfer_functions\\yellowstone_mt_collection_02.h5\u001b[0m\n"
]
}
],
"source": [
"mc.close_collection()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e797a51f-4d83-4b25-8451-5c620c380d35",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -2519,7 +2534,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 572300d

Please sign in to comment.