Skip to main content

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

# Interactive method
isgri query

# 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

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

isgri-0.6.0.tar.gz (49.2 MB view details)

Uploaded Source

Built Distribution

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

isgri-0.6.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file isgri-0.6.0.tar.gz.

File metadata

  • Download URL: isgri-0.6.0.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

Hashes for isgri-0.6.0.tar.gz
Algorithm Hash digest
SHA256 203ef441929c164faec0ac8c19c2c337ba5e81f60f454dd677d49169ec27a9e1
MD5 d2a697e128b14bbb86f976805e81e787
BLAKE2b-256 5f9e50ec66b13a73f37df943d1a3e9e67ae0f2a0a7a280d1815a9177dfd38c14

See more details on using hashes here.

File details

Details for the file isgri-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: isgri-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for isgri-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7407468ba6f8759b80d2daf0ff81b469a0d12de0f5c80963b28aff47fe60f56
MD5 371c80fc0258675380543e9bb88e8453
BLAKE2b-256 f9e388240da23369b1b263f178c6f19abfd055467569705b2dade52231bd7b35

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