Skip to content

Commit a6a0bd5

Browse files
committed
Fix style errors
1 parent 56a8d31 commit a6a0bd5

File tree

6 files changed

+6
-106
lines changed

6 files changed

+6
-106
lines changed

notebooks/03-gravity/fwd_gravity_anomaly_3d.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@
8989
"import numpy as np\n",
9090
"from scipy.interpolate import LinearNDInterpolator\n",
9191
"import matplotlib as mpl\n",
92-
"\n",
93-
"mpl.rcParams.update({\"font.size\": 14})\n",
9492
"import matplotlib.pyplot as plt\n",
9593
"import os\n",
9694
"\n",
95+
"mpl.rcParams.update({\"font.size\": 14})\n",
96+
"\n",
9797
"save_output = False # Optional"
9898
]
9999
},

notebooks/03-gravity/fwd_gravity_gradiometry_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
"import numpy as np\n",
9393
"from scipy.interpolate import LinearNDInterpolator\n",
9494
"import matplotlib as mpl\n",
95+
"import matplotlib.pyplot as plt\n",
9596
"\n",
9697
"mpl.rcParams.update({\"font.size\": 14})\n",
97-
"import matplotlib.pyplot as plt\n",
9898
"\n",
9999
"save_output = False # Optional"
100100
]

notebooks/04-magnetics/fwd_magnetics_induced_3d.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@
9090
"import numpy as np\n",
9191
"from scipy.interpolate import LinearNDInterpolator\n",
9292
"import matplotlib as mpl\n",
93-
"\n",
94-
"mpl.rcParams.update({\"font.size\": 14})\n",
9593
"import matplotlib.pyplot as plt\n",
9694
"import os\n",
9795
"\n",
96+
"mpl.rcParams.update({\"font.size\": 14})\n",
97+
"\n",
9898
"save_output = False # Optional"
9999
]
100100
},

notebooks/04-magnetics/fwd_magnetics_mvi_3d.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
"from scipy.interpolate import LinearNDInterpolator\n",
9393
"from scipy.constants import mu_0\n",
9494
"import matplotlib as mpl\n",
95+
"import matplotlib.pyplot as plt\n",
9596
"\n",
9697
"mpl.rcParams.update({\"font.size\": 14})\n",
97-
"import matplotlib.pyplot as plt\n",
9898
"\n",
9999
"save_output = False # Optional"
100100
]

notebooks/07-fdem/fwd_fdem_3d.ipynb

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -843,56 +843,6 @@
843843
"\n",
844844
"plt.show()"
845845
]
846-
},
847-
{
848-
"cell_type": "markdown",
849-
"metadata": {},
850-
"source": [
851-
"## Optional: Export Data\n",
852-
"\n",
853-
"Write the true model, data and topography\n",
854-
"\n",
855-
"\n"
856-
]
857-
},
858-
{
859-
"cell_type": "code",
860-
"execution_count": 21,
861-
"metadata": {
862-
"execution": {
863-
"iopub.execute_input": "2025-05-23T17:19:25.643898Z",
864-
"iopub.status.busy": "2025-05-23T17:19:25.643584Z",
865-
"iopub.status.idle": "2025-05-23T17:19:25.648762Z",
866-
"shell.execute_reply": "2025-05-23T17:19:25.648248Z"
867-
}
868-
},
869-
"outputs": [],
870-
"source": [
871-
"if save_file:\n",
872-
" dir_path = os.path.dirname(fdem.__file__).split(os.path.sep)[:-3]\n",
873-
" dir_path.extend([\"tutorials\", \"assets\", \"fdem\"])\n",
874-
" dir_path = os.path.sep.join(dir_path) + os.path.sep\n",
875-
"\n",
876-
" # Write topography\n",
877-
" fname = dir_path + \"fdem_topo.txt\"\n",
878-
" np.savetxt(fname, np.c_[topo_xyz], fmt=\"%.4e\")\n",
879-
"\n",
880-
" # Write data with 2% noise added\n",
881-
" fname = dir_path + \"fdem_data.obs\"\n",
882-
" bz_real = bz_real + 1e-14 * np.random.rand(len(bz_real))\n",
883-
" bz_imag = bz_imag + 1e-14 * np.random.rand(len(bz_imag))\n",
884-
" f_vec = np.kron(frequencies, np.ones(ntx))\n",
885-
" receiver_locations = np.kron(np.ones((len(frequencies), 1)), receiver_locations)\n",
886-
"\n",
887-
" np.savetxt(fname, np.c_[f_vec, receiver_locations, bz_real, bz_imag], fmt=\"%.4e\")\n",
888-
"\n",
889-
" # Plot true model\n",
890-
" output_model = plotting_map * model\n",
891-
" output_model[np.isnan(output_model)] = 1e-8\n",
892-
"\n",
893-
" fname = dir_path + \"true_model.txt\"\n",
894-
" np.savetxt(fname, output_model, fmt=\"%.4e\")"
895-
]
896846
}
897847
],
898848
"metadata": {

notebooks/08-tdem/fwd_tdem_3d.ipynb

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -913,56 +913,6 @@
913913
"\n",
914914
"plt.show()"
915915
]
916-
},
917-
{
918-
"cell_type": "markdown",
919-
"metadata": {},
920-
"source": [
921-
"## Optional: Export Data\n",
922-
"\n",
923-
"Write the true model, data and topography\n",
924-
"\n",
925-
"\n"
926-
]
927-
},
928-
{
929-
"cell_type": "code",
930-
"execution_count": 23,
931-
"metadata": {
932-
"execution": {
933-
"iopub.execute_input": "2025-05-23T17:54:48.125857Z",
934-
"iopub.status.busy": "2025-05-23T17:54:48.125627Z",
935-
"iopub.status.idle": "2025-05-23T17:54:48.132415Z",
936-
"shell.execute_reply": "2025-05-23T17:54:48.131374Z"
937-
}
938-
},
939-
"outputs": [],
940-
"source": [
941-
"if save_file:\n",
942-
" dir_path = os.path.dirname(tdem.__file__).split(os.path.sep)[:-3]\n",
943-
" dir_path.extend([\"tutorials\", \"assets\", \"tdem\"])\n",
944-
" dir_path = os.path.sep.join(dir_path) + os.path.sep\n",
945-
"\n",
946-
" fname = dir_path + \"tdem_topo.txt\"\n",
947-
" np.savetxt(fname, np.c_[topo_xyz], fmt=\"%.4e\")\n",
948-
"\n",
949-
" # Write data with 2% noise added\n",
950-
" fname = dir_path + \"tdem_data.obs\"\n",
951-
" rng = np.random.default_rng(seed=42)\n",
952-
" noise = rng.uniform(low=0.0, high=0.02 * np.abs(dpred), size=len(dpred))\n",
953-
" dpred += noise\n",
954-
" t_vec = np.kron(np.ones(ntx), time_channels)\n",
955-
" receiver_locations = np.kron(receiver_locations, np.ones((len(time_channels), 1)))\n",
956-
"\n",
957-
" np.savetxt(fname, np.c_[receiver_locations, t_vec, dpred], fmt=\"%.4e\")\n",
958-
"\n",
959-
" # Plot true model\n",
960-
" output_model = plotting_map * model\n",
961-
" output_model[np.isnan(output_model)] = 1e-8\n",
962-
"\n",
963-
" fname = dir_path + \"true_model.txt\"\n",
964-
" np.savetxt(fname, output_model, fmt=\"%.4e\")"
965-
]
966916
}
967917
],
968918
"metadata": {

0 commit comments

Comments
 (0)