From 915bbf3af576d6fc009a2997c1f22dab1c50f8d2 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 14:10:29 +0930 Subject: [PATCH 01/10] yaml update --- notebooks/bfModel/scripts/mergeBack.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notebooks/bfModel/scripts/mergeBack.py b/notebooks/bfModel/scripts/mergeBack.py index addf77e4..6dd811c3 100644 --- a/notebooks/bfModel/scripts/mergeBack.py +++ b/notebooks/bfModel/scripts/mergeBack.py @@ -2,7 +2,7 @@ import os import glob import shutil -import ruamel.yaml as yaml +from ruamel.yaml import YAML def createOutputDir(output=None, makedir=False): @@ -39,8 +39,8 @@ def readOutputs(filename=None): raise IOError("The input file is not found...") # Open YAML file - with open(filename, "r") as finput: - input = yaml.load(finput, Loader=yaml.Loader) + yaml = YAML() + input = yaml.load(finput) tStart, tEnd, tOut, outputDir = inputParser(input) From dc532a0ef285ba588c00f0e87af89b028702d944 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 15:44:34 +0930 Subject: [PATCH 02/10] readOutput yaml --- notebooks/bfModel/scripts/readOutput.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebooks/bfModel/scripts/readOutput.py b/notebooks/bfModel/scripts/readOutput.py index 7ea8549a..46173ea8 100644 --- a/notebooks/bfModel/scripts/readOutput.py +++ b/notebooks/bfModel/scripts/readOutput.py @@ -4,7 +4,7 @@ import meshio import numpy as np from scipy import spatial -import ruamel.yaml as yaml +from ruamel.yaml import YAML class readOutput: @@ -20,7 +20,8 @@ def __init__(self, filename=None, step=None): # Open YAML file with open(filename, "r") as finput: - self.input = yaml.load(finput, Loader=yaml.Loader) + yaml = YAML() + self.input = yaml.load(finput) self.radius = 6378137.0 self._inputParser() From 79dcaaa76e09c133cf95b7c664081f01dfc72722 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 16:48:50 +0930 Subject: [PATCH 03/10] just Plotter --- notebooks/bfModel/bfModel.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/bfModel/bfModel.ipynb b/notebooks/bfModel/bfModel.ipynb index 79fc4ba7..96a748ea 100644 --- a/notebooks/bfModel/bfModel.ipynb +++ b/notebooks/bfModel/bfModel.ipynb @@ -513,7 +513,7 @@ "\n", "contour = mesh.contour([0])\n", "\n", - "plot = pv.PlotterITK()\n", + "plot = pv.Plotter()\n", "plot.add_mesh(mesh, scalars=\"elev\")\n", "plot.add_mesh(contour, color=\"black\", opacity=1.)\n", "plot.show()" From 0f902af9cd80a0298f38516423ba22ae087aa64c Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 18:16:19 +0930 Subject: [PATCH 04/10] getTecto yaml --- notebooks/bfModel/scripts/getTecto.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebooks/bfModel/scripts/getTecto.py b/notebooks/bfModel/scripts/getTecto.py index a4ae6c62..671d8965 100644 --- a/notebooks/bfModel/scripts/getTecto.py +++ b/notebooks/bfModel/scripts/getTecto.py @@ -1,7 +1,7 @@ import glob import h5py import numpy as np -import ruamel.yaml as yaml +from ruamel.yaml import YAML from scipy import spatial @@ -18,7 +18,8 @@ def __init__(self, filename=None): # Open YAML file with open(filename, "r") as finput: - self.input = yaml.load(finput, Loader=yaml.Loader) + yaml = YAML() + self.input = yaml.load(finput) self.radius = 6378137.0 self._inputParser() From 22a2d98561036f91915077ea58d3344437d84170 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 18:27:25 +0930 Subject: [PATCH 05/10] libraries --- notebooks/dualLith/dualLithology.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/dualLith/dualLithology.ipynb b/notebooks/dualLith/dualLithology.ipynb index 28ee339d..9390eae1 100644 --- a/notebooks/dualLith/dualLithology.ipynb +++ b/notebooks/dualLith/dualLithology.ipynb @@ -7,7 +7,7 @@ "# Dual-lithology example\n", "\n", "\n", - "To run the notebook several post and pre-processing librairies are required:\n", + "To run the notebook several post and pre-processing libraries are required:\n", "\n", "- `panel` \n", "- `pyvista` \n", From 044e272147a14efeba14678d1a962aa6eae46401 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 18:28:20 +0930 Subject: [PATCH 06/10] of --- notebooks/dualLith/dualLithology.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/dualLith/dualLithology.ipynb b/notebooks/dualLith/dualLithology.ipynb index 9390eae1..55dd1e07 100644 --- a/notebooks/dualLith/dualLithology.ipynb +++ b/notebooks/dualLith/dualLithology.ipynb @@ -84,7 +84,7 @@ "This function takes 3 arguments:\n", "\n", "* `t` the time interval in Ma of the starting simulation time (here 0 Ma as we start at present day),\n", - "* `d` the folder containing the input conditions. The code assumes that the paleo-elevations are located in the folder **data** under **paleomap** and are `netCDF` files of the form `XXMa.nc` with `XX` the specified time. It also assumes that the displacement maps are located in **velocity** and are off the form `velocity_ XXMa.xy`. Lastly for the paleo-precipitation, the assumed file is under **precipitation** and are `netCDF` files of the form `XXMa.nc` as well.\n", + "* `d` the folder containing the input conditions. The code assumes that the paleo-elevations are located in the folder **data** under **paleomap** and are `netCDF` files of the form `XXMa.nc` with `XX` the specified time. It also assumes that the displacement maps are located in **velocity** and are of the form `velocity_ XXMa.xy`. Lastly for the paleo-precipitation, the assumed file is under **precipitation** and are `netCDF` files of the form `XXMa.nc` as well.\n", "* `s` is the space conditions for the `jigsaw` algorithm and consists of 3 values: the spacing in km for the mesh in the deep ocean (<=-1000 m), the spacing in km across shelf margin (>=-1000 m and < 0m) and the spacing in km in the continental domain. Here, the resolution will vary from 5000 km to 1000 km and 100 km respectively. This is set at pretty low resolution to ensure a quicker runtime. We often use the following values `-s=100,30,15` in our run." ] }, From 2a162fd1fea657c26aac2a884363c8908a6b4aa7 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 18:28:55 +0930 Subject: [PATCH 07/10] vary --- notebooks/dualLith/dualLithology.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/dualLith/dualLithology.ipynb b/notebooks/dualLith/dualLithology.ipynb index 55dd1e07..d36f265c 100644 --- a/notebooks/dualLith/dualLithology.ipynb +++ b/notebooks/dualLith/dualLithology.ipynb @@ -149,7 +149,7 @@ "\n", "In addition, to the layer thicknesses and compositions, `gospl` requires the porosity of each sediment type present in a given layer to be specified.\n", "\n", - "Here we follow the approach presented in the [technical guide](https://gospl.readthedocs.io/en/latest/tech_guide/strat.html#porosity-and-compaction) of the documentation, and the porosity is considered to varies with depth z.\n", + "Here we follow the approach presented in the [technical guide](https://gospl.readthedocs.io/en/latest/tech_guide/strat.html#porosity-and-compaction) of the documentation, and the porosity is considered to vary with depth z.\n", "\n", "$$\\phi(z) = \\phi_0 e^{−z/z_0}$$" ] From b4b74bff1c255c113f17157a0e78ae505dd954f8 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 19:01:41 +0930 Subject: [PATCH 08/10] Plotter instance --- notebooks/bfModel/bfModel.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/bfModel/bfModel.ipynb b/notebooks/bfModel/bfModel.ipynb index 96a748ea..5a2bcad5 100644 --- a/notebooks/bfModel/bfModel.ipynb +++ b/notebooks/bfModel/bfModel.ipynb @@ -589,7 +589,7 @@ "mesh.points[:, 1] *= factor\n", "mesh.points[:, 2] *= factor\n", "contour = mesh.contour([0])\n", - "plot = pv.PlotterITK()\n", + "plot = pv.Plotter()\n", "plot.add_mesh(mesh, scalars=\"vTec\")\n", "plot.add_mesh(contour, color=\"black\", opacity=1.)\n", "plot.show()" From 98e1514fd8492538394ac82fe4020156e74eed44 Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 19:17:34 +0930 Subject: [PATCH 09/10] vTec active scalars --- notebooks/bfModel/bfModel.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notebooks/bfModel/bfModel.ipynb b/notebooks/bfModel/bfModel.ipynb index 5a2bcad5..f62557fc 100644 --- a/notebooks/bfModel/bfModel.ipynb +++ b/notebooks/bfModel/bfModel.ipynb @@ -582,6 +582,8 @@ "\n", "# Plot the tectonic vertical forcing by loading the created VTK file \n", "mesh = pv.read(checkvtk)\n", + "mesh.set_active_scalars(name='vTec')\n", + "\n", "elev = mesh.get_array(name='Z')\n", "scale = 20.\n", "factor = 1.+ (elev/radius)*scale\n", From b46820dd9d7b2baa96bba5a1a0517c65574c350a Mon Sep 17 00:00:00 2001 From: RichardScottOZ Date: Thu, 20 Jun 2024 19:18:45 +0930 Subject: [PATCH 10/10] pick an active scalar so this runs --- notebooks/bfModel/bfModel.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notebooks/bfModel/bfModel.ipynb b/notebooks/bfModel/bfModel.ipynb index f62557fc..6cf84df2 100644 --- a/notebooks/bfModel/bfModel.ipynb +++ b/notebooks/bfModel/bfModel.ipynb @@ -503,6 +503,8 @@ "mesh = pv.read('step15.vtk')\n", "elev = mesh.get_array(name='elev')\n", "\n", + "mesh.set_active_scalars(name='erodep')\n", + "\n", "earthRadius = 6.371e6\n", "scale = 20.\n", "factor = 1.+ (elev/earthRadius)*scale\n",