Coder Social home page Coder Social logo

thepetabyteproject / burstfit Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 16.14 MB

Spectro-temporal modeling of FRBs

Home Page: https://thepetabyteproject.github.io/burstfit/

License: GNU General Public License v3.0

Python 99.75% Shell 0.25%
fast-radio-bursts pulsars

burstfit's Introduction

burstfit

GitHub issues GitHub forks GitHub stars GitHub license ViewCount GitHub Workflow Status

PyPI - Python Version PyPI Code style: black codecov

Spectro-temporal modeling of FRBs

Installation

You can install burstfit directly using pip

pip install burstfit

Or if you want to try out the latest stuff,

git clone https://github.com/thepetabyteproject/burstfit
cd burstfit
pip install -r requirements.txt
python setup.py install

Documentation

Have a look at our docs for the documentation.

Tutorials

Here are some tutorial notebooks to get you started.

Note: To run the tutorial notebooks you would need to install jupyter.

Citation

Please cite the following paper if you use burstfit:

@ARTICLE{2021arXiv210705658A,
       author = {{Aggarwal}, Kshitij and {Agarwal}, Devansh and {Lewis}, Evan F. and {Anna-Thomas}, Reshma and {Cardinal Tremblay}, Jacob and {Burke-Spolaor}, Sarah and {McLaughlin}, Maura A. and {Lorimer}, Duncan R.},
        title = "{Comprehensive analysis of a dense sample of FRB 121102 bursts}",
      journal = {arXiv e-prints},
     keywords = {Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2021,
        month = jul,
          eid = {arXiv:2107.05658},
        pages = {arXiv:2107.05658},
archivePrefix = {arXiv},
       eprint = {2107.05658},
 primaryClass = {astro-ph.HE},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2021arXiv210705658A},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

burstfit's People

Contributors

devanshkv avatar kshitijaggarwal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

burstfit's Issues

Tutorial to make pretty FRB plots

It is fairly easy to make noise-free FRB plots using burstfit. It might be useful to add a short tutorial notebook with a few examples.

Class to handle parameters

The current way to handle fit parameters require nested dictionaries and lists. It would be must cleaner to use a parameter class to handle parameters.

Add a CurveFit class

There is a lot of redundant code in fit.py which uses scipy's curve_fit. The main redundancy arises when trying to catch different errors thrown by the curve_fit function and modifying the bounds/p0 accordingly in: profile_fit, spectra_fit, sgram_fit and other fitting functions. It all can probably be moved to a single class that can handle it in a cleaner way.

Use bandpass

It would be useful to have an option to use a template bandpass shape (as input) while fitting. This is needed when the data is not bandpass calibrated.

llvmlite install

Installing burstfit in some virtual envs will produce the following error, produced by YOUR's dependency on llvmlite:

ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Solution:
pip install llvmlite --ignore-installed

AttributeError: module 'mmap' has no attribute 'MAP_PRIVATE'

When I tried running the BurstData tutorial notebook I get the following error


AttributeError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 bd = BurstData(
2 fp=fil_file,
3 dm=475.28400,
4 tcand=2.0288800,
5 width=2,
6 snr=16.8128,
7 )

File ~\Desktop....\burstfit\burstfit-main\burstfit\data.py:44, in BurstData.init(self, fp, dm, tcand, width, snr, min_samp, kill_mask, spectral_kurtosis_sigma, savgol_frequency_window, savgol_sigma, flag_rfi)
29 def init(
30 self,
31 fp=None,
(...)
41 flag_rfi=False,
42 ):
---> 44 Candidate.init(
45 self,
46 fp=fp,
47 dm=dm,
48 tcand=tcand,
49 width=width,
50 label=-1,
51 snr=snr,
52 min_samp=min_samp,
53 device=0,
54 kill_mask=kill_mask,
55 spectral_kurtosis_sigma=spectral_kurtosis_sigma,
56 savgol_frequency_window=savgol_frequency_window,
57 savgol_sigma=savgol_sigma,
58 flag_rfi=flag_rfi,
59 )
60 self.dispersed_at_dm = None
61 self.i0 = None

File C:\Python310\lib\site-packages\your\candidate.py:51, in Candidate.init(self, fp, dm, tcand, width, label, snr, min_samp, device, kill_mask, spectral_kurtosis_sigma, savgol_frequency_window, savgol_sigma, flag_rfi)
35 def init(
36 self,
37 fp=None,
(...)
49 flag_rfi=False,
50 ):
---> 51 Your.init(self, fp)
52 self.dm = dm
53 self.tcand = tcand

File C:\Python310\lib\site-packages\your\your.py:72, in Your.init(self, file)
70 logger.debug(f"Reading the file(s): {self.your_file}")
71 self.formatclass = FORMATS[self.format]
---> 72 self.formatclass.init(self, self.your_file)
73 if not self.source_name:
74 logger.info(
75 f"Source name not present in the file. Setting source name to TEMP"
76 )

File C:\Python310\lib\site-packages\your\formats\pysigproc.py:87, in SigprocFile.init(self, fp, copy_hdr)
84 self.fp = fp
85 self.read_header(self.fp)
86 self._mmdata = mmap.mmap(
---> 87 self.fp.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ
88 )
90 self.bw = self.nchans * self.foff
91 self.cfreq = self.fch1 + (self.bw / 2) - (self.foff / 2)

AttributeError: module 'mmap' has no attribute 'MAP_PRIVATE'

How do I resolve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.