python接口到miller srl 2018阿拉斯加moho模型-需要stripy,numpy

miller_alaskamoho_srl2018的Python项目详细描述


Miller&Moresi-带笔记本的阿拉斯加Moho型号


Image showing map of results

首选模型、梯度和与热流数据的比较。地图是 使用cartopy包生成。复制说明 此软件包附带的笔记本中有地图


此包装是Miller&Moresi Alaska Moho型号的自洽包装。 有很多方法可以访问这个包。

它包含

  • 此信息
  • 安装文档和示例的脚本
  • 用于操作数据的Jupyter笔记本
  • 用于重新创建我们工作的Jupyter笔记本

mybinder.org上提供演示-打开笔记本A0-Index.ipynb 开始。有任何更新/勘误表的“当前”版本如下:

Binder

这正是发布的版本(1.0),疣和所有。

Binder

站点地图

作为示例提供的jupyter笔记本如下所示

  • A1:原始数据,转换并保存
  • A2:原始数据-绘图质量信息
  • A3:三角剖分和插值原始数据
  • A4:绘制莫霍面和莫霍面坡度
  • A5:交互式3D绘图
  • A6:将模型转换为常规XYZ网格

还有更多的笔记本可以让您复制我们在创建 首选模型,可以在ModelConstruction目录中浏览这些模型


Image showing quality scores on a map

我们通过将曲面拟合到观测点并记录容量来构建我们的模型 在模型构造中不包括的点上预测信息。这个 模型的质量在每一点上都给出了一个整数分数,用来加权信息 在最终装配过程中

安装

可以使用pip独立安装包。 也可以通过Docker运行,无需具体安装。

这些笔记本可以用jupyter查看,但只有在所有软件依赖项都有 已安装(请参见下面的Installation through ^{})。

在几乎所有情况下,我们都建议使用(自包含的)docker版本。 我们提供了一些有用的bash快捷方式,使docker命令 更容易记住(见下面的Installation through docker)。

通过Docker安装

首先,必须从docker store为您的平台安装免费的docker,community edition

# 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

在当前目录中安装bash帮助程序

# 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

运行本地python脚本

# run  my_script.py with python in the docker containersource msmoho_bash_utils.sh
msmoho-docker-sh my_script.py

通过PIP(或Conda)安装

python包的安装很简单,但是 可能需要依赖于numpy和stripy 已安装的Fortran编译器。如果这证明有问题, Docker版本可能是最好的选择。

#! /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)

如果您以jupyter笔记本的形式安装文档,那么要查看它们, 您还需要安装一些依赖项。具体来说:

# 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

如果你只想浏览文档/示例或者看看我们是如何构建模型的,为什么不使用docker版本呢!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java:关于Eclipse的几个问题   java在Apache Camel Netty组件中使用SSL,并带有JVM默认密钥库文件   Java解析未格式化字符串   java前缀字符串资源标识符,用于在运行时选择备用版本   java为什么三元表达式在if语句正常工作时不更新值?   java我需要帮助程序以特定格式输出文本文件。   java Spring Tomcat启动问题setCatalinaBase(Ljava/io/File;)   递归java数独回溯递归   java如何解决构造函数上的错误?   getEngineByName(“JavaScript”)在Java 11上返回null   java如何将对象添加到数组并打印它?   java我在层泄漏反模式中吗?我该怎么办?   java动态移动带有ImageIcon的JLabel时,会在帧周围跳跃   JavaXSLT转换释放了特殊字符   java BuffereImage会降低性能   DL4J中的java回归预测下一个时间步   Java 11中的spring boot复制JAR导致以下错误   如何通过编程将图像编码到Java视频文件中?   如何使用Java更新Pentaho转换连接数据?