{"id":13521200,"url":"https://github.com/mattpitkin/psrqpy","last_synced_at":"2025-07-25T23:32:16.803Z","repository":{"id":26851004,"uuid":"110824647","full_name":"mattpitkin/psrqpy","owner":"mattpitkin","description":"A python module to query the ATNF pulsar catalogue","archived":false,"fork":false,"pushed_at":"2024-04-25T08:21:35.000Z","size":3390,"stargazers_count":39,"open_issues_count":3,"forks_count":25,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-25T09:34:29.996Z","etag":null,"topics":["atnf","catalogue","pulsar","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattpitkin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-15T11:27:08.000Z","updated_at":"2024-04-25T09:34:37.399Z","dependencies_parsed_at":"2024-03-25T10:28:49.957Z","dependency_job_id":"e68d37b0-ac4f-4cf1-91e7-25a5a3e260ee","html_url":"https://github.com/mattpitkin/psrqpy","commit_stats":{"total_commits":495,"total_committers":13,"mean_commits":38.07692307692308,"dds":0.2525252525252525,"last_synced_commit":"167c26dee3c85dda5d2127271f6cc177488cee96"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpitkin%2Fpsrqpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpitkin%2Fpsrqpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpitkin%2Fpsrqpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpitkin%2Fpsrqpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattpitkin","download_url":"https://codeload.github.com/mattpitkin/psrqpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227629004,"owners_count":17796054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atnf","catalogue","pulsar","python"],"created_at":"2024-08-01T06:00:30.636Z","updated_at":"2025-07-25T23:32:16.785Z","avatar_url":"https://github.com/mattpitkin.png","language":"Python","readme":"# PSRQpy\n\nThis module aims to provide a python interface for querying the [ATNF pulsar catalogue](http://www.atnf.csiro.au/research/pulsar/psrcat/). It is an unofficial\npackage and is not endorsed by or affiliated with the ATNF.\n\nFull documentation of the module can be found [here](http://psrqpy.readthedocs.io/).\n\nAny comments or suggestions are welcome.\n\n## Installation\n\nTo install the code from source, clone the git repository and run:\n\n```\npip install .\n```\n\nThe module can also be installed from the [PyPI repository](https://pypi.org/project/psrqpy/) using\n`pip` with:\n\n```\npip install psrqpy\n```\n\nor in a [Conda](https://docs.conda.io/en/latest/) environment using:\n\n```\nconda install -c conda-forge psrqpy\n```\n\n### Requirements\n\nThe requirements for installing the code are:\n\n * [`requests`](http://docs.python-requests.org/en/master/)\n * [`beautifulsoup4`](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)\n * [`numpy`](http://www.numpy.org/)\n * [`scipy`](https://www.scipy.org/)\n * [`astropy`](http://www.astropy.org/)\n * [`pandas`](https://pandas.pydata.org/)\n * [`ads`](https://ads.readthedocs.io/en/latest/)\n * [`matplotlib`](https://matplotlib.org/)\n\n## Examples\n\nA simple query of the catalogue to, e.g., just return all pulsar frequencies, would be:\n\n```python\nimport psrqpy\n\nq = psrqpy.QueryATNF(params='F0')\n\n# get frequencies as an astropy table\nt = q.table\n\nprint(t['F0'])\n```\n\nYou can query multiple parameters, e.g.:\n\n```python\nimport psrqpy\n\nq = psrqpy.QueryATNF(params=['F0', 'F1', 'RAJ', 'DecJ'])\n\n# get values as an astropy table\nt = q.table\n\nprint(t['F0'])\n```\n\nYou can query specific pulsars, e.g.:\n\n```\nimport psrqpy\n\nq = psrqpy.QueryATNF(params=['F0', 'F1', 'RAJ', 'DecJ'], psrs=['J0534+2200', 'J0537-6910'])\n\n# get values as an astropy table\nt = q.table\n\n# print the table\nprint(t)\n  JNAME          F0       F0_ERR       F1      F1_ERR     RAJ      RAJ_ERR     DECJ     DECJ_ERR\n                 Hz         Hz       1 / s2    1 / s2                                           \n---------- ------------- ------- ------------- ------ ------------ ------- ------------ --------\nJ0534+2200     29.946923   1e-06  -3.77535e-10  2e-15 05:34:31.973   0.005 +22:00:52.06     0.06\nJ0537-6910 62.0261895958 1.3e-09 -1.992272e-10  4e-17 05:37:47.416    0.11 -69:10:19.88      0.6\n```\n\nYou can set [conditions](http://www.atnf.csiro.au/research/pulsar/psrcat/psrcat_help.html?type=normal#condition) for the searches,\ne.g.:\n\n```python\nimport psrqpy\nq = psrqpy.QueryATNF(params=['Jname', 'f0'], condition='f0 \u003e 100 \u0026\u0026 f0 \u003c 200', assoc='GC')\n```\n\nwhere `assoc=GC` looks for all pulsars in globular clusters.\n\nWhen a query is generated the entire catalogue is downloaded and stored in the `QueryATNF` object as\na pandas [`DataFrame`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html).\nThe query can therefore be re-used to access data on different parameters, different pulsars, or\nusing different conditions, without the need to re-download the catalogue. We may originally want\nto query pulsar frequencies using only frequencies greater than 10 Hz, with\n\n```python\nimport psrqpy\nq = psrqpy.QueryATNF(params=['F0'], condition='F0 \u003e 10')\nfreqs = q.table['F0']\n```\n\nUsing the same `QueryATNF` object we could change to get frequency derivatives for pulsars\nwith frequencies less than 10 Hz, with\n\n```python\nq.condition = 'F0 \u003c 10'\nq.query_params = 'F1'\n\nfdot = q.table['F1']\n```\n\nIn these cases the whole catalogue (with no conditions applied and all available parameters) stored as a pandas [`DataFrame`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html)\nis accessible with\n\n```python\ncatalogue = q.catalogue\n```\n\nYou can also [generate](http://psrqpy.readthedocs.io/en/latest/query.html#psrqpy.search.QueryATNF.ppdot) a\n_lovely_ period vs. period derivative plot based on the latest catalogue information, using\njust three lines of code, e.g.:\n\n```python\nfrom psrqpy import QueryATNF\nquery = QueryATNF()\nquery.ppdot(showSNRs=True, showtypes='all')\n```\n\ngives\n\n![PPdot](../main/docs/source/images/ppdot.png)\n\n## Development and Support\n\nCode development is done via the package's [GitHib repository](https://github.com/mattpitkin/psrqpy).\nAny contributions can be made via a [fork and pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) model\nfrom that repository, and must adhere to the [MIT license](#License). Any problems with the code\nor support requests can be submitted via the repository's [Issue tracker](https://github.com/mattpitkin/psrqpy/issues).\n\n## Test suite\n\nThere are tests supplied that cover many of the functions within PSRQpy. These can be run from the\nbase directory of the repository (after installing the [`pytest`](https://docs.pytest.org/en/latest/) and\n[`pytest-socket`](https://pypi.org/project/pytest-socket/) modules, e.g., with `pip`) by just calling:\n\n```bash\npytest\n```\n\nThese tests are not included in the `pip` installed version of the code.\n\n## Copyright and referencing for the catalogue\n\nRegarding the use of the catalogue and software behind it, the [following statements](http://www.atnf.csiro.au/research/pulsar/psrcat/download.html) apply:\n\n\u003e 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.\n\u003e\n\u003e PSRCAT makes use of \"evaluateExpression: A Simple Expression Evaluator\". Copyright \u0026copy; 1996 - 1999 Parsifal Software, All Rights Reserved.\n\u003e\n\u003e The programs and databases remain the property of the Australia Telescope National Facility, CSIRO, and are covered by the [CSIRO Legal Notice and Disclaimer](http://www.csiro.au/en/About/Footer/Legal-notice).\n\u003e\n\u003e 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](http://adsabs.harvard.edu/abs/2005AJ....129.1993M)\", R. N. Manchester, G. B. Hobbs, A. Teoh \u0026 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.\n\nIf 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](http://adsabs.harvard.edu/abs/2005AJ....129.1993M) and [URL](http://www.atnf.csiro.au/research/pulsar/psrcat) given above) you consider citing the [JOSS](http://joss.theoj.org/) [paper](https://doi.org/10.21105/joss.00538) for this software:\n\n```tex\n@article{psrqpy,\n  author = {{Pitkin}, M.},\n   title = \"{psrqpy: a python interface for querying the ATNF pulsar catalogue}\",\n  volume = 3,\n  number = 22,\n   pages = 538,\n   month = feb,\n    year = 2018,\n journal = \"{Journal of Open Source Software}\",\n     doi = {10.21105/joss.00538},\n     url = {https://doi.org/10.21105/joss.00538}\n}\n```\n\n## License\n\nThis code is licensed under the [MIT License](http://opensource.org/licenses/MIT).\n\n\u0026copy; Matt Pitkin, 2017\n\n[![PyPI version](https://badge.fury.io/py/psrqpy.svg)](https://badge.fury.io/py/psrqpy)\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/psrqpy/badges/version.svg)](https://anaconda.org/conda-forge/psrqpy)\n[![version](https://img.shields.io/pypi/pyversions/psrqpy.svg)](https://pypi.org/project/psrqpy/)\n[![Build Status](https://github.com/mattpitkin/psrqpy/workflows/build/badge.svg)](https://github.com/mattpitkin/psrqpy/actions?query=workflow%3Abuild)\n[![codecov](https://codecov.io/gh/mattpitkin/psrqpy/branch/master/graph/badge.svg)](https://codecov.io/gh/mattpitkin/psrqpy)\n[![Documentation Status](https://readthedocs.org/projects/psrqpy/badge/?version=latest)](http://psrqpy.readthedocs.io/en/latest/?badge=latest)\n[![status](http://joss.theoj.org/papers/711dc5566159f6e9f8ea5d07dbfaf5d2/status.svg)](http://joss.theoj.org/papers/711dc5566159f6e9f8ea5d07dbfaf5d2)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1489692.svg)](https://doi.org/10.5281/zenodo.1489692)\n[![ASCL](https://img.shields.io/badge/ascl-1812.017-blue.svg?colorB=262255)](http://ascl.net/1812.017)\n","funding_links":[],"categories":["Catalog or Tools for Catalogues"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpitkin%2Fpsrqpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattpitkin%2Fpsrqpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpitkin%2Fpsrqpy/lists"}