Skip to main content

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()

Joint15 spectrum

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffuse_neutrino_flux-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

diffuse_neutrino_flux-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file diffuse_neutrino_flux-0.1.0.tar.gz.

File metadata

  • Download URL: diffuse_neutrino_flux-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.17 Linux/6.11.0-1012-azure

File hashes

Hashes for diffuse_neutrino_flux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ebb339555892269142f15b4e63ba8d23bdd71b0c2b20ce54961090ada519fd4e
MD5 89ba99706e1b5cafe79d8e26bcae6d89
BLAKE2b-256 02430f74469f9638c03006bc90e43e9b2226c6b7f8b8f305231c3774b4c1ff01

See more details on using hashes here.

File details

Details for the file diffuse_neutrino_flux-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for diffuse_neutrino_flux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25ca61a22cecd009535881a6475c80d8059a3373e4849224edaba992007717c0
MD5 82b2692ae12b00b49f812568fc2606bf
BLAKE2b-256 35a87f64dcf06112089b1333e22eefd96e1062914c6651f92ec93c8b8448a165

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