Lightweight package to plot diffuse neutrino flux measurements
Project description
Add diffuse neutrino flux measurements to your plots
Usage
The central object is the Spectrum. Curently implented spectral shapes are the SinglePowerLaw, BrokenPowerLaw and the LogParabola. The impleneted measurements can be found in diffuse_neutrino_flux/data/measurements.json. They can be shown by
from diffuse_neutrino_flux import Spectrum
print(Spectrum.list_available_spectra())
The spectrum can be plotted. If a contour file is available, also the corresponding butterfly can be shown. The energy_scaling parameter can be used to scale the energy axis. All other parameters are passed to the matplotlib plot function.
import matplotlib.pyplot as plt
from diffuse_neutrino_flux import Spectrum
s = Spectrum.from_key("joint15")
fig, ax = plt.subplots()
s.plot(ax=ax, label="Joint15", color="blue", energy_scaling=2)
s.plot_cl(ax=ax, color="blue", alpha=0.5, energy_scaling=2)
ax.set_xlabel("Energy [GeV]")
ax.set_ylabel("Flux [GeV cm$^{-2}$ s$^{-1}$ sr$^{-1}$]")
ax.set_xscale("log")
ax.set_yscale("log")
ax.legend()
plt.show()
Adding new measurements
To add a new measurement, you need to create a new entry in diffuse_neutrino_flux/data/measurements.json. To be able to plot the butterfly, you also need to create a contour file. Simply trace the contour scan in the parameter plane and add the data as a CSV file in diffuse_neutrino_flux/data/ as <new_measurement_name>_contour<confidence_level>.csv.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffuse_neutrino_flux-0.3.0.tar.gz.
File metadata
- Download URL: diffuse_neutrino_flux-0.3.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.10.18 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a8aa8bffff03c8f2bc526c82f71f60ca01b871dc595c4ee635f4783300ecc6a
|
|
| MD5 |
b0ef83c481a17ebd60ca80b4f922055d
|
|
| BLAKE2b-256 |
f8f49f9020e72d6d155b7f6e533757fcb318d7ab268f246b400e79b16d13fa8b
|
File details
Details for the file diffuse_neutrino_flux-0.3.0-py3-none-any.whl.
File metadata
- Download URL: diffuse_neutrino_flux-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.10.18 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2c9658e16c20bea47a57f4aed34b3c00c1733dd0c84f91a72e855ecdb53e00f
|
|
| MD5 |
b46e373043a819808ed3736349a67446
|
|
| BLAKE2b-256 |
492401eb561ed9bde27da95e4db0b78ef01028459c4e893bc3f28413af1fda7f
|