Skip to main content

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 FurieTransformation 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)

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

pygrb_lc-0.0.8.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygrb_lc-0.0.8-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file pygrb_lc-0.0.8.tar.gz.

File metadata

  • Download URL: pygrb_lc-0.0.8.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pygrb_lc-0.0.8.tar.gz
Algorithm Hash digest
SHA256 cff5def3af7acf5baa80b98aef38d5740619e156530c317167dcc6c110955ddd
MD5 6a15ee9137bf9e22a4a520decf9e0073
BLAKE2b-256 dced6da28b13869354504234acf93a011d04e617bf6d22fa9e372b333a228965

See more details on using hashes here.

File details

Details for the file pygrb_lc-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: pygrb_lc-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pygrb_lc-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d98069ca6699b67585749c5f791a3ed561e1f6a07e7d1292c2fdbbf78ecf03
MD5 6e8ecb9e70bd00181f17af65f0633c26
BLAKE2b-256 441ed478cc51547fd42f6dc24832afa0d510a1dbe5bd605d97a4915588f923f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page