File: dummy.py

package info (click to toggle)
python-xrt 1.6.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 17,572 kB
  • sloc: python: 59,424; xml: 4,786; lisp: 4,082; sh: 22; javascript: 18; makefile: 17
file content (24 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
"""
Module :mod:`dummy` represents the simplest backend with the minimum output
required for building histograms. You can use this backend to generate your
simple examples, as exemplified in ``xrt_logo.py``::

    def local_output():
        # define your (x, y, intensity, cData, locNrays) here
        return x, y, intensity, energy, locNrays
    dummy.run_process = local_output #is invoked by xrt to get the rays
"""
import numpy as np

nrays = 25000


def run_process(nrays=nrays):
    nrays = int(nrays)
    x = np.random.normal(size=nrays)
    y = np.random.normal(size=nrays)
    intensity = np.ones_like(x)
    energy = x + y * 2.0 + 5000
#    energy = np.random.uniform(4998, 5002, size=locNrays)
    return x, y, intensity, energy, nrays