查询atnf脉冲星目录的python模块
psrqp的Python项目详细描述
psrqpy
此模块旨在提供一个python接口,用于查询ATNF pulsar catalogue这是非正式的 包装,不由ATNF背书或附属于ATNF。
可以找到模块的完整文档here
欢迎提出任何意见或建议。
安装
要从源代码安装代码,请克隆git存储库并运行以下任一操作:
python setup.py install --user
以用户身份安装,或
sudo python setup.py install
作为根安装。
也可以使用pip
和
pip install psrqpy
要求
用于安装代码的requirements是:
^{
示例
一个简单的目录查询,例如,返回所有脉冲星频率,将是:
importpsrqpyq=psrqpy.QueryATNF(params='F0')# get frequencies as an astropy tablet=q.tableprint(t['F0'])
可以查询多个参数,例如:
importpsrqpyq=psrqpy.QueryATNF(params=['F0','F1','RAJ','DecJ'])# get values as an astropy tablet=q.tableprint(t['F0'])
您可以查询特定的脉冲星,例如:
import psrqpy
q = psrqpy.QueryATNF(params=['F0', 'F1', 'RAJ', 'DecJ'], psrs=['J0534+2200', 'J0537-6910'])
# get values as an astropy table
t = q.table
# print the table
print(t)
JNAME F0 F0_ERR F1 F1_ERR RAJ RAJ_ERR DECJ DECJ_ERR
Hz Hz 1 / s2 1 / s2
---------- ------------- ------- ------------- ------ ------------ ------- ------------ --------
J0534+2200 29.946923 1e-06 -3.77535e-10 2e-15 05:34:31.973 0.005 +22:00:52.06 0.06
J0537-6910 62.0261895958 1.3e-09 -1.992272e-10 4e-17 05:37:47.416 0.11 -69:10:19.88 0.6
您可以为搜索设置conditions, 例如:
importpsrqpyq=psrqpy.QueryATNF(params=['Jname','f0'],condition='f0 > 100 && f0 < 200',assoc='GC')
其中assoc=GC
寻找球状星团中的所有脉冲星。
生成查询时,整个目录将下载并存储在QueryATNF
对象中
熊猫。
因此,可以重新使用查询来访问不同参数、不同脉冲星或
使用不同的条件,无需重新下载目录。我们可能原本想要
只使用大于10赫兹的频率查询脉冲星频率
importpsrqpyq=psrqpy.QueryATNF(params=['F0'],condition='F0 > 10')freqs=q.table['F0']
使用相同的QueryATNF
对象,我们可以改变得到脉冲星的频率导数
频率小于10赫兹,且
q.condition='F0 < 10'q.query_params='F1'fdot=q.table['F1']
在这些情况下,整个目录(没有应用任何条件和所有可用参数)存储为pandas ^{
catalogue=q.catalogue
你也可以generatea lovely基于最新目录信息的周期与周期导数图,使用 只有三行代码,例如:
frompsrqpyimportQueryATNFquery=QueryATNF(params=['P0','P1','ASSOC','BINARY','TYPE','P1_I'])query.ppdot(showSNRs=True,showtypes='all')
给出
开发和支持
代码开发是通过包的GitHib repository完成的。 任何贡献都可以通过fork and pull request模型做出 必须遵守MIT license。代码有问题吗 或者支持请求可以通过存储库的Issue tracker提交
测试套件
提供的测试涵盖了psrqpy中的许多功能。这些可以从
存储库的基本目录(在安装^{pip
)只需调用:
pytest
这些测试不包括在pip
安装的代码版本中。
目录的版权和参考
关于使用目录及其背后的软件,following statements应用:
PSRCAT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PSRCAT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
PSRCAT makes use of "evaluateExpression: A Simple Expression Evaluator". Copyright © 1996 - 1999 Parsifal Software, All Rights Reserved.
The programs and databases remain the property of the Australia Telescope National Facility, CSIRO, and are covered by the CSIRO Legal Notice and Disclaimer.
If you make use of information from the ATNF Pulsar Catalogue in a publication, we would appreciate acknowledgement by reference to the publication "The ATNF Pulsar Catalogue", R. N. Manchester, G. B. Hobbs, A. Teoh & M. Hobbs, Astronomical Journal, 129, 1993-2006 (2005) and by quoting the web address http://www.atnf.csiro.au/research/pulsar/psrcat for updated versions.
如果使用此代码访问目录或生成绘图,我将非常感谢(以及引用上面给出的ATNF脉冲星目录paper和URL)您考虑引用此软件的JOSSpaper:
@article{psrqpy, author = {{Pitkin}, M.}, title = "{psrqpy: a python interface for querying the ATNF pulsar catalogue}", volume = 3, number = 22, pages = 538, month = feb, year = 2018, journal = "{Journal of Open Source Software}", doi = {10.21105/joss.00538}, url = {https://doi.org/10.21105/joss.00538}}
许可证
此代码是根据MIT License授权的。
版权所有Matt Pitkin,2017年