Skip to main content

Microservices for KM3NeT

Project description

https://git.km3net.de/km3py/km3services/badges/master/pipeline.svg https://git.km3net.de/km3py/km3services/badges/master/coverage.svg https://examples.pages.km3net.de/km3badges/docs-latest-brightgreen.svg

This Python package provides access to KM3NeT microservices. It’s in an early development stage and the API will likely change any until v1.0.0 is released.

Installation

As usual, install with pip:

pip install km3services

Available Microservices

OscProb

The km3services.oscprob module wraps the OscProb package to calculate neutrino oscillation probabilities. Here is an example how to calculate the transition probabilities from muon to electron neutrino (the API will be polished soon):

from km3services.oscprob import OscProb
import numpy as np

oscprob = OscProb()  # here you can pass a different server/port

n = 1000
energies = np.random.randint(1, 50, n)  # generate `n` energies between 1-50 GeV
cos_zeniths = -np.random.rand(n) / 2
# Use PDG particle encoding!
flav_in = 12   # electron neutrino
flav_out = 14  # muon neutrino

probabilities = oscprob.oscillationprobabilities(flav_in, flav_out, energies, cos_zeniths)
print(probabilities)

The returned probabilities is a numpy array:

[4.20254330e-03 7.46278836e-05 6.18139696e-04 4.03814960e-03
3.38002558e-03 3.33962606e-04 4.53159234e-02 5.03111960e-02
...
2.23391190e-03 2.07540790e-03 6.71385177e-03 3.03348121e-02
1.86633322e-02 4.81416626e-03 4.55362912e-05 3.59935810e-03]

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

km3services-0.4.2.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

km3services-0.4.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file km3services-0.4.2.tar.gz.

File metadata

  • Download URL: km3services-0.4.2.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.1

File hashes

Hashes for km3services-0.4.2.tar.gz
Algorithm Hash digest
SHA256 4c735e409c4bf559f51016f9323b8dbdf667d090e1dd3ad710904162a411228a
MD5 b856944aed4edd4bc3ce295eb408dc4b
BLAKE2b-256 eeabd7461b7b3cd8bd7e22c733f00eaba87faafc476d1b8d5b5f5e37c622968f

See more details on using hashes here.

File details

Details for the file km3services-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: km3services-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.1

File hashes

Hashes for km3services-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6fc38058985a5a68649f2017f36d08ba43e93493b0e990c54b1929539b93598f
MD5 5371f901ae379205505fbc526098721e
BLAKE2b-256 1196650bb0f5c3b14bbee743aff6e410d78de03658509924919655d350e90629

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page