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]
Release files for km3services 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| km3services-0.4.2.tar.gz | 38.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| km3services-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.0 kB
Release files / km3services-0.4.2.tar.gz
| Download URL | km3services-0.4.2.tar.gz |
|---|---|
| Size | 38.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c735e409c4bf559f51016f9323b8dbdf667d090e1dd3ad710904162a411228a
|
|
BLAKE2b-256 checksum How to use checksums |
eeabd7461b7b3cd8bd7e22c733f00eaba87faafc476d1b8d5b5f5e37c622968f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / km3services-0.4.2-py3-none-any.whl
| Download URL | km3services-0.4.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fc38058985a5a68649f2017f36d08ba43e93493b0e990c54b1929539b93598f
|
|
BLAKE2b-256 checksum How to use checksums |
1196650bb0f5c3b14bbee743aff6e410d78de03658509924919655d350e90629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|