Skip to main content

Routines for analyzing data from BAT on the Neil Gehrels Swift Observatory

Project description

Contributors Forks Stargazers Issues MIT License
Google Scholar Badge ResearchGate Badge DOI ascl:2304.003


Logo

The BatAnalysis Pipeline

The BatAnalysis python pipeline is brings the analysis of BAT data to the convenience offered by Python.
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

BatAnalysis is a python package that allows for the convenient analysis of BAT Survey and Time-tagged Event (TTE) data. This code allows users to:

  • easily download BAT data,
  • batch process the observations,
  • extract light curves and spectra for each observation for a given source

For survey data in particular it allows users to:

  • create mosaiced images at different time bins, and
  • extract light curves and spectra from the mosaiced images for a given source.

This project was developed in collaboration with the members of the BAT Team including: David Palmer, Sibasish Laha, Amy Lien, and Craig Markwardt.

Built With

Getting Started

It is easy to get started on your local computer or on SciServer

Prerequisites

The following software are necessary for the BatAnalysis python module.

  1. Python 3.9 or greater
    • We recommend installing via Anaconda
  2. swiftbat_python
    • This will be installed via the pip command below
  3. Swifttools
    • This will also installed via the pip command below
  4. HEASoftPy >= v1.4.1 (HEASoft >= v6.33.2)
  5. PyXspec
  6. Swift BAT Pattern Noise Maps (necessary for the analysis of survey data)
    • The pattern maps used by the BAT team are available on zenodo for download. These maps shoud be downloaded and placed into a place where the BatAnalysis code will be able to access them.
      • This data is most easily downloaded using the zenodo_get utility, especially for installation on remote servers

Using the SciServer interface it is easier to start using BatAnalysis since HEASoftpy and pyXspec are already installed.

Getting Started on SciServer

  1. To get started on Sciserver, first follow the instructions outlined here to get an account set up and get a container up and running.

Be sure that the container that is created has a compatible python and HEASoft version

  1. With the container created, the user can install BatAnalysis through pip:
    pip install BatAnalysis
  1. The Pattern Noise Maps can easily be downloaded into the /home/idies/workspace/Temporary/<username>/scratch/ directory with the use of the zenodo_get utility. If the analyses that will be conducted will not involve survey data being mosaiced then this step can be skipped.

Getting Started on a Local Computer

To get up and running on a local computer once the prerequisites met is very simple. All that is needed to install the package is either:

A. Pip install the BatAnalysis package:

    pip install BatAnalysis

B. Clone the repo and install

git clone https://github.com/parsotat/BatAnalysis.git
cd BatAnalysis/
pip install -e .

Usage

a) Survey Data

The typical BatAnalysis workflow for analyzing survey data is as follows:

  1. Use astroquery to queue HEASARC for obervations within a given date range for an RA/DEC coordinate corresponding to a source of interest
  2. Download the data
  3. Run batsurvey on each observation ID
  4. Calculate the detector response matrix for each survey pointing
  5. Calculate the spectrum in each pointing
  6. Fit the spectra to obtain spectral information
  7. Calculate the light curve for the time period of interest
  8. Plot the light curve/spectral information
  9. Create mosaiced images for the time binning of interest (days, weeks, months, years)
  10. Create the total "time-integrated" mosaiced image
  11. Extract the spectra of the mosaiced images and fit them
  12. Calculate the light curve of the source from the mosaiced images
  13. Plot the light curve/spectral information for the mosaiced images

b) TTE Data

The typical BatAnalysis workflow for analyzing TTE data is as follows:

  1. Query TTE data based on different criteria
  2. Download the data
  3. Load the data with BatEvent
  4. Calculate sky images with the data to identify a source
  5. Mask-weight the data based on the source of interest
  6. Calculate lightcurves arbitarily binned in time and energy with the mask-weighted data
  7. Calculate spectra and the detector response matrices for a given time interval
  8. Fit the spectra to obtain spectral information
  9. Plot the light curve/spectral information

For more details and additional examples please refer to the Notebooks directory

Roadmap

Next, this package will be modified to:

  • include analysis of BAT scaled map data
  • interface with 3ML for multi-wavelength spectral fitting

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Tyler Parsotan - Personal Website - parsotat@umbc.edu

Project Link: https://github.com/parsotat/BatAnalysis.git

Acknowledgements

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

batanalysis-2.1.0.tar.gz (49.9 MB view details)

Uploaded Source

Built Distribution

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

BatAnalysis-2.1.0-py3-none-any.whl (49.6 MB view details)

Uploaded Python 3

File details

Details for the file batanalysis-2.1.0.tar.gz.

File metadata

  • Download URL: batanalysis-2.1.0.tar.gz
  • Upload date:
  • Size: 49.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.6.0 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.8.16

File hashes

Hashes for batanalysis-2.1.0.tar.gz
Algorithm Hash digest
SHA256 a6918f29c7e7d9f5026cbdb570ade1e1e9a4a4efa9da539f77691457272011bd
MD5 9c1caf0647eb46135cf64cce8259546b
BLAKE2b-256 8f9fcc7bad457f6095e9d7bbb1c0a98b6d11746c05c44789b31750f168c4252a

See more details on using hashes here.

File details

Details for the file BatAnalysis-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: BatAnalysis-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.6.0 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.8.16

File hashes

Hashes for BatAnalysis-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95f49605296a049fbbe17414d4340a492580cd262a780b9556cbeedcbb723103
MD5 ef2c670f6e17522ad91b520e6bfec9a0
BLAKE2b-256 8fa18c58783942753bbe9793572fb96c03e9ebe36984f49e3b03056a065974dc

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