diff options
Diffstat (limited to '')
-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') |