BAT-GLIMPSE
Gamma-ray Localization using Imaging and Mosaic Techniques for Pointing and Slew Epochs
BAT-GLIMPSE is a fully autonomous Swift/BAT localization pipeline for transient gamma-ray sources. It combines coded-mask imaging and mosaic techniques to recover precise arcminute-scale positions during both normal pointing observations and spacecraft slews, filling the gap left by onboard trigger outages and enabling rapid follow-up of GRBs and multi-messenger counterparts.
1. Installation
Requirements
HEASoft needs to be installed. We recommend to install it via Conda as described here, doing
conda create -n henv heasoft \
-c https://heasarc.gsfc.nasa.gov/FTP/software/conda/ \
-c conda-forge
In the same environment, install BAT-GLIMPSE and NITRATES as described in the next two steps. CALDB environment variables need to be defined as described here
Install via pip
The package can be installed via pip, with Python 3.10 or greater.
pip install bat-glimpse
Optional: installing NITRATES
In order to have the data setup managed by NITRATES, we need to install it locally using:
git clone git@github.com:Swift-BAT/NITRATES.git
cd NITRATES
python -m pip install -e .
If it fails, try to comment the line
voevent-parse>=1.0.3
in the file requirements.txt inside NITRATES repository, and repeat the installation.
NITRATES is needed for data preparation and creation of time seeds. Even in absense of NITRATES time seeds, BAT-GLIMPSE performs its own time seeds search. Notice that when Swift is in slew only BAT-GLIMPSE produces time seeds.
Developer Mode
git clone git@github.com:samueleronchini/BAT-GLIMPSE.git
cd BAT-GLIMPSE
python -m pip install -e .
Running on SciServer
BAT-GLIMPSE can run with minimal installation steps on SciServer. Create a container with HEASARC version >= 6.36, and in the pre-installed heasoft conda env run
pip install bat-glimpse
CALDB environment variables should be already loaded.
2. How to run
bat-glimpse --workdir </path/to/workdir> --trigtime <trigtime>
You can also run the package module directly:
python -m batglimpse --workdir </path/to/workdir> --trigtime <trigtime>
Main options
--workdir: required working directory for inputs and outputs.--trigtime: trigger time inYYYY-MM-DDTHH:MM:SS.sssformat.--tminand--tmax: explicit ad-hoc analysis window.--pipe:imagingormosaicfor ad-hoc analysis.--ext_obsid: override the GUANO obsid.--healpix_nside: mosaic HEALPix resolution.--skyview_nprocs: processes used while creating skyviews.--mosaic_nprocs: processes used while mosaicing.--trig_instr: Name of the triggering instrument
For --trig_instr use IGWN when it's a GW. This allows to create the preliminary maps with the partial coding distribution. Otherwise, by default the code searches for a Fermi-GBM map.
External Map Search
Fermi localization
- Uses
gdt.missions.fermiif installed. - Computes a Fermi trigger ID from
trigtime. - Downloads the localization and renames it to
ext_loc_fermi_glg_*.fits.
GW localization (IGWN only)
- Queries GraceDb for the most relevant FITS sky map.
- Downloads it to
workdir/ext_loc_*.fits.
Branch A: Ad-hoc analysis (tmin/tmax/pipe provided)
- If
pipe == imaging:- Runs
imaging()once for[tmin, tmax].
- Runs
- If
pipe == mosaic:- Runs
mosaic()once for[tmin, tmax].
- Runs
- If max SNR >= 6:
- Sorts CSVs and posts results to Slack/Telegram.
Branch B: Default analysis (no explicit window)
- NITRATES time seeds:
- If
time_seeds.csvexists and is non-empty:- Sort by
snrand take top 10 seeds. - Call
imaging()with those time windows.
- Sort by
- If empty or missing, log and continue.
- If
- SNR check:
- Reads SNR values from CSVs.
- Posts to Slack/Telegram if SNR >= 6.
- Custom seed search:
- Runs
cust_seeds(); if seeds are found, refine and re-image/mosaic:- If max SNR already >= 20, skip refinement.
- For each seed within +/- 20 s:
- Refine the seed center and duration.
- If duration <= 0.2 s: run
imaging(). - If 0.2 s <= duration < 15 s:
- Run
mosaic()if interval intersects a slew interval. - Otherwise run
imaging().
- Run
- Runs
3. Algorithm Details
imaging(t0, event, workdir, ...)
- Energy range: 15-350 keV.
- Creates skyview with:
aperture=CALDB:DETECTIONpcodethresh=0.01
- Source detection parameters:
snrthresh=5.5,srcdetect=yes
- Filters detections:
NAMEcontainsUNKNOWN.SNR > 5andCENT_SNR > 5.
- Writes
imaging.csvwith RA, Dec, SNR, CENT_SNR, partial coding, detect status, dt/duration, and energy bounds.
mosaic(t0, event, workdir, ...)
- Energy range: 15-350 keV.
- Initial duration
dt_0 = tmax - tmin. - Builds time bins in 0.2 s steps; uses a 3-bin fallback for short windows.
- Creates skyviews in parallel, then filters to those with:
sky_img,pcode_img, andbkg_stddev_imgpresent.
- If 0 valid skyviews: double
dt_0and retry. - If 1 valid skyview: fall back to that skyview.
- Otherwise mosaic with
ba.parallel.mosaic_skyview(). - Detects sources with
snrthresh=5.5. - Accepts sources with
psffwhm_separation > 1. - Writes
mosaic.csvwith RA, Dec, SNR, t_start, t_end, and energy bounds.
4. Run examples
Always pass trigger time explicitly.
python run_bat_glimpse.py \
--workdir /absolute/path/to/workdir \
--trigtime 2020-03-25T03:18:35.000
Optional ad-hoc window:
python run_bat_glimpse.py \
--workdir /absolute/path/to/workdir \
--trigtime 2020-03-25T03:18:35.000 \
--pipe imaging \
--tmin -2.0 \
--tmax 6.0
Mosaic run with explicit process counts:
python run_bat_glimpse.py \
--workdir /absolute/path/to/workdir \
--trigtime 2020-03-25T03:18:35.000 \
--pipe mosaic \
--tmin -5.0 \
--tmax 15.0 \
--healpix_nside 512 \
--skyview_nprocs 8 \
--mosaic_nprocs 8
Contact
Samuele Ronchini - Personal Website - samuele.ronchini@gssi.it
Acknowledgements
- If you make use of BAT-GLIMPSE, please cite the following papers and software:
- The BAT-GLIMPSE logo is designed by @HannahRonchiniArt
Metadata
Release files for bat-glimpse 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bat_glimpse-0.1.8.tar.gz | 32.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bat_glimpse-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.3 kB
Release files / bat_glimpse-0.1.8.tar.gz
| Download URL | bat_glimpse-0.1.8.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac80570ccfb33a9dfa395ea36467e9dc481ce3931433a4077d4765f1f1eba772
|
|
BLAKE2b-256 checksum How to use checksums |
2226ed00e71096b76c2c0fd2df7679a9e82d6786bcaa9aebbeb3ed5bc70f3f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / bat_glimpse-0.1.8-py3-none-any.whl
| Download URL | bat_glimpse-0.1.8-py3-none-any.whl |
|---|---|
| Size | 34.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e11e9ce7068f2894bfc75619900f03a919352f4e192899ff20eda12e705d5af5
|
|
BLAKE2b-256 checksum How to use checksums |
5a50a6935b7ad4e1327b90bea3efc2765d4e5210390a316735254dd77922364d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log