The BatAnalysis python pipeline is brings the analysis of BAT data to the convenience offered by Python.
Explore the docs »
Report Bug
·
Request Feature
BatAnalysis is a python package that allows for the convenient analysis of BAT Survey data. This code allows users to:
This project was developed in collaboration with the members of the BAT Team including: Sibasish Laha, David Palmer, Amy Lien and Craig Markwardt.
To get a local copy up and running follow these simple steps.
The following software are necessary for the BatAnalysis python module.
1a. Install the BatAnalysis package with Pip
pip install BatAnalysis
1b. Clone the repo and install
git clone https://github.com/parsotat/BatAnalysis.git
cd BatAnalysis/
pip install -e .
The typical BatAnalysis workflow is as follows:
Following these steps for the first 5 survey observation IDs for the Crab (although see the notebooks directory for recommended analysis steps):
import batanalysis as ba
import swiftbat
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
plt.ion()
object_name='Crab'
catalog_name="Crab_Nebula_Pulsar"
table = ba.from_heasarc(object_name)
result = ba.download_swiftdata(table[:5])
batsurvey_obs=ba.parallel.batsurvey_analysis(table["OBSID"][:5], nprocs=2)
#the name of the source in the included survey catalog must be used here
noise_map_dir=Path("/path/to/downloaded/PATTERN_MAPS/")
batsurvey_obs=ba.parallel.batspectrum_analysis(batsurvey_obs, catalog_name, patt_noise_dir=noise_map_dir, nprocs=2)
ba.plot_survey_lc(batsurvey_obs, id_list=catalog_name, calc_lc=True)
outventory_file=ba.merge_outventory(batsurvey_obs)
#bin into 1 month time bins
time_bins=ba.group_outventory(outventory_file, np.timedelta64(1,'M'))
#bin into daily time bin
mosaic_list, total_mosaic=ba.parallel.batmosaic_analysis(batsurvey_obs, outventory_file, time_bins, nprocs=3)
mosaic_list=ba.parallel.batspectrum_analysis(mosaic_list, catalog_name, nprocs=2)
ba.plot_survey_lc(mosaic_list, id_list=catalog_name, calc_lc=True)
For more details and additional examples please refer to the Notebooks directory
This package will soon be modified to include analysis of BAT event data.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Tyler Parsotan - Personal Website - parsotat@umbc.edu
Project Link: https://github.com/parsotat/BatAnalysis.git