psrqpy

psrqpy: a python interface for querying the ATNF pulsar catalogue - Published in JOSS (2018)

https://github.com/mattpitkin/psrqpy

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 9 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    3 of 10 committers (30.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

atnf catalogue pulsar python
Last synced: 4 months ago · JSON representation ·

Repository

A python module to query the ATNF pulsar catalogue

Basic Info
  • Host: GitHub
  • Owner: mattpitkin
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 4.79 MB
Statistics
  • Stars: 45
  • Watchers: 4
  • Forks: 26
  • Open Issues: 7
  • Releases: 49
Topics
atnf catalogue pulsar python
Created about 8 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog License Citation

README.md

PSRQpy

This module aims to provide a python interface for querying the ATNF pulsar catalogue. It is an unofficial package and is not endorsed by or affiliated with the ATNF.

Full documentation of the module can be found here.

Any comments or suggestions are welcome.

Installation

To install the code from source, clone the git repository and run:

pip install .

The module can also be installed from the PyPI repository using pip with:

pip install psrqpy

or in a Conda environment using:

conda install -c conda-forge psrqpy

Requirements

The requirements for installing the code are:

Examples

A simple query of the catalogue to, e.g., just return all pulsar frequencies, would be:

```python import psrqpy

q = psrqpy.QueryATNF(params='F0')

get frequencies as an astropy table

t = q.table

print(t['F0']) ```

You can query multiple parameters, e.g.:

```python import psrqpy

q = psrqpy.QueryATNF(params=['F0', 'F1', 'RAJ', 'DecJ'])

get values as an astropy table

t = q.table

print(t['F0']) ```

You can query specific pulsars, e.g.:

``` 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 F0ERR F1 F1ERR RAJ RAJERR DECJ DECJERR 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 ```

You can set conditions for the searches, e.g.:

python import psrqpy q = psrqpy.QueryATNF(params=['Jname', 'f0'], condition='f0 > 100 && f0 < 200', assoc='GC')

where assoc=GC looks for all pulsars in globular clusters.

When a query is generated the entire catalogue is downloaded and stored in the QueryATNF object as a pandas DataFrame. The query can therefore be re-used to access data on different parameters, different pulsars, or using different conditions, without the need to re-download the catalogue. We may originally want to query pulsar frequencies using only frequencies greater than 10 Hz, with

python import psrqpy q = psrqpy.QueryATNF(params=['F0'], condition='F0 > 10') freqs = q.table['F0']

Using the same QueryATNF object we could change to get frequency derivatives for pulsars with frequencies less than 10 Hz, with

```python q.condition = 'F0 < 10' q.query_params = 'F1'

fdot = q.table['F1'] ```

In these cases the whole catalogue (with no conditions applied and all available parameters) stored as a pandas DataFrame is accessible with

python catalogue = q.catalogue

You can also generate a lovely period vs. period derivative plot based on the latest catalogue information, using just three lines of code, e.g.:

python from psrqpy import QueryATNF query = QueryATNF() query.ppdot(showSNRs=True, showtypes='all')

gives

PPdot

Development and Support

Code development is done via the package's GitHib repository. Any contributions can be made via a fork and pull request model from that repository, and must adhere to the MIT license. Any problems with the code or support requests can be submitted via the repository's Issue tracker.

Test suite

There are tests supplied that cover many of the functions within PSRQpy. These can be run from the base directory of the repository (after installing the pytest and pytest-socket modules, e.g., with pip) by just calling:

bash pytest

These tests are not included in the pip installed version of the code.

Copyright and referencing for the catalogue

Regarding the use of the catalogue and software behind it, the following statements apply:

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.

If making use of this code to access the catalogue, or produce plots, I would be grateful if (as well as citing the ATNF pulsar catalogue paper and URL given above) you consider citing the JOSS paper for this software:

tex @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} }

License

This code is licensed under the MIT License.

© Matt Pitkin, 2017

PyPI version Anaconda-Server Badge version Build Status codecov Documentation Status status DOI ASCL

Owner

  • Name: Matt Pitkin
  • Login: mattpitkin
  • Kind: user

(Amateur) Astrophysicist

JOSS Publication

psrqpy: a python interface for querying the ATNF pulsar catalogue
Published
February 19, 2018
Volume 3, Issue 22, Page 538
Authors
Matthew Pitkin ORCID
Institute for Gravitational Research, SUPA, University of Glasgow, University Avenue, Glasgow, UK, G12 8QQ
Editor
Arfon Smith ORCID
Tags
pulsars

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Pitkin
  given-names: Matthew
  orcid: "https://orcid.org/0000-0003-4548-526X"
contact:
- family-names: Pitkin
  given-names: Matthew
  orcid: "https://orcid.org/0000-0003-4548-526X"
doi: 10.5281/zenodo.1489692
message: If you use this software, please cite my article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Pitkin
    given-names: Matthew
    orcid: "https://orcid.org/0000-0003-4548-526X"
  date-published: 2018-02-19
  doi: 10.21105/joss.00538
  issn: 2475-9066
  issue: 22
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 538
  title: "psrqpy: a python interface for querying the ATNF pulsar
    catalogue"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.05582"
  volume: 3
title: "psrqpy: a python interface for querying the ATNF pulsar catalogue"

GitHub Events

Total
  • Create event: 11
  • Release event: 1
  • Issues event: 13
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 17
  • Push event: 25
  • Pull request event: 16
  • Fork event: 1
Last Year
  • Create event: 11
  • Release event: 1
  • Issues event: 13
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 17
  • Push event: 25
  • Pull request event: 16
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 526
  • Total Committers: 10
  • Avg Commits per committer: 52.6
  • Development Distribution Score (DDS): 0.074
Past Year
  • Commits: 17
  • Committers: 2
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.059
Top Committers
Name Email Commits
Matthew Pitkin m****n@l****g 487
Renee Spiewak r****k@g****m 13
David McKenna d****a@c****e 7
Cees Bassa c****a@g****m 6
Duncan Macleod d****d@l****g 4
astrogewgaw u****7@g****m 2
Killian Lebreton k****5@g****m 2
Gregory Ashton g****n@l****g 2
Chris Burr c****r 2
Nick Swainston n****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 64
  • Total pull requests: 80
  • Average time to close issues: 3 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 25
  • Total pull request authors: 10
  • Average comments per issue: 1.56
  • Average comments per pull request: 1.66
  • Merged pull requests: 74
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 11
  • Pull requests: 16
  • Average time to close issues: about 18 hours
  • Average time to close pull requests: about 6 hours
  • Issue authors: 5
  • Pull request authors: 3
  • Average comments per issue: 0.45
  • Average comments per pull request: 0.81
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mattpitkin (28)
  • respiewak (6)
  • duncanmmacleod (3)
  • dbkeitel (3)
  • noREAVER (2)
  • tycohen (2)
  • astrophysically (2)
  • emmacarli (1)
  • Iman-Talebi (1)
  • cxwx (1)
  • BordeauxDave (1)
  • PaulHancock (1)
  • mlower (1)
  • gabella (1)
  • bwmeyers (1)
Pull Request Authors
  • mattpitkin (65)
  • David-McKenna (4)
  • cbassa (2)
  • respiewak (2)
  • duncanmmacleod (2)
  • NickSwainston (1)
  • chrisburr (1)
  • tammojan (1)
  • Killian42 (1)
  • astrogewgaw (1)
Top Labels
Issue Labels
enhancement (9) bug (2) testing (2) packaging (1) question (1)
Pull Request Labels
enhancement (6) testing (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 613 last-month
  • Total docker downloads: 29
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 9
    (may contain duplicates)
  • Total versions: 80
  • Total maintainers: 1
pypi.org: psrqpy

A Python module for querying the ATNF pulsar catalogue

  • Versions: 61
  • Dependent Packages: 3
  • Dependent Repositories: 8
  • Downloads: 613 Last month
  • Docker Downloads: 29
Rankings
Dependent packages count: 3.1%
Docker downloads count: 3.4%
Dependent repos count: 5.2%
Average: 6.9%
Forks count: 7.8%
Stargazers count: 10.3%
Downloads: 11.3%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: psrqpy

This package provides a way of querying the ATNF pulsar catalogue.

  • Versions: 19
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.0%
Dependent packages count: 28.9%
Average: 32.5%
Forks count: 33.9%
Stargazers count: 43.3%
Last synced: 4 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/pypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish master composite
Dockerfile docker
  • python 2.7-slim build
  • python 3.5-slim build
pyproject.toml pypi
setup.py pypi