Skip to main content

Lightweight package to plot diffuse neutrino flux measurements

Project description

CI PyPI version

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.2.0.tar.gz (7.8 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.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffuse_neutrino_flux-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 eb00226d094198a88d5e8eccc1f0904d62ad211eb9a99e7ba57cafe91428dbcd
MD5 f10c5e6a82570c83f43dd99677553a2d
BLAKE2b-256 f14cc272c0ffb1074605357229c41463e898ff8cdb90af666584cae78e1061b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for diffuse_neutrino_flux-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65fc11e50bf9d9f2b7d44d6e22855417e02a7866851b8c1978354a0aca6f373f
MD5 f7de3add99ca9cfcdc1d818c12c23d39
BLAKE2b-256 1650d72ee04845b6a0b9c06b871ae2adf3676031f0d00108bab3d69260269596

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