跳转到主要内容

Python对ttvfast的包装

项目描述

作者:

Simon Walker <s.r.walker101@googlemail.com>

https://img.shields.io/pypi/v/ttvfast.svg?maxAge=2592000 https://travis-ci.org/mindriot101/ttvfast-python.svg?branch=master

围绕Katherine Deck的TTVFast C程序(https://github.com/kdeck/TTVFast)的Python包装器

安装

从pypi安装

pip install ttvfast

或下载并使用以下命令编译代码:

python setup.py build_ext --inplace

对于最新开发版本,使用pip安装

pip install git+https://github.com/mindriot101/ttvfast.git

或从git克隆

git clone https://github.com/mindriot101/ttvfast-python.git
cd ttvfast-python
git submodule init
git submodule update # grabs code from TTVFast

然后使用以下命令测试是否构建正确:

$ py.test
============================== test session starts ===============================
testing/test_lweiss.py .
testing/test_models.py ...
testing/test_python_api.py ...
testing/test_ttvfast.py ...

使用方法

为了计算一个或多个行星的TTV属性

  • 创建一个ttvfast.models.Planet实例(请参阅类文档以获取所需参数)

  • 将系统中的行星列表传递给ttvfast.ttvfast,以及

    • 恒星质量(以太阳质量为单位),

    • 积分的起始点(以天为单位),

    • 积分的时间步长(以天为单位),

    • 以及积分的终点(以天为单位)。

ttvfast.ttvfast函数返回一个包含positionsrv的字典。其中positions项是一个包含以下内容的元组:

  1. 整数索引列表,其值对应于哪个行星,

  2. 定义纪元的整数列表,

  3. 时间列表,

  4. rsky值列表,

  5. vsky值列表。

可选的 rv_times 参数接受一个 RV 时间的列表,这些时间用于计算 RV。如果是这样,输出字典中的 rv 条目将填充一个 RV 值的列表,否则填充 None

有关更多详细信息,请参阅原始 C 模块的文档:https://github.com/kdeck/TTVFast/blob/master/c_version/README

参考文献

如果您使用此代码,请引用 Deck, Agol, Holman, & Nesvorny (2014), ApJ, 787, 132, arXiv:1403.1895。

-Katherine Deck, Eric Agol, Matt Holman, & David Nesvorny

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源代码发行版

ttvfast-0.3.0.tar.gz (56.2 kB 查看散列)

上传时间 源代码

构建发行版

ttvfast-0.3.0-cp35-cp35m-macosx_10_11_x86_64.whl (23.4 kB 查看散列)

上传时间 CPython 3.5m macOS 10.11+ x86-64

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面