Metadata-Version: 2.4
Name: bat-glimpse
Version: 0.1.0
Summary: Swift BAT GUANO imaging and mosaic pipeline.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: BatAnalysis==2.1.0
Requires-Dist: astroquery>=0.4.10
Requires-Dist: astropy>=4.3.1
Requires-Dist: dpath>=2.1.4
Requires-Dist: emcee
Requires-Dist: healpy>=1.16.6
Requires-Dist: histpy>=2.0.2
Requires-Dist: joblib>=1.1.0
Requires-Dist: ligo-gracedb
Requires-Dist: ligo.skymap>=2.1.2
Requires-Dist: matplotlib>=3.4.2
Requires-Dist: mhealpy>=0.3.5
Requires-Dist: numpy>=1.24.4
Requires-Dist: pandas
Requires-Dist: reproject>=0.13.1
Requires-Dist: requests>=2.20
Requires-Dist: scipy>=1.7.2
Requires-Dist: setuptools>=58.0.4
Requires-Dist: swiftbat>=0.1.5
Requires-Dist: swifttools==3.0.22
Requires-Dist: tqdm
Requires-Dist: astro-gdt-swift>=1.0.1
Requires-Dist: astro-gdt-fermi
Requires-Dist: scikit-learn

# BAT Glimpse

## Install

After publishing to PyPI:

```bash
python -m pip install bat-glimpse
```

From the repository root before publishing:

```bash
python -m pip install .
```

## Developer Mode

```bash
git clone <repository-url>
cd BAT-GLIMPSE
python3.10 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
```

Editable mode links the installed command to this checkout, so changes under
`batglimpse/` are picked up without reinstalling the package.

Run the local checkout with:

```bash
bat-glimpse --workdir /path/to/workdir --trigtime 2026-01-01T00:00:00.000
```

or:

```bash
python -m batglimpse --workdir /path/to/workdir --trigtime 2026-01-01T00:00:00.000
```

The pipeline also expects the Swift/BAT analysis environment required by
`batanalysis` to be configured, including HEASoft/CALDB where applicable.
BAT Glimpse uses `BatAnalysis==2.1.0` and requires Python 3.10 or newer.

## Run

```bash
bat-glimpse --workdir /path/to/workdir --trigtime 2026-01-01T00:00:00.000
```

You can also run the package module directly:

```bash
python -m batglimpse --workdir /path/to/workdir --trigtime 2026-01-01T00:00:00.000
```

If `--trigtime` is omitted, BAT Glimpse reads `trigtime` from
`<workdir>/config.json`.

## Main options

- `--workdir`: required working directory for inputs and outputs.
- `--trigtime`: trigger time in `YYYY-MM-DDTHH:MM:SS.sss` format.
- `--tmin` and `--tmax`: explicit ad-hoc analysis window.
- `--pipe`: `imaging` or `mosaic` for 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.

## Outputs

BAT Glimpse writes logs, CSV detections, maps, and diagnostic plots into the
working directory. The main detection tables are `imaging.csv` and
`mosaic.csv`.

## Authentication

Set `ECHO_API_TOKEN` if Echo trigger metadata is required:

```bash
export ECHO_API_TOKEN=your-token
```
