Python package for INTEGRAL IBIS/ISGRI lightcurve analysis
Project description
ISGRI
Python toolkit for INTEGRAL/ISGRI data analysis.
Features
Command Line Interface
Query catalogs directly from the terminal:
- Filter by time, position, quality, revolution
- Export results to FITS/CSV
- List SWIDs for batch processing
SCW Catalog Query
Query INTEGRAL Science Window catalogs with a fluent Python API:
- Filter by time, position, quality, revolution
- Calculate detector offsets
- Export results to FITS/CSV
Light Curve Analysis
Extract and analyze ISGRI light curves:
- Event loading with PIF weighting
- Custom time binning
- Module-by-module analysis
- Quality metrics (chi-squared tests)
- Time conversions (IJD to/from UTC)
Installation
pip install isgri
Quick Start
CLI Usage
# Configure default paths (once)
isgri config-set --catalog ~/data/scw_catalog.fits
# Query by time range
isgri query --tstart 2010-01-01 --tstop 2010-12-31
# Query Crab with quality cut
isgri query --ra 83.63 --dec 22.01 --max-chi 2.0 --fov full
# Get list of SWIDs for processing
isgri query --tstart 3000 --tstop 3100 --list-swids > swids.txt
# Export results
isgri query --tstart 3000 --tstop 3100 --output results.fits
Query SCW Catalog
from isgri.catalog import ScwQuery
# Load catalog
cat = ScwQuery("path_to_catalog.fits")
# Find Crab observations in 2010 with good quality
results = (cat
.time(tstart="2010-01-01", tstop="2010-12-31")
.quality(max_chi=2.0)
.position(ra=83.63, dec=22.01, fov_mode="full")
.get()
)
print(f"Found {len(results)} observations")
Analyze Light Curves
from isgri.utils import LightCurve, QualityMetrics
# Load events with PIF weighting
lc = LightCurve.load_data(
events_path="isgri_events.fits",
pif_path="source_model.fits",
pif_threshold=0.5
)
# Create 1-second binned light curve
time, counts = lc.rebin(binsize=1.0, emin=20, emax=100)
# Compute quality metrics
qm = QualityMetrics(lc, binsize=1.0, emin=20, emax=100)
chi = qm.raw_chi_squared()
print(f"Chisq/dof = {chi:.2f}")
Configuration
ISGRI stores configuration in default config folder for each system (see: platformdirs package)
# View current config
isgri config
# Set paths
isgri config-set --archive /path/to/archive --catalog /path/to/catalog.fits
Config can also be used in Python:
from isgri.config import get_config
cfg = get_config()
print(cfg.archive_path)
print(cfg.catalog_path)
Local config file isgri_config.toml in current directory overrides global config.
Documentation
- CLI Reference: Run
isgri --helporisgri <command> --help - Catalog Tutorial: scwquery_walkthrough.ipynb
- Light Curve Tutorial: lightcurve_walkthrough.ipynb
- API Reference: Use
help()in Python or see docstrings
Project Structure
isgri/
├── catalog/ # SCW catalog query tools
│ ├── scwquery.py # Main query interface
│ └── wcs.py # Coordinate transformations
├── utils/ # Light curve analysis utilities
│ ├── lightcurve.py # Light curve class
│ ├── quality.py # Quality metrics
│ ├── pif.py # PIF tools
│ ├── file_loaders.py
│ └── time_conversion.py
├── config.py # Configuration management
└── cli.py # Command line interface
Requirements
- Python ≥ 3.10
- astropy
- numpy
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 isgri-0.5.1.tar.gz.
File metadata
- Download URL: isgri-0.5.1.tar.gz
- Upload date:
- Size: 49.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3fac9df240320cb83506cead6ac0c1f20556034cabd3c84f962c0cb73b52357
|
|
| MD5 |
f9f91e1cab89f49b67ca8296cb4542f9
|
|
| BLAKE2b-256 |
4dcb99f07e1f5a7a729b8f9f996a85228577804378f82993371f22713a83249a
|
File details
Details for the file isgri-0.5.1-py3-none-any.whl.
File metadata
- Download URL: isgri-0.5.1-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ac62c6ba1cc4c103700b3a16e4af55ab0a9a80d1de6cb7384e67198b48eb76
|
|
| MD5 |
c55a06787a8bb40dd774e18aeb00bfc3
|
|
| BLAKE2b-256 |
7d469c01629e37f7c98d7a096914e004bba649905cdb468b1ff51ebdce403dab
|