Calculate the redshift of a FRB from its dispersion measure
Project description
FRUITBAT is an open source python package used to estimate the redshift of Fast Radio Bursts (FRB) from their dispersion measure. FRUITBAT combines various dispersion measure (DM) and redshift relations with the YMW16 galactic dispersion measure model into a single easy to use API.
Documentation
The documentation for FRUITBAT can be found at https://fruitbat.readthedocs.io/.
Installation
You can install the latest release of FRUITBAT from PyPi by running the following:
pip install fruitbat
You can install the latest development version of FRUITBAT by cloning this repository:
git clone https://github.com/abatten/fruitbat cd fruitbat pip install .
If you are installing the latest development version of FRUITBAT then you will also need to install git-lfs. Instructions for installing git-lfs for your operating system can be found here.
Linux Users
If you are installing FRUITBAT on a linux machine you may see this ‘error’: ERROR: Failed building wheel for pyymw16. This does not mean the installation failed. The C++ bindings were compiled using MacOS and needed to be recompiled for your machine. The installation process does this for you. You should still be able to run FRUITBAT normally.
Requirements
Below are the listed requirements for running FRUITBAT and the purpose for each requirement.
numpy: Array manipulation
scipy: Modules for integration and interpolation
astropy: Modules for cosmology, coordinates, constants and units
matplotlib: Modules for plotting
pandas: Reading csv files from FRBCAT
pyymw16: Python wrapper for YMW16 galactic dispersion measure model.
e13tools: Utility tools for writing docstrings.
Usage
If you want to get started using FRUITBAT there is a Getting Started section of the documentation made just for you! Otherwise the tl;dr is the following:
Most of the calculations will be centred around the Frb class. You can can define an instance of the Frb class with a dispersion measure. To calculate the redshift of the FRB use the method calc_redshift.
>>> import fruitbat >>> FRB121102 = fruitbat.Frb(557, dm_excess=369) >>> FRB121102.calc_redshift() <Quantity 0.37581945>
The calc_redshift function can also be passed a method and/or a cosmology. The method will specify which DM-redshift relation to assume and the cosmology will specify which cosmology to assume.
>>> FRB121102.calc_redshift(method="Zhang2018", cosmology="Planck18") <Quantity 0.42166019>
It is also possible to specify the coordinates of the burst and use the calc_dm_galaxy function to calculate the DM contribution from the Milky Way using the YMW16 or NE2001 galactic electron distribution model. Performing calc_dm_galaxy will automatically calculate the excess dispersion measure for the redshift calculation.
>>> FRB190222 = fruitbat.Frb(500, raj="12:34:43.5", decj="2:34:15.2") >>> FRB190222.calc_dm_galaxy() <Quantity 22.43696785 pc / cm3> >>> FRB190222.calc_redshift() <Quantity 0.4808557>
Issues and Contributing
If there is a feature of FRUITBAT that currently does not exist, but you would like it to, you can contribute by openning a Github Issue and outlining the feature. Similar to contributing, if you find a problem with FRUITBAT or are having difficulties using FRUITBAT please do not hesitate to open a Github Issue.
Referencing Fruitbat
If you use FRUITBAT in your research, we would like it if you could add an acknowledgement statement “Some of the results of this paper have been derived using the FRUITBAT package” and reference our paper.
@ARTICLE{2019JOSS....4.1399B, author = {{Batten}, Adam}, title = "{Fruitbat: A Python Package for Estimating Redshifts of Fast Radio Bursts}", journal = {The Journal of Open Source Software}, keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - High Energy Astrophysical Phenomena}, year = "2019", month = "May", volume = {4}, number = {37}, pages = {1399}, doi = {10.21105/joss.01399}, archivePrefix = {arXiv}, eprint = {1905.04294}, primaryClass = {astro-ph.IM}, adsurl = {https://ui.adsabs.harvard.edu/abs/2019JOSS....4.1399B}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} }
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fruitbat-2.0.1.tar.gz
.
File metadata
- Download URL: fruitbat-2.0.1.tar.gz
- Upload date:
- Size: 5.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6aba163bf9f5344be5468b067a39d3b04bb92a1298b43620aa67b8df3d148cc |
|
MD5 | afbd67fdbdb56449bef7459909945c8a |
|
BLAKE2b-256 | e7d8c03684c7be7aeffa3e6181f4f9541c2d92c4a74df2f0bb93fed9f93e81e7 |
File details
Details for the file fruitbat-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: fruitbat-2.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5323635ef5e1adae4d271004e41b6cdcaaff897052fe51d364c6135000b3cd30 |
|
MD5 | 1ec2ddb1373dce240ced5edcb4d63c2b |
|
BLAKE2b-256 | af645c126c2a494e4f09e111d32021c8606140b90adf0cd1129eda8a2847b755 |