From 572300d5afe2a32b2433b430c99e13093d241718 Mon Sep 17 00:00:00 2001 From: JP Date: Thu, 26 Sep 2024 12:16:29 -0700 Subject: [PATCH] renamed notebook --- ...plotting.ipynb => 02_mt_data_basics.ipynb} | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) rename notebooks/mtpy/{02_plotting.ipynb => 02_mt_data_basics.ipynb} (98%) diff --git a/notebooks/mtpy/02_plotting.ipynb b/notebooks/mtpy/02_mt_data_basics.ipynb similarity index 98% rename from notebooks/mtpy/02_plotting.ipynb rename to notebooks/mtpy/02_mt_data_basics.ipynb index 49763aa..fff708a 100644 --- a/notebooks/mtpy/02_plotting.ipynb +++ b/notebooks/mtpy/02_mt_data_basics.ipynb @@ -7,9 +7,21 @@ "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. " ] }, { @@ -17,16 +29,7 @@ "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", @@ -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\"))" ] }, { @@ -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", @@ -2478,7 +2501,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "6c4b252a-23d3-41da-8613-97f3dcd200f3", "metadata": {}, "outputs": [ @@ -2486,21 +2509,13 @@ "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": { @@ -2519,7 +2534,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.19" + "version": "3.9.18" } }, "nbformat": 4,