Python package for GRB analysis
Project description
pygrb_lc
Package to load and handle GRB (Gamma-ray bursts) light curves, their furie transformations and various other functions.
To install run the following command
pip install --upgrade pygrb_lc
or
pip3 install --upgrade pygrb_lc
Light curves
Main object in this package is LightCurve object and its children. Start by creating one
from pygrb_lc.light_curves import LightCurve # base class for ligth curve
lc = LightCurve()
print(lc)
It is created but empty, semplest way to provide data is by data argument, that requires numpy.ndarray with 2 (time, signal) or 4 (time, time_err, signal, signal_err) columns
import numpy as np
data = np.loadtxt('test.txt')
lc = LightCurve(data = data)
print(lc)
Base class can rebin data, subtract polynomial function, filter peaks, set intervals and load and save data to LIGHT_CURVE_SAVE folder in pickle format.
There are specific classes for INTERAL/SPI-ACS and Fermi/GBM instruments. They are able to load actual data from web, you need to specify it in loading_method parameter
from pygrb_lc.light_curves import SPI_ACS_LightCurve, GBM_LightCurve
lc1 = SPI_ACS_LightCurve('2020-01-01 00:00:00', 500, loading_method = 'web')
lc2 = GBM_LightCurve('2020-01-01 00:00:00', ['na'], duration = 500, loading_method = 'web')
Furie transformations
Furie transformation is performed by FurieLightCurve class. It requires LightCurve object as an argument
from pygrb_lc.furie import FurieLightCurve
lc = LightCurve(data = np.loadtxt('test.txt'))
flc = FurieLightCurve(lc, interval_t90 = (0, 10))
flc.plot()
All classes have plot method, you can provide matplotlib.pyplot.Axes object as an argument to plot on existing plot
fig,(ax1,ax2) = plt.subplots(2,1)
lc.plot(ax = ax1)
flc.plot(ax = ax2)
Roadmap
Add support of main GRB catalogues and their connection with light curves.
Create Catalogue class that can be compared and intersected to other.
Add support of spectra (based on current photon_data in GBM_LightCurve class)
Add typical functions for approximation: Band function, power law, etc. and their interaction with LightCurve and FurieLightCurve classes.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygrb_lc-0.0.11.tar.gz.
File metadata
- Download URL: pygrb_lc-0.0.11.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa5848669c1e2eb6b004e0e5e2ee2b54681db665c278d03807ce39a4c01c0477
|
|
| MD5 |
69db5f9b872b2da56688b640fe3604b7
|
|
| BLAKE2b-256 |
6eb2f6ceb16d434e9d2c7a76b46494b478ab3c756f2987413e374625399a076a
|
File details
Details for the file pygrb_lc-0.0.11-py3-none-any.whl.
File metadata
- Download URL: pygrb_lc-0.0.11-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f9a1c7ca118af333340c241fc1ce1585c41a2c68ef2b1d131da0c449e99c59
|
|
| MD5 |
4aed581d97169d89c6e41463f90c99ad
|
|
| BLAKE2b-256 |
98f933a01b158f3b2966a97033950564086af6dedda820098c3c9ec45a24bfb8
|