python接口到miller srl 2018阿拉斯加moho模型-需要stripy,numpy
miller_alaskamoho_srl2018的Python项目详细描述
Miller&Moresi-带笔记本的阿拉斯加Moho型号
首选模型、梯度和与热流数据的比较。地图是
使用 此包装是Miller&Moresi Alaska Moho型号的自洽包装。
有很多方法可以访问这个包。 它包含 在mybinder.org上提供演示-打开笔记本 这正是发布的版本(1.0),疣和所有。 作为示例提供的jupyter笔记本如下所示 还有更多的笔记本可以让您复制我们在创建
首选模型,可以在 我们通过将曲面拟合到观测点并记录容量来构建我们的模型
在模型构造中不包括的点上预测信息。这个
模型的质量在每一点上都给出了一个整数分数,用来加权信息
在最终装配过程中
可以使用 这些笔记本可以用jupyter查看,但只有在所有软件依赖项都有
已安装(请参见下面的Installation through ^{ 在几乎所有情况下,我们都建议使用(自包含的)docker版本。
我们提供了一些有用的 首先,必须从docker store为您的平台安装免费的docker,community edition。 就这样! 要测试安装,请尝试以下操作 此帮助信息 在当前目录中安装bash帮助程序 在当前目录中安装文档/脚本和笔记本 运行本地python脚本 python包的安装很简单,但是
可能需要依赖于numpy和stripy
已安装的Fortran编译器。如果这证明有问题,
Docker版本可能是最好的选择。 以下脚本测试安装: 如果您以jupyter笔记本的形式安装文档,那么要查看它们,
您还需要安装一些依赖项。具体来说: 如果你只想浏览文档/示例或者看看我们是如何构建模型的,为什么不使用docker版本呢!cartopy
包生成。复制说明
此软件包附带的笔记本中有地图
A0-Index.ipynb
开始。有任何更新/勘误表的“当前”版本如下:站点地图
ModelConstruction
目录中浏览这些模型
安装
pip
独立安装包。
也可以通过Docker运行,无需具体安装。bash
快捷方式,使docker命令
更容易记住(见下面的Installation through docker)。通过Docker安装
# Download the image with the scripts and data
docker pull lmoresi/docker-miller-moho:latest
命令行docker示例
# print help message (i.e. usage)
docker run --rm lmoresi/docker-miller-moho:latest help
# print help message (i.e. usage)
docker run --rm lmoresi/docker-miller-moho:latest bash_utils > msmoho_bash_utils.sh
source msmoho_bash_utils.sh
# print help message (i.e. usage)source msmoho_bash_utils.sh
msmoho-docker-sh install_examples
# run my_script.py with python in the docker containersource msmoho_bash_utils.sh
msmoho-docker-sh my_script.py
通过PIP(或Conda)安装
#! /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 errors
pip install numpy
pip install stripy
# stripy and numpy# as they embed fortran and C packages# miller_alaskamoho_srl2018 itself is pure python
pip install miller_alaskamoho_srl2018
#! /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)
# The jupyter notebook system (and dependencies)
pip install jupyter
# scipy is used in some examples
pip install scipy
# cartopy is used to plot examples# (may be necessary to install the shapely package first)
pip install --no-binary :all: shapely
pip install cartopy
# We need litho1pt0 to re-build the model files
pip install litho1pt0
# We use lavavu for the interactive visualisation of the surfaces
pip install lavavu
# 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.
pip install gdal
推荐PyPI第三方库