diff options
author | Nao Pross <np@0hm.ch> | 2021-12-16 18:16:31 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-12-16 18:16:31 +0100 |
commit | 6964c9b50490003a4e2da939a020850d31dc8777 (patch) | |
tree | 53e5f57b5685ec71d361468de0e7b6c69fda5075 /doc/thesis/figures/data | |
parent | GUI angepasst (diff) | |
download | Fading-6964c9b50490003a4e2da939a020850d31dc8777.tar.gz Fading-6964c9b50490003a4e2da939a020850d31dc8777.zip |
Figures for statistical model
Diffstat (limited to 'doc/thesis/figures/data')
-rw-r--r-- | doc/thesis/figures/data/rice_pdf.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/thesis/figures/data/rice_pdf.py b/doc/thesis/figures/data/rice_pdf.py new file mode 100644 index 0000000..110b6b3 --- /dev/null +++ b/doc/thesis/figures/data/rice_pdf.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os +import numpy as np + +a = np.linspace(0, 3, num=100) + +ps = [] +for k in [0, 2, 5, 10]: + p = 2 * a * (1 + k) * np.exp(-k - (a**2) * (k + 1)) \ + * np.i0(2 * a * np.sqrt(k * (1 + k))) + + ps += [p] + + +data = np.array(list(zip(a, *ps))) + +# save to file +location = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) +name, _ = os.path.splitext(os.path.basename(__file__)) +filename = os.path.join(location, name + ".dat") +np.savetxt(filename, data, fmt='%.6e') |