Package: miller-alaskamoho-srl2018
Miller & Moresi - Alaska Moho Model with NotebooksPreferred model, gradient and a comparison to heat flow data. The maps were
produced using thecartopypackage. Instructions for reproducing these
maps are in the notebooks supplied with this packageThis package is a self-consistent packaging of the Miller & Moresi Alaska Moho model.
There are many ways to access this package.It containsThis informationScripts to install documentation and examplesJupyter notebooks for manipulating the dataJupyter notebooks for recreating our workA demo is available onmybinder.org- open the notebookA0-Index.ipynbto begin. The 'current' version with any updates / errata is here:This is exactly the published version (1.0), warts and all.Site MapThe jupyter notebooks provided as examples are given belowA1: Raw data, convert and saveA2: Raw data - plot quality informationA3: Triangulating and interpolating raw dataA4: Plotting moho and moho slopeA5: Interactive 3D plotA6: Convert Models to Regular XYZ gridThere are further notebooks that allow you to reproduce our work in creating the
prefered model and these can be browsed in theModelConstructiondirectoryWe constructed our model by fitting surfaces to the observed points and recording the capacity
of the model to predict information at points not included in the model construction. The
quality of the model at each point was given an integer score and this was used to weight information
in the final fitting processInstallationThe package can be installed standalone usingpipor it can be run through docker without needing specific installation.These notebooks can be viewed with jupyter but will only run if all the software dependencies have
been installed (seeInstallation throughpipbelow.In nearly every instance we recommend using the (self-contained) docker version.
We have provided some usefulbashshortcuts that make the docker commands
easier to remember (seeInstallation through dockerbelow).Installation through dockerFirst it is necessary to install the freedocker, community editionfrom thedocker storefor your platform.# Download the image with the scripts and datadockerpulllmoresi/docker-miller-moho:latestThat's it !To test the installation, try the followingCommand line docker examplesThis help message# print help message (i.e. usage)dockerrun--rmlmoresi/docker-miller-moho:latesthelpInstall the bash helpers in the current directory# print help message (i.e. usage)dockerrun--rmlmoresi/docker-miller-moho:latestbash_utils>msmoho_bash_utils.shsourcemsmoho_bash_utils.shInstall the documentation / scripts and notebooks in the current directory# print help message (i.e. usage)sourcemsmoho_bash_utils.sh
msmoho-docker-shinstall_examplesRun a local python script# run  my_script.py with python in the docker containersourcemsmoho_bash_utils.sh
msmoho-docker-shmy_script.pyInstallation through pip (or conda)The installation of the python package is straightforward but
there is a dependency on numpy and on stripy which may require
an installed fortran compiler. If this proves problematic, the
docker version may simply be the best choice.#! /bin/env bash# install the main package# stripy and numpy are installed as dependencies by pip# but we can do this explicitly to manage versions and# check for errorspipinstallnumpypipinstallstripy# stripy and numpy# as they embed fortran and C packages# miller_alaskamoho_srl2018 itself is pure pythonpipinstallmiller_alaskamoho_srl2018The following script tests the installation:#! /bin/env pythonimportnumpyasnptry:importmiller_alaskamoho_srl2018asalaskamohoexceptImportError:print("Problem importing the alaska moho package")# Check the data files exist / can be read# [('lon', '<f8'), ('lat', '<f8'), ('moh', '<f8') ... etc# [-174.197495 -171.703506 -170.247696 -168.854996 -168.161896]# [43.61043017 34.75098075 37.34819411]mohoraw=alaskamoho.MohoErrprint(mohoraw.dtype)print(mohoraw['lon'][0:5])print(mohoraw['moh'][0:5])# Check to see if the interpolator works# [43.61043017 34.75098075 37.34819411]moho_model=alaskamoho.MohoModel_optlons=np.array([-150,-155,-160])lats=np.array([60,65,70])print(moho_model.value_at_lonlat_degrees(lons,lats,order=1))# install documentation in user-specified location# Should install in the current directory as AlaskaMohoExamplesalaskamoho.documentation.install_documentation(path=None)If you install the documentation in the form of jupyter notebooks, then to view them,
you also need to install some dependencies. Specifically:# The jupyter notebook system (and dependencies)pipinstalljupyter# scipy is used in some examplespipinstallscipy# cartopy is used to plot examples# (may be necessary to install the shapely package first)pipinstall--no-binary:all:shapelypipinstallcartopy# We need litho1pt0 to re-build the model filespipinstalllitho1pt0# We use lavavu for the interactive visualisation of the surfacespipinstalllavavu# pip install gdal is optional: it is used for shaded relief images of the# maps and also requires a download of the relevant image file.pipinstallgdalIf you only wish to browse the documentation / examples or see how we built the model, why not use the docker version !