Skip to content
Snippets Groups Projects
Commit 46f0976c authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Add minimal run example in jupyter notebook

parent 101d3a50
No related branches found
No related tags found
No related merge requests found
Pipeline #19838 passed
%% Cell type:code id: tags:
``` python
from tempfile import TemporaryDirectory
from km3buu.jobcard import generate_neutrino_jobcard
from km3buu.jobcard import XSECTIONMODE_LOOKUP, PROCESS_LOOKUP, FLAVOR_LOOKUP
from km3buu.ctrl import run_jobcard
from km3buu.geometry import CanVolume, SphericalVolume
from km3buu.output import GiBUUOutput, write_detector_file
```
%% Cell type:markdown id: tags:
### Jobcard
%% Cell type:code id: tags:
``` python
events = 1000
energy_min = 0.1
energy_max = 50
interaction = "cc"
flavor = "electron"
target_z = 8
target_a = 16
fluxfile = None
jc = generate_neutrino_jobcard(events, interaction, flavor, (energy_min,energy_max), (target_z,target_a),fluxfile=fluxfile)
```
%% Cell type:markdown id: tags:
### Run
%% Cell type:code id: tags:
``` python
outdir = TemporaryDirectory()
run_jobcard(jc, outdir.name)
```
%% Output
2021-05-04 12:16:12 ERROR  ++ ctrl.py: GiBUU stacktrace:
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

0
%% Cell type:markdown id: tags:
### Output
%% Cell type:code id: tags:
``` python
fobj = GiBUUOutput(outdir.name)
volume = CanVolume()
# volume = SphericalVolume(100)
write_detector_file(fobj, geometry=volume)
```
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment