Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml update for mergeBack iin bfModel #273

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions notebooks/bfModel/bfModel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -513,7 +515,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()"
Expand Down Expand Up @@ -582,14 +584,16 @@
"\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",
"mesh.points[:, 0] *= factor\n",
"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()"
Expand Down
5 changes: 3 additions & 2 deletions notebooks/bfModel/scripts/getTecto.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions notebooks/bfModel/scripts/mergeBack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions notebooks/bfModel/scripts/readOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions notebooks/dualLith/dualLithology.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."
]
},
Expand Down Expand Up @@ -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}$$"
]
Expand Down