polpy is a universal plugin for 3ML developed to analyse polarization data from X-ray/gamma-ray scattering polarimeters. In particular, it is developed to perform polarimetry of high-energy transients, such as gamma-ray bursts (GRBs). It is based polarpy (Burgess, Kole et al. 2019, A&A) tool that was developed for POLAR analysis. It can be used for current and future scattering polarimeters, provided standardized data and response format (docs/Data_and_Response_Format_For_PolPy.pdf) and a defined coordinate convention are followed (docs/Coordinate_Defintions_and_Transforms_For_PolPy.pdf).
polpy is available on PyPI and uses modern Python packaging via pyproject.toml. We recommend installing it inside a virtual environment (using conda, venv, or your preferred environment manager) to prevent dependency conflicts.
To install the latest stable version directly from PyPI, run:
pip install polpypolpy/
├── polpy/
│ ├── poldata.py # PolData: read raw polarization event files, compute PA offset
│ ├── polresponse.py # PolResponse: read + interpolate the polarization response
│ └── polarizationlike.py # PolarizationLike: the 3ML plugin (likelihood, fitting, display)
├── docs/
│ ├── Data_and_Response_Format_For_PolPy.pdf
│ └── Coordinate_Defintions_and_Transforms_For_PolPy.pdf
└── tests/ # pytest unit tests
Two reference documents ship with the repo:
docs/Data_and_Response_Format_For_PolPy.pdf— layout of thePOLEVENTSevent FITS extension and the.prspresponse FITS extensions (INEBOUNDS,SABOUNDS,INPAVALS,SPECRESP POLMATRIX,SPECRESP UNPOLMATRIX)docs/Coordinate_Defintions_and_Transforms_For_PolPy.pdf— instrument reference frame, local-tangent-plane frame, and the IAU polarization-angle offset convention used byPolData.get_pa_offset()
Sujay Mate, Hancheng Li, Utkarsh Pathak, Yashowardhan Rai, Nicholas De Angelis, Varun Bhalerao, Merlin Kole.