时尚的开普勒曲线

untrend的Python项目详细描述


在这个时代,研究系外行星只是有史以来最时髦的事情,有时 太好了,出轨了,有点偏僻!这个图书馆是一套 可以有力地消除光曲线上的超车趋势 数据。

安装

untrendy依赖于numpyscipy,因此请确保安装 首先是那些。然后,您可以使用pip

安装
pip install untrendy

用法

untrendy非常复杂。它具有大约^ {EM1}$ $EME>函数和 大约200行代码(包括文档)。主要是因为爱 和魔术(如果你想的话,下面会给出更完整的细节)。

假设你有一条光曲线,有时间样本t,通量 测量值f和不确定度sigma。您只需运行:

importuntrendyf_detrend,sigma_detrend=untrendy.untrend(t,f,sigma)

找到时间序列全局趋势的稳健估计并删除 它。默认设置经过调整,可以很好地查找 开普勒数据中的“过境”趋势,但详细描述了 选项如下。你也可以顺应潮流, 趋势的可调用表示:

trend=untrendy.fit_trend(t,f,ferr)

在本例中,您可以通过调用 函数:

bkg=trend(t0)

注释

  1. 样条曲线有时会在你没有任何 所以样品要小心。
  2. 整个过程引入了相关误差。你被警告了。

命令行取消终止

也可以从命令行使用untrendy如果 不想为所有的python东西烦恼。如果有空格 包含光曲线的分离ascii文件,可以通过 跑步:

untrend /path/to/data.txt

代码将假设您的文件有2或3列,其中包括time、flux和 (可选)每次观测的不确定性。然后,去趋势的光线 曲线将以相同格式写入标准输出。或者, 同一程序可以在以下位置从标准读取数据:

cat /path/to/data.txt | untrend

这让你可以选择做一些疯狂的事情,然后把所有的事情都说出来 像Unix一样。就我个人而言,我只会使用python。

API

顺应潮流

国家。fit_trendxyyerr=NoneQ=12dt=3.0tol=0.00125maxiter=15fill_times=Nonemaxditer=4nfill=4

使用迭代加权最小二乘法将样条曲线拟合到 时间序列中的非运输趋势。输入数据应该是“干净的”。 换句话说,坏数据应该被屏蔽,它通常有助于规范化 通量(通过中间带或其他东西)。

参数

^{tt8}$:The sampled times.
^{tt9}$:The fluxes corresponding to the times in ^{tt8}$.
^{tt21}$:(optional) The 1-sigma error bars on ^{tt9}$.
^{tt23}$:(optional) The parameter controlling the severity of the re-weighting.
^{tt24}$:(optional) The initial spacing between time control points.
^{tt25}$:(optional) The convergence criterion.
^{tt26}$:(optional) The maximum number of re-weighting iterations to run.
^{tt27}$:(optional) If provided, this number sets the minimum time spacing between adjacent samples that is acceptable. If the spacing is larger, knots will be added to fill in the gap.
^{tt28}$:(optional) The maximum number of discontinuity search iterations to run.
^{tt29}$:(optional) The number of knots to use to fill in the gaps.

返回

^{tt30}$:A callable representation of the trend.

消除趋势

国家。untrendxyyerr=None**kwargs

使用迭代重加权最小二乘法消除过境 轻曲线的趋势。与fit_trend不同,此函数屏蔽坏的 数据(NaN)并在拟合之前规范化数据。

参数

^{tt8}$:The sampled times.
^{tt9}$:The fluxes corresponding to the times in ^{tt8}$.
^{tt21}$:(optional) The 1-sigma error bars on ^{tt9}$.
^{tt34}$:(optional) Other arguments passed to the ^{tt35}$ function.

返回

^{tt44}$:The de-trended relative fluxes.
^{tt45}$:The de-trended uncertainties on ^{tt44}$.

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

推荐PyPI第三方库


热门话题
java Oracle将休眠为ISO 8601日期格式   当有线程时,swing计时器不会停止。睡在Java里面   如何使用swing在java中清空密码字段值(字符串)   如何在编辑文本字段上设置单词java(安卓)   单独类中的java OkHttp请求   java Tomcat配置文件/上下文xml似乎已经崩溃了。请确保它是可分析和有效的。有关详细信息,请参阅服务器日志   java在科尔多瓦的ActivityResult上传递   java如何在映射中保持插入顺序。工厂?   “DataOutputStream”和“ObjectOutputStream”之间的java差异   java从FTP文件列表中获取项目的时间戳   java如何在spring security中为每个人忽略一些资源/URL?   模板类嵌套时新的Java泛型类构造函数问题   java读取并查找文件大小为1GB的行   java如何使用字符串say“stop”停止整数格式的while循环   java是否可以在应用程序启动之间将JVM保留在内存中?   java Springboot出现“出现意外错误(类型=内部服务器错误,状态=500)”的问题