gammapbh 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gammapbh might be problematic. Click here for more details.

@@ -0,0 +1,198 @@
1
+ Metadata-Version: 2.4
2
+ Name: gammapbh
3
+ Version: 1.1.0
4
+ Summary: GammaPBHPlotter: a tool for calculating and visualizing Hawking radiation spectra from primordial black holes.
5
+ Author: Ilias Cholis
6
+ Author-email: John Carlini <john.carlini@oakland.edu>
7
+ Project-URL: Homepage, https://github.com/JohnCarlini/GammaPBHPlotter
8
+ Project-URL: Documentation, https://github.com/JohnCarlini/GammaPBHPlotter#readme
9
+ Project-URL: IssueTracker, https://github.com/JohnCarlini/GammaPBHPlotter/issues
10
+ Keywords: primordial black holes,Hawking radiation,gamma-ray spectra,astrophysics,cosmology
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Development Status :: 5 - Production/Stable
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE.md
21
+ Requires-Dist: numpy>=1.17
22
+ Requires-Dist: scipy>=1.7
23
+ Requires-Dist: matplotlib>=3.3
24
+ Requires-Dist: tqdm>=4.60
25
+ Requires-Dist: colorama>=0.4
26
+ Dynamic: license-file
27
+
28
+ GammaPBHPlotter Version 1.1.0 (28 October 2025)
29
+ -----------------------------------
30
+ By John Carlini (jcarlini@oakland.edu) and Ilias Cholis (cholis@oakland.edu)
31
+
32
+ INTRODUCTION
33
+ -----------------------------------
34
+ The most recent version of this program can be obtained from:
35
+ https://test.pypi.org/project/gammapbh
36
+ https://zenodo.org/records/16944093
37
+ https://test.pypi.org/project/gammapbh
38
+
39
+ This Python-coded software is designed to simulate, display, and record the Hawking gamma-ray differential spectra per unit time (d^2 Nγ/(dEγ dt)) of black holes in units of inverse megaelectron volts per second. The mass range of simulated black holes is between 5×10^13 and 1×10^19 grams. It does this through a combination of interpolating direct Hawking radiation (DHR) spectral data from the existing software BlackHawk, as well as computations of the final state radiation (FSR) from electrons and positrons, and the energy produced by the annihilation of said positrons with electrons in the interstellar medium, referred to as inflight annihilation (IFA).
40
+
41
+ DISTRIBUTION METHODS
42
+ -----------------------------------
43
+ Gamma-ray Hawking Spectra can be generated in one of many distribution methods. In monochromatic distribution all black holes possess an identical mass and by extension an identical gamma-ray Hawking spectrum. If the mass of the simulated black hole happens to align with one of the 56 pre-rendered spectra generated via BlackHawk (for DHR) and our calculations of the FSR and IFA, then the resulting spectrum is presented as is. For any other mass within the appropriate range, a new spectrum is interpolated based on that existing data.
44
+
45
+ All other means of distribution are simulated by producing a number of randomly generated black hole masses according to a probability density function. The individual spectra of each black hole are then simulated in a similar manner to the monochromatic method before being added up to produce a final result. The number of simulated black holes is inputted by the user, but a sample size of at least 1000 is a recommended minimum for accuracy. It is also worth noting that in order to better understand the average contribution of singular black holes and account for different needed sample sizes, the distributed spectra this software produces have been divided in amplitude by their sample size. So if a user were to generate a sample size of 1000, it is important to remember that the results seen and saved are only an average per black hole and would be 3 orders of magnitude lower in amplitude than the total radiation that particular number of black holes of those masses would actually produce.
46
+
47
+ What differentiates these distribution methods is what specific probability density function they follow. The Gaussian and non-Gaussian collapse PDFs are based upon a model of PBH formation and early universe structure from the paper "The Formation Probability of Primordial Black Holes" by Matteo Biagetti et al. Due to the specific limitations of that model, it only remains accurate for a limited range of values for the standard deviation (σ). Only values within that range may be simulated by this software.
48
+
49
+ 0.03 < σ < 0.255 for the case of the Gaussian collapse.
50
+ 0.04 < σ < 0.16 for the case of non-Gaussian collapse
51
+
52
+ For the lognormal distribution, it is a simpler and more malleable model which can accommodate values of standard deviations as long as σ > 0. That being said, values of σ=2 or lower are recommended for utility as any higher of a spread would most of the distribution lying outside of our mass range.
53
+
54
+ Custom distributions allow a user to enter any probability density function required in the form of a Python expression f(m). The variable "m" refers to the PBH mass in grams. Identifiers for Numpy "np." are not required and expressions like "sin", "log", "exp" etc can be entered in directly. The resulting function will always be normalized to 1 for the purposes of calculating probability. Constants may be entered into the equation, but the user will be prompted after entering to define the definition for each of them.
55
+
56
+ Running these simulations will take additional time proportional to the sample sized used. Since monochromatic distributions only have a sample size of 1, they are effectively instant.
57
+
58
+ RUNNING SIMULATIONS
59
+ -----------------------------------
60
+ No matter which of the distribution methods is needed, the act of simulating them is a similar process for users. Upon selecting their desired method, the program will send a text prompt to input the mass values most likely to appear in the distribution (referred to as your peak masses). Peak masses can be entered individually or as a series of comma separated numbers in scientific notation. I.e. 1e15, 2.5e16, 3.75e17, etc. Since masses can only be generated within the limits of 5e13 and 5e18 g, placing a peak mass too close to said limits while using a non-monochromatic distribution method can cause a significant number of the black holes to fall outside the range, have their spectra treated as 0, and cause the overall data to lose accuracy. This is less of an issue when the peak mass is near the higher end of masses (5e18 g) as masses above that value have such low values of Hawking radiation that counting them as 0 is an imperceptible difference in almost all use cases. Additionally, outside of a monochromatic distribution, the peak mass does not always coincide with the average mass. For this reason, the mean mass of simulated black holes is provided as well in graphs as well as in saved results.
61
+
62
+ If a peak mass is entered individually, two graphs will appear. One will show the number of gamma-ray photons emitted per unit energy and unit time (or dNγ/dEγ) in units of Inverse Megaelectron Volts and inverse seconds on the y-axis and Energy (E) in units of Megaelectron volts. The next graph is opened by closing the previous one and displays that same data in units of Megaelectron Volts per second. That is done by multiplying the y axis (dNγ/dEγ) of each data point by the x axis squared (E²). The first graph provides data in a form more useful for the simulation of Hawking radiation, while the second provides data in the form of the luminosity in Megaelectron Volts per second. If multiple masses are entered, the resulting spectra are presented in separate graphs. Each graph will appear once the previous one is closed in the order they were entered. Once through, all spectra as well as their cumulative sum will be presented in one final graph in units of MeV s^-1.
63
+
64
+ SAVING RESULTS
65
+ -----------------------------------
66
+ Once the final graph produced by any simulation has been closed, the program will give the user a y/n prompt of whether they would like to save their results or not. If "y" is entered, an indexed list of the entered peak masses will appear alongside a prompt asking the user which simulations to save. This task is done by entering a single number, a comma separated list of numbers, or simply pressing "0" to save all of them. Once finished, the results will automatically be saved as a .txt file in a destination folder named "results" and a specific subfolder depending on the method used to generate them. If "n" is selected, the user returns to the main menu.
67
+
68
+ Monochromatic distribution = ".../results/monochromatic"
69
+ Gaussian distribution = ".../results/gaussian"
70
+ Lognormal distribution = ".../results/lognormal"
71
+ non-Gaussian collapse = ".../results/non_gaussian"
72
+ custom distribution = "...results/custom_equation"
73
+
74
+ Within the appropriate subfolder, the results are saved as another subfolder named after the peak mass used to generate them with three significant figures. For example, a gaussian distribution with peak mass 3.1415e15 grams would be saved under ".../results/gaussian/3.14e+15". Be careful to back up your files when performing multiple simulations of identical or sufficiently close masses via the same method. You may overwrite your previous data.
75
+
76
+ Spectra generated from monochromatic distribution provide the spectra for each individual component of the spectrum (Direct Primary, Direct Secondary, Inflight Annihilation, and Final State Radiation) all in their own columns of the same file named "spectrum components". Spectra from the other three methods instead produce two files. One called "distributed_spectrum" which includes a one column spectrum of the total hawking gamma-ray spectrum as seen in the graph. Additionally, there is also the "mass_distribution' file which lists all the masses generated by the simulation as well as the average mass.
77
+
78
+ VIEWING PREVIOUS SPECTRA
79
+ -----------------------------------
80
+ If it is desired to compare spectra from different PBH mass distributions, the "view previous spectra" feature on the main menu is provided. Once selected, the user is presented with a screen similar to the main menu. The user first selects the type of PBH mass distribution, i.e. monochromatic, Gaussian, non-Gaussian, or lognormal. Then the user selects a peak mass. For the monochromatic distribution, the user may input any mass within the allowed range. For any of the other three cases, the program provides an indexed list of saved spectral files. Once all the desired file(s) are selected, the user will see a message which writes "→ Queued: {Method} {Peak Mass}" or "→ Queued: Gaussian Distribution 3.14e+15" to use the earlier example. This can be done multiple times for multiple different PBH distribution types. Once everything the user wishes to graph is selected, the user needs only to press 0 from the "previous spectra menu" to view all of them in two graphs. One of them is in units of MeV^-1 s^-1, the other in MeV s^-1.
81
+
82
+ The program has been tested on windows 11, Mac, and Linux devices.
83
+
84
+ If you use GammaPBHPlotter to write a paper, please cite:
85
+
86
+ linktocitation.placeholder
87
+
88
+ As well as the paper published for the BlackHawk software.
89
+
90
+ A. Arbey and J. Auffinger, Eur. Phys. J. C79 (2019) 693, arXiv:1905.04268 [gr-qc]
91
+ A. Arbey and J. Auffinger, Eur. Phys. J. C81 (2021) 910, arXiv:2108.02737 [gr-qc]
92
+
93
+ And if you use the gaussian or non-gaussian collapse for your paper, please cite Biagetti et al.
94
+
95
+ M. Biagetti, V. De Luca, G. Franciolini, A. Kehagias and A. Riotto, Phys. Lett. B 820 (2021) 136602, arXiv:2105.07810 [astro-ph.CO].
96
+
97
+ arXiv:2105.07810
98
+
99
+ INSTALLATION
100
+ -----------------------------------
101
+
102
+ GammaPBHPlotter v1.1.0 is now distributed as a Python package and can be installed directly from PyPI using pip.
103
+
104
+ REQUIREMENTS
105
+ -----------------------------------
106
+ - Python 3.9 or newer
107
+ - Internet connection (for first-time installation of dependencies)
108
+
109
+ The following modules will be automatically installed by pip if not already present:
110
+ colorama
111
+ numpy
112
+ matplotlib
113
+ tqdm
114
+ scipy
115
+
116
+ INSTALLATION STEPS
117
+ -----------------------------------
118
+
119
+ Option A — Recommended (via pip):
120
+ pip install gammapbh
121
+
122
+ You can then run the program directly from your terminal with:
123
+ gammapbh
124
+
125
+ or equivalently:
126
+ python -m gammapbh
127
+
128
+ Option B — Manual build (from source):
129
+ git clone https://github.com/jcarlini-dot/GammaPBHPlotter
130
+ cd GammaPBHPlotter
131
+ python -m pip install .
132
+
133
+ To verify a successful installation:
134
+ python -c "import gammapbh, importlib.metadata as md; print(gammapbh.__version__, md.version('gammapbh'))"
135
+
136
+ Both commands should print 1.1.0.
137
+
138
+
139
+ INCLUDED FILES
140
+ -----------------------------------
141
+
142
+ Top-Level Project Structure:
143
+ GammaPBHPlotter/
144
+
145
+ ├── pyproject.toml (Build configuration for pip and PyPI)
146
+ ├── LICENSE (GNU GPL v3 license)
147
+ ├── README.txt (This documentation file)
148
+ ├── CITATION.cff (Citation metadata for Zenodo and GitHub)
149
+ ├── CHANGELOG.md (Version history and updates)
150
+
151
+ ├── src/
152
+ │ └── gammapbh/
153
+ │ ├── __init__.py
154
+ │ ├── __main__.py (Enables 'python -m gammapbh')
155
+ │ ├── cli.py (Primary program logic and CLI interface)
156
+ │ ├── blackhawk_data/ (Tables from the BlackHawk software)
157
+ │ └── results/ (Default save directory, auto-created)
158
+
159
+ └── tests/ (optional) (Unit tests or validation scripts)
160
+
161
+
162
+ FILE AND FOLDER DESCRIPTIONS
163
+ -----------------------------------
164
+ src/gammapbh/cli.py = Core logic for spectrum interpolation, PDF sampling, and visualization.
165
+ src/gammapbh/__main__.py = Enables running the software with "python -m gammapbh".
166
+ src/gammapbh/blackhawk_data/ = Precomputed spectral tables from BlackHawk (Arbey & Auffinger 2019, 2021).
167
+ src/gammapbh/results/ = Auto-generated output directory for saved spectra; initially empty.
168
+ LICENSE = Terms of redistribution under GNU GPL v3.
169
+ CITATION.cff = Citation metadata for Zenodo and scholarly references.
170
+ README.txt = Full user guide (this file).
171
+ CHANGELOG.md = Summarized update history for each release.
172
+
173
+
174
+
175
+ HISTORY
176
+ -----------------------------------
177
+
178
+ v1.0.0 - 08/25/2025
179
+ - First public release as an executable.
180
+ v1.1.0 - 10/28/2025
181
+ - Released as a Python Package on PyPi
182
+ - Added the ability to enter custom PDF equations.
183
+
184
+
185
+ LICENSE
186
+ -----------------------------------
187
+
188
+ This program is free software: you can redistribute it and/or modify
189
+ it under the terms of the GNU General Public License as published by
190
+ the Free Software Foundation, either version 3 of the License, or any
191
+ later version.
192
+
193
+ This program is distributed in the hope that it will be useful,
194
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
195
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
196
+ GNU General Public License for more details.
197
+
198
+ See <http://www.gnu.org/licenses/>.
@@ -0,0 +1,9 @@
1
+ gammapbh/__init__.py,sha256=8rBfjxeDWCV2gXVMk7y3iuCUBRE4vq8McMi493G6-ec,89
2
+ gammapbh/__main__.py,sha256=t_WljoWrFzMovSaUOtT0SoRNPgZEBfWxrfbVuYUZLJc,97
3
+ gammapbh/cli.py,sha256=ym3lluRJY3IFb3WPInNyD91BGZsnyuiiltE_IbuS3UI,60967
4
+ gammapbh-1.1.0.dist-info/licenses/LICENSE.md,sha256=VgknRTqdic5Rq5oNEH7ohAowgCySNKytlUF0xY4Ac00,38116
5
+ gammapbh-1.1.0.dist-info/METADATA,sha256=aRyRvIOfReOVY_IuPdOCEZcdQlomqcdZjnk1L-U7pn8,15248
6
+ gammapbh-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ gammapbh-1.1.0.dist-info/entry_points.txt,sha256=3Ys819NgVTVXcgWXdaAGAGFL7TBG685ZcA-0qyrV2yE,47
8
+ gammapbh-1.1.0.dist-info/top_level.txt,sha256=Sam7zwAP6K502sJMyVIKxD0J9B7vdUH-WxgU4MAZLo4,9
9
+ gammapbh-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ gammapbh = gammapbh.cli:main