osiris-utils 1.1.10a0__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- benchmarks/benchmark_hdf5_io.py +46 -0
- benchmarks/benchmark_load_all.py +54 -0
- docs/source/api/decks.rst +48 -0
- docs/source/api/postprocess.rst +66 -2
- docs/source/api/sim_diag.rst +1 -1
- docs/source/api/utilities.rst +1 -1
- docs/source/conf.py +2 -1
- docs/source/examples/example_Derivatives.md +78 -0
- docs/source/examples/example_FFT.md +152 -0
- docs/source/examples/example_InputDeck.md +148 -0
- docs/source/examples/example_Simulation_Diagnostic.md +213 -0
- docs/source/examples/quick_start.md +51 -0
- docs/source/examples.rst +14 -0
- docs/source/index.rst +8 -0
- examples/edited-deck.1d +1 -1
- examples/example_Derivatives.ipynb +24 -36
- examples/example_FFT.ipynb +44 -23
- examples/example_InputDeck.ipynb +24 -277
- examples/example_Simulation_Diagnostic.ipynb +27 -17
- examples/quick_start.ipynb +17 -1
- osiris_utils/__init__.py +10 -6
- osiris_utils/cli/__init__.py +6 -0
- osiris_utils/cli/__main__.py +85 -0
- osiris_utils/cli/export.py +199 -0
- osiris_utils/cli/info.py +156 -0
- osiris_utils/cli/plot.py +189 -0
- osiris_utils/cli/validate.py +247 -0
- osiris_utils/data/__init__.py +15 -0
- osiris_utils/data/data.py +41 -171
- osiris_utils/data/diagnostic.py +285 -274
- osiris_utils/data/simulation.py +20 -13
- osiris_utils/decks/__init__.py +4 -0
- osiris_utils/decks/decks.py +83 -8
- osiris_utils/decks/species.py +12 -9
- osiris_utils/postprocessing/__init__.py +28 -0
- osiris_utils/postprocessing/derivative.py +317 -106
- osiris_utils/postprocessing/fft.py +135 -24
- osiris_utils/postprocessing/field_centering.py +28 -14
- osiris_utils/postprocessing/heatflux_correction.py +39 -18
- osiris_utils/postprocessing/mft.py +10 -2
- osiris_utils/postprocessing/postprocess.py +8 -5
- osiris_utils/postprocessing/pressure_correction.py +29 -17
- osiris_utils/utils.py +26 -17
- osiris_utils/vis/__init__.py +3 -0
- osiris_utils/vis/plot3d.py +148 -0
- {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/METADATA +55 -7
- {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/RECORD +51 -34
- {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/WHEEL +1 -1
- osiris_utils-1.2.0.dist-info/entry_points.txt +2 -0
- {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/top_level.txt +1 -0
- osiris_utils/postprocessing/mft_for_gridfile.py +0 -55
- {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/licenses/LICENSE.txt +0 -0
osiris_utils/utils.py
CHANGED
|
@@ -8,6 +8,18 @@ import numpy as np
|
|
|
8
8
|
import pandas as pd
|
|
9
9
|
import scipy
|
|
10
10
|
|
|
11
|
+
__all__ = [
|
|
12
|
+
"courant2D",
|
|
13
|
+
"time_estimation",
|
|
14
|
+
"filesize_estimation",
|
|
15
|
+
"transverse_average",
|
|
16
|
+
"integrate",
|
|
17
|
+
"save_data",
|
|
18
|
+
"read_data",
|
|
19
|
+
"convert_tracks",
|
|
20
|
+
"create_file_tags",
|
|
21
|
+
]
|
|
22
|
+
|
|
11
23
|
|
|
12
24
|
def courant2D(dx: float, dy: float) -> float:
|
|
13
25
|
"""
|
|
@@ -87,32 +99,29 @@ def transverse_average(data: np.ndarray) -> np.ndarray:
|
|
|
87
99
|
return cast(np.ndarray, np.mean(data, axis=1))
|
|
88
100
|
|
|
89
101
|
|
|
90
|
-
def integrate(array: np.ndarray, dx: float) -> np.ndarray:
|
|
102
|
+
def integrate(array: np.ndarray, dx: float, axis: int = None) -> np.ndarray:
|
|
91
103
|
"""
|
|
92
|
-
Integrate a
|
|
93
|
-
|
|
104
|
+
Integrate a N-D array using the cumulative Simpson's rule, from right to left
|
|
105
|
+
along a given axis
|
|
94
106
|
|
|
95
107
|
Parameters
|
|
96
108
|
----------
|
|
97
109
|
array : numpy.ndarray
|
|
98
|
-
Dim: 1D.
|
|
99
110
|
The input array.
|
|
100
111
|
dx : float
|
|
101
112
|
The spacing between points.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
numpy.ndarray
|
|
106
|
-
Dim: 1D.
|
|
107
|
-
The integrated array.
|
|
113
|
+
axis : int, optional
|
|
114
|
+
The axis along which to integrate. If None, the default is 0.
|
|
115
|
+
This will assume that the input array is 1D.
|
|
108
116
|
"""
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
if axis is None: # Assume 1D array
|
|
118
|
+
if len(array.shape) != 1:
|
|
119
|
+
raise ValueError("The input array must be 1D when axis is None.")
|
|
120
|
+
axis = 0
|
|
121
|
+
flip_array = np.flip(array, axis=axis)
|
|
113
122
|
# int = -scipy.integrate.cumulative_trapezoid(flip_array, dx = dx, initial = flip_array[0])
|
|
114
|
-
int = -scipy.integrate.cumulative_simpson(flip_array, dx=dx, initial=0)
|
|
115
|
-
return cast(np.ndarray, np.flip(int))
|
|
123
|
+
int = -scipy.integrate.cumulative_simpson(flip_array, dx=dx, initial=0, axis=axis)
|
|
124
|
+
return cast(np.ndarray, np.flip(int, axis=axis))
|
|
116
125
|
|
|
117
126
|
|
|
118
127
|
def save_data(data: np.ndarray, savename: str, option: str = "numpy") -> None:
|
|
@@ -175,7 +184,7 @@ def convert_tracks(filename_in: str) -> str:
|
|
|
175
184
|
|
|
176
185
|
try:
|
|
177
186
|
file_in = h5py.File(filename_in, "r")
|
|
178
|
-
except
|
|
187
|
+
except OSError:
|
|
179
188
|
print("cannot open " + filename_in)
|
|
180
189
|
exit()
|
|
181
190
|
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
__all__ = ["plot_3d"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def plot_3d(
|
|
11
|
+
diagnostic,
|
|
12
|
+
idx: int,
|
|
13
|
+
scale_type: Literal["zero_centered", "pos", "neg", "default"] = "default",
|
|
14
|
+
boundaries: np.ndarray = None,
|
|
15
|
+
):
|
|
16
|
+
"""
|
|
17
|
+
Plots a 3D scatter plot of the diagnostic data (grid data).
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
diagnostic : Diagnostic
|
|
22
|
+
The diagnostic object containing the data.
|
|
23
|
+
idx : int
|
|
24
|
+
Index of the data to plot.
|
|
25
|
+
scale_type : Literal["zero_centered", "pos", "neg", "default"], optional
|
|
26
|
+
Type of scaling for the colormap:
|
|
27
|
+
- "zero_centered": Center colormap around zero.
|
|
28
|
+
- "pos": Colormap for positive values.
|
|
29
|
+
- "neg": Colormap for negative values.
|
|
30
|
+
- "default": Standard colormap.
|
|
31
|
+
boundaries : np.ndarray, optional
|
|
32
|
+
Boundaries to plot part of the data. (3,2) If None, uses the default grid boundaries.
|
|
33
|
+
|
|
34
|
+
Returns
|
|
35
|
+
-------
|
|
36
|
+
fig : matplotlib.figure.Figure
|
|
37
|
+
The figure object containing the plot.
|
|
38
|
+
ax : matplotlib.axes._subplots.Axes3DSubplot
|
|
39
|
+
The 3D axes object of the plot.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
if diagnostic.dim != 3:
|
|
43
|
+
raise ValueError("This method is only available for 3D diagnostics.")
|
|
44
|
+
|
|
45
|
+
if boundaries is None:
|
|
46
|
+
boundaries = diagnostic.grid
|
|
47
|
+
|
|
48
|
+
if not isinstance(boundaries, np.ndarray):
|
|
49
|
+
try:
|
|
50
|
+
boundaries = np.array(boundaries)
|
|
51
|
+
except Exception:
|
|
52
|
+
boundaries = diagnostic.grid
|
|
53
|
+
warnings.warn("boundaries cannot be accessed as a numpy array with shape (3, 2), using default instead", stacklevel=2)
|
|
54
|
+
|
|
55
|
+
if boundaries.shape != (3, 2):
|
|
56
|
+
warnings.warn("boundaries should have shape (3, 2), using default instead", stacklevel=2)
|
|
57
|
+
boundaries = diagnostic.grid
|
|
58
|
+
|
|
59
|
+
# Load data
|
|
60
|
+
# Access private attributes if necessary, but prefer public properties if available
|
|
61
|
+
# diagnostic.data is a property, but it might not be loaded for specific index if not load_all
|
|
62
|
+
# The original code used self._all_loaded and self._data vs self[idx]
|
|
63
|
+
|
|
64
|
+
# Check if we can access _all_loaded, otherwise assume we need to load
|
|
65
|
+
if hasattr(diagnostic, "_all_loaded") and diagnostic._all_loaded:
|
|
66
|
+
data = diagnostic._data[idx]
|
|
67
|
+
else:
|
|
68
|
+
data = diagnostic[idx]
|
|
69
|
+
|
|
70
|
+
X, Y, Z = np.meshgrid(diagnostic.x[0], diagnostic.x[1], diagnostic.x[2], indexing="ij")
|
|
71
|
+
|
|
72
|
+
# Flatten arrays for scatter plot
|
|
73
|
+
(
|
|
74
|
+
X_flat,
|
|
75
|
+
Y_flat,
|
|
76
|
+
Z_flat,
|
|
77
|
+
) = (
|
|
78
|
+
X.ravel(),
|
|
79
|
+
Y.ravel(),
|
|
80
|
+
Z.ravel(),
|
|
81
|
+
)
|
|
82
|
+
data_flat = data.ravel()
|
|
83
|
+
|
|
84
|
+
# Apply filter: Keep only chosen points
|
|
85
|
+
mask = (
|
|
86
|
+
(X_flat > boundaries[0][0])
|
|
87
|
+
& (X_flat < boundaries[0][1])
|
|
88
|
+
& (Y_flat > boundaries[1][0])
|
|
89
|
+
& (Y_flat < boundaries[1][1])
|
|
90
|
+
& (Z_flat > boundaries[2][0])
|
|
91
|
+
& (Z_flat < boundaries[2][1])
|
|
92
|
+
)
|
|
93
|
+
X_cut, Y_cut, Z_cut, data_cut = (
|
|
94
|
+
X_flat[mask],
|
|
95
|
+
Y_flat[mask],
|
|
96
|
+
Z_flat[mask],
|
|
97
|
+
data_flat[mask],
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
if scale_type == "zero_centered":
|
|
101
|
+
# Center colormap around zero
|
|
102
|
+
cmap = "seismic"
|
|
103
|
+
vmax = np.max(np.abs(data_flat)) # Find max absolute value
|
|
104
|
+
vmin = -vmax
|
|
105
|
+
elif scale_type == "pos":
|
|
106
|
+
cmap = "plasma"
|
|
107
|
+
vmax = np.max(data_flat)
|
|
108
|
+
vmin = 0
|
|
109
|
+
|
|
110
|
+
elif scale_type == "neg":
|
|
111
|
+
cmap = "plasma"
|
|
112
|
+
vmax = 0
|
|
113
|
+
vmin = np.min(data_flat)
|
|
114
|
+
else:
|
|
115
|
+
cmap = "plasma"
|
|
116
|
+
vmax = np.max(data_flat)
|
|
117
|
+
vmin = np.min(data_flat)
|
|
118
|
+
|
|
119
|
+
norm = plt.Normalize(vmin=vmin, vmax=vmax)
|
|
120
|
+
|
|
121
|
+
# Plot
|
|
122
|
+
fig = plt.figure(figsize=(10, 7))
|
|
123
|
+
ax = fig.add_subplot(111, projection="3d")
|
|
124
|
+
|
|
125
|
+
# Scatter plot with seismic colormap
|
|
126
|
+
sc = ax.scatter(X_cut, Y_cut, Z_cut, c=data_cut, cmap=cmap, norm=norm, alpha=1)
|
|
127
|
+
|
|
128
|
+
# Set limits to maintain full background
|
|
129
|
+
ax.set_xlim(*diagnostic.grid[0])
|
|
130
|
+
ax.set_ylim(*diagnostic.grid[1])
|
|
131
|
+
ax.set_zlim(*diagnostic.grid[2])
|
|
132
|
+
|
|
133
|
+
# Colorbar
|
|
134
|
+
cbar = plt.colorbar(sc, ax=ax, shrink=0.6)
|
|
135
|
+
|
|
136
|
+
# Labels
|
|
137
|
+
# Use public properties where possible
|
|
138
|
+
cbar.set_label(rf"${diagnostic.name}$" + rf"$\ [{diagnostic.units}]$")
|
|
139
|
+
|
|
140
|
+
# time(idx) returns [value, unit]
|
|
141
|
+
t_val, t_unit = diagnostic.time(idx)
|
|
142
|
+
ax.set_title(rf"$t={t_val:.2f}$" + rf"$\ [{t_unit}]$")
|
|
143
|
+
|
|
144
|
+
ax.set_xlabel(r"${}$".format(diagnostic.axis[0]["long_name"]) + r"$\ [{}]$".format(diagnostic.axis[0]["units"]))
|
|
145
|
+
ax.set_ylabel(r"${}$".format(diagnostic.axis[1]["long_name"]) + r"$\ [{}]$".format(diagnostic.axis[1]["units"]))
|
|
146
|
+
ax.set_zlabel(r"${}$".format(diagnostic.axis[2]["long_name"]) + r"$\ [{}]$".format(diagnostic.axis[2]["units"]))
|
|
147
|
+
|
|
148
|
+
return fig, ax
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osiris_utils
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Utilities to manipulate and visualise OSIRIS plasma PIC output data
|
|
5
5
|
Author-email: João Pedro Ferreira Biu <joaopedrofbiu@tecnico.ulisboa.pt>
|
|
6
6
|
License: MIT
|
|
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Science/Research
|
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -32,7 +30,6 @@ Requires-Dist: pytest>=8.1; extra == "dev"
|
|
|
32
30
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
33
31
|
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
34
32
|
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
35
|
-
Requires-Dist: isort>=5.13; extra == "dev"
|
|
36
33
|
Requires-Dist: types-tqdm; extra == "dev"
|
|
37
34
|
Requires-Dist: types-Pillow; extra == "dev"
|
|
38
35
|
Provides-Extra: docs
|
|
@@ -51,11 +48,13 @@ OSIRIS_UTILS
|
|
|
51
48
|
.. image:: https://github.com/joaopedrobiu6/osiris_utils/actions/workflows/ci.yml/badge.svg
|
|
52
49
|
:target: https://github.com/joaopedrobiu6/osiris_utils/actions
|
|
53
50
|
:alt: CI status
|
|
51
|
+
|
|
54
52
|
.. image:: https://codecov.io/gh/joaopedrobiu6/osiris_utils/branch/main/graph/badge.svg
|
|
55
53
|
:target: https://codecov.io/gh/joaopedrobiu6/osiris_utils
|
|
56
54
|
:alt: Coverage
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
.. image:: https://zenodo.org/badge/889119723.svg
|
|
57
|
+
:target: https://doi.org/10.5281/zenodo.17382244
|
|
59
58
|
|
|
60
59
|
This package contains a set of utilities to open and analyze OSIRIS output files, using Python. All the methods implemented are fully integrated with `NumPy`, and use `np.ndarray` as the main data structure.
|
|
61
60
|
High-level functions are provided to manipulate data from OSIRIS, from reading the data of the diagnostics, to making post-processing calculations.
|
|
@@ -95,6 +94,48 @@ Quick-start
|
|
|
95
94
|
cd osiris_utils
|
|
96
95
|
python examples/quick_start.py examples/example_data/thermal.1d
|
|
97
96
|
|
|
97
|
+
Command-Line Interface
|
|
98
|
+
----------------------
|
|
99
|
+
|
|
100
|
+
osiris_utils includes a command-line interface for common operations. After installation, the ``osiris`` command becomes available::
|
|
101
|
+
|
|
102
|
+
osiris --version # Check version
|
|
103
|
+
osiris --help # Show available commands
|
|
104
|
+
|
|
105
|
+
**Available Commands:**
|
|
106
|
+
|
|
107
|
+
- ``osiris info`` - Display metadata about OSIRIS files and simulations
|
|
108
|
+
- ``osiris export`` - Convert data to CSV, JSON, or NumPy formats
|
|
109
|
+
- ``osiris plot`` - Create quick visualizations
|
|
110
|
+
- ``osiris validate`` - Check file integrity
|
|
111
|
+
|
|
112
|
+
**Examples:**
|
|
113
|
+
|
|
114
|
+
Show simulation information::
|
|
115
|
+
|
|
116
|
+
osiris info path/to/simulation
|
|
117
|
+
osiris info path/to/file.h5 --brief
|
|
118
|
+
|
|
119
|
+
Export data to different formats::
|
|
120
|
+
|
|
121
|
+
osiris export file.h5 --format csv --output data.csv
|
|
122
|
+
osiris export diagnostic/dir --format npy --output data.npy
|
|
123
|
+
|
|
124
|
+
Generate quick plots::
|
|
125
|
+
|
|
126
|
+
osiris plot file.h5 --save plot.png
|
|
127
|
+
osiris plot file.h5 --save plot.png --title "Ez Field" --cmap viridis
|
|
128
|
+
|
|
129
|
+
Validate simulation data::
|
|
130
|
+
|
|
131
|
+
osiris validate path/to/simulation
|
|
132
|
+
osiris validate path/to/simulation --check-missing
|
|
133
|
+
|
|
134
|
+
For detailed help on any command::
|
|
135
|
+
|
|
136
|
+
osiris <command> --help
|
|
137
|
+
|
|
138
|
+
|
|
98
139
|
Documentation
|
|
99
140
|
-------------
|
|
100
141
|
|
|
@@ -106,7 +147,14 @@ The documentation is available at https://osiris-utils.readthedocs.io or via thi
|
|
|
106
147
|
|
|
107
148
|
.. _authors:
|
|
108
149
|
|
|
109
|
-
|
|
110
|
-
|
|
150
|
+
Author
|
|
151
|
+
------
|
|
111
152
|
|
|
112
153
|
- João Biu
|
|
154
|
+
|
|
155
|
+
Contributors
|
|
156
|
+
------------
|
|
157
|
+
|
|
158
|
+
- Diogo Carvalho
|
|
159
|
+
- João Cândido
|
|
160
|
+
- Margarida Pereira
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
benchmarks/benchmark_hdf5_io.py,sha256=62TM4A6XuNKUNh7-B9lE7Zbd7IlGBXbiTNeJCXvVdhE,1228
|
|
2
|
+
benchmarks/benchmark_load_all.py,sha256=GKCFf-aJIGZ7E7IfyiziSd1dqFnC_jzgmsAW50f9OyM,1589
|
|
3
|
+
docs/source/conf.py,sha256=MT6jDTKyZQJTq5iEQ9W1yEWcUO2sqiW9ocs6pN8kzzQ,6096
|
|
2
4
|
docs/source/contrib.rst,sha256=CkYSzy3msde38fy0zROAjDsdRHYYvQSAJwjkJczFmGI,35
|
|
3
|
-
docs/source/
|
|
5
|
+
docs/source/examples.rst,sha256=IFl6kRAYUHO1hmExBYKBCPPFjS82gol8cQYXLNawsi8,303
|
|
6
|
+
docs/source/index.rst,sha256=djTvENMR-HNC5q0Wh8hsrB7in5IY6augL9OLxnlpsFA,599
|
|
4
7
|
docs/source/_static/custom.css,sha256=aLsKMK8rejJzzCdISkHhDG8Eq-f7T4v4DmQInYzeRDI,909
|
|
5
8
|
docs/source/_static/quick_start_ez.png,sha256=_pxXBOTl30EMkCcbiehp-F0vk-nd8r9VF25Cz4tORPU,50829
|
|
6
|
-
docs/source/api/
|
|
7
|
-
docs/source/api/
|
|
8
|
-
docs/source/api/
|
|
9
|
-
|
|
10
|
-
examples/example_Derivatives.
|
|
11
|
-
examples/example_FFT.
|
|
12
|
-
examples/example_InputDeck.
|
|
13
|
-
examples/example_Simulation_Diagnostic.
|
|
14
|
-
examples/quick_start.
|
|
9
|
+
docs/source/api/decks.rst,sha256=i-4T68MWYtsIF6uoMJPeOuL5zHnbpRu8mxBwBz9MXVA,1153
|
|
10
|
+
docs/source/api/postprocess.rst,sha256=2E5z_xevGPYeWjdN_6RAtU-XWK83mmixzOznbWEs3_k,21706
|
|
11
|
+
docs/source/api/sim_diag.rst,sha256=S02gqg55jenzpLpbUvWBuOBRkLLOZhgtILz6SXhhTZQ,8787
|
|
12
|
+
docs/source/api/utilities.rst,sha256=B1mI2I7AKl3tXQ0MqNSN6Vxj_ZHU_Qvmp20hiYgK5jw,9614
|
|
13
|
+
docs/source/examples/example_Derivatives.md,sha256=p0tLobnmLyFKPkDSeFshKpzYi4rYVjBnn2oo_ekcB7g,2378
|
|
14
|
+
docs/source/examples/example_FFT.md,sha256=JbFNm0C8EVEhnY6vTiKFD2IKBVwFoCpv-35OcrzRl7M,6086
|
|
15
|
+
docs/source/examples/example_InputDeck.md,sha256=Cf4s7_XFqPXp5eovHsPhQGu7UKF4GXis4eVel2TUrXw,4327
|
|
16
|
+
docs/source/examples/example_Simulation_Diagnostic.md,sha256=ixCw2fg-08Y2NHKjAIiPeZX2DUuQ3BdxFYuh07xwTso,7456
|
|
17
|
+
docs/source/examples/quick_start.md,sha256=yt0b9Lz85ylMGEZPKLQpD7qFeISkEJo_FutMJP6wSu4,837
|
|
18
|
+
examples/edited-deck.1d,sha256=D6fIVzw_mtSnQbQPALs9tl9Fnm2oBnRJuWu7ecCKv4U,1018
|
|
19
|
+
examples/example_Derivatives.ipynb,sha256=L9NBEdTLMv7n7og0o9tvQ0We77vuCJVAzMIAAQcRd4k,4584
|
|
20
|
+
examples/example_FFT.ipynb,sha256=bOb1VWZYpTw4zct8-sxr7AbNGhz3ZrB7eW5Pl84MaGc,9093
|
|
21
|
+
examples/example_InputDeck.ipynb,sha256=k4fD_3SwwHVWe6r19ZxwyPIvGN3r04lDUWeqW3SMTgc,7484
|
|
22
|
+
examples/example_Simulation_Diagnostic.ipynb,sha256=EXoh9bGvTsIZ5gwACMmRaJwtBUD6wD9vA1qCbnBwZaU,12025
|
|
23
|
+
examples/quick_start.ipynb,sha256=UPbQVOsg8NPoovbP6Ed6AeILutXrJtk472LEwktaWG4,2054
|
|
15
24
|
examples/quick_start.py,sha256=fMBNTf2MfABll5ljfX79SgpLl2y20VdwRTcNzr2S-NA,932
|
|
16
25
|
examples/example_data/run-info,sha256=kkATYyBQify6tyc_Cd8aj6Q09OsWj-7fVPuDEefMMo0,2438
|
|
17
26
|
examples/example_data/thermal.1d,sha256=w4PuwO4RHr9GbAQnwh2YEUI0JpH_2icG9QaynE4rwKo,1010
|
|
@@ -1036,27 +1045,35 @@ examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000251.h5,sha256=Y5
|
|
|
1036
1045
|
examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000252.h5,sha256=uehzDEpMDT1iPAnD12HjB5Lpy59p5VR39HWRmouiFJ0,15368
|
|
1037
1046
|
examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000253.h5,sha256=Kt6DXemyVU6l0jhNYb10NYFo3xWZsQRQStUaWaEZJAE,15368
|
|
1038
1047
|
examples/example_data/TIMINGS/timings-final,sha256=1i_dcQ1hIxs78eeD4e6WNWUxJ_vXKRvbIVDAPGl9_R4,2910
|
|
1039
|
-
osiris_utils/__init__.py,sha256=
|
|
1048
|
+
osiris_utils/__init__.py,sha256=fW35MElhEp9sMzpZjM91uMsTK7UL_YZD3eP1xGgANfY,2492
|
|
1040
1049
|
osiris_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1041
|
-
osiris_utils/utils.py,sha256=
|
|
1042
|
-
osiris_utils/
|
|
1043
|
-
osiris_utils/
|
|
1044
|
-
osiris_utils/
|
|
1045
|
-
osiris_utils/
|
|
1046
|
-
osiris_utils/
|
|
1047
|
-
osiris_utils/
|
|
1048
|
-
osiris_utils/
|
|
1049
|
-
osiris_utils/
|
|
1050
|
-
osiris_utils/
|
|
1051
|
-
osiris_utils/
|
|
1052
|
-
osiris_utils/
|
|
1053
|
-
osiris_utils/
|
|
1054
|
-
osiris_utils/
|
|
1055
|
-
osiris_utils/postprocessing/
|
|
1056
|
-
osiris_utils/postprocessing/
|
|
1057
|
-
osiris_utils/postprocessing/
|
|
1058
|
-
osiris_utils
|
|
1059
|
-
osiris_utils
|
|
1060
|
-
osiris_utils
|
|
1061
|
-
osiris_utils
|
|
1062
|
-
osiris_utils
|
|
1050
|
+
osiris_utils/utils.py,sha256=q537utor4ewlvO1q8v12uTjfP17wVUxE8hcoTEY5hr8,8704
|
|
1051
|
+
osiris_utils/cli/__init__.py,sha256=g0SAwNJPoBG19DQ7hVVhKDRnwfA-cB8fPuvQbsuTaa0,169
|
|
1052
|
+
osiris_utils/cli/__main__.py,sha256=fr75vWfTCaq0uFCasQz-j2FGIAfHx41gYjROTWKO7hs,2023
|
|
1053
|
+
osiris_utils/cli/export.py,sha256=L-SxBAMH9yT96wj9zWmKvb3hsJp20tN-i46W1LiJXeY,6217
|
|
1054
|
+
osiris_utils/cli/info.py,sha256=E2JPwGpO3T6OJFWDOuLIRD6gJkbYxNoyDztyHLo22JQ,5177
|
|
1055
|
+
osiris_utils/cli/plot.py,sha256=HV69rxcouDQTA3MNFx62HUWaEKMcVSoKQ1NUR4yoSvI,5063
|
|
1056
|
+
osiris_utils/cli/validate.py,sha256=MdOzsVzgQPwVNHmoAICpcRn-POhpz9yN2I9bb8TYRro,7253
|
|
1057
|
+
osiris_utils/data/__init__.py,sha256=Yc7SyMDBO-HHE8VNqug1yf_gxyl2uawVd80E0q3FDAE,394
|
|
1058
|
+
osiris_utils/data/data.py,sha256=VtoMDoTj8nXZlGZeCjIgIZUICtwkST9TxBFShzYsnAI,22059
|
|
1059
|
+
osiris_utils/data/diagnostic.py,sha256=sy-e4hz4G8Am9wjtkeTr3w64elMLXGizsfGcA9xfHAw,39181
|
|
1060
|
+
osiris_utils/data/simulation.py,sha256=bn5-Uv894dm38PNhUtMl9TZCmEBQlVqN4DuteM6ui-Y,7256
|
|
1061
|
+
osiris_utils/decks/__init__.py,sha256=m6lNzGk5DSHs9wpRmW6d3vdir4Wg28ImWkeg5fzQx3k,114
|
|
1062
|
+
osiris_utils/decks/decks.py,sha256=HW9iAGP2xjtJ5VpHceLhXYK2tnB4rcYdsfDquRQVv3o,12194
|
|
1063
|
+
osiris_utils/decks/species.py,sha256=f8BY-Zb_LhHP5KFlkQNbzF3uQZl7vtDKXHXZvlKzps8,1106
|
|
1064
|
+
osiris_utils/postprocessing/__init__.py,sha256=bN8YlzTXd1Kr8eYqyWtGv8WFF0N_9f5XlsN1uUIHyLc,1180
|
|
1065
|
+
osiris_utils/postprocessing/derivative.py,sha256=OIp71mfjhNWxhW_HzEQ6NTUKSgWeqpbujCrp0NX-CRE,19715
|
|
1066
|
+
osiris_utils/postprocessing/fft.py,sha256=EN44iH8nvhMnHbBBTKT5ZFB1A_8DCgexVFoK7SomHuI,14009
|
|
1067
|
+
osiris_utils/postprocessing/field_centering.py,sha256=YTYzdEvRFh6fhxPYn95UAZ1eQcC9AP2kf7En2ynRfPs,12952
|
|
1068
|
+
osiris_utils/postprocessing/heatflux_correction.py,sha256=NtCOkjQuW95v3PHpDJODZBYFFetfsCS3AWNu5DoVA_I,8105
|
|
1069
|
+
osiris_utils/postprocessing/mft.py,sha256=MOGHpiDBsfZdbCHWP1999NGt8j790RB39GHjdcQp0Mw,13128
|
|
1070
|
+
osiris_utils/postprocessing/postprocess.py,sha256=-_zydCuK7RsH2kTT5vGpIZd5dQco9iIaSMKwUSex5Ww,1144
|
|
1071
|
+
osiris_utils/postprocessing/pressure_correction.py,sha256=N0UwUmW7eEcr1OdgzyIwY-rFxUKXomfsQvTUobKXBlw,7223
|
|
1072
|
+
osiris_utils/vis/__init__.py,sha256=Vr0o8wtRFtPOJdSK5cRIa_bDvbylAe2sHTk8c7qO_tM,51
|
|
1073
|
+
osiris_utils/vis/plot3d.py,sha256=ywP9UGI4i3SRgUdsz-ILHxc7W_StCSN1D1U4Tmpd_6o,4658
|
|
1074
|
+
osiris_utils-1.2.0.dist-info/licenses/LICENSE.txt,sha256=z1lVzLA_QsfcnLffhfWMrFw5cR_nuwpvbOGCOFUN7iY,1066
|
|
1075
|
+
osiris_utils-1.2.0.dist-info/METADATA,sha256=7IgAe88iZbzaZ53jT5toI4FEnM9LZXyb6GWAHAtRI84,5436
|
|
1076
|
+
osiris_utils-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
1077
|
+
osiris_utils-1.2.0.dist-info/entry_points.txt,sha256=s3WXJWsWF5AWEFhJ8rXscjGttQCOXvViOiNmX45AJjo,49
|
|
1078
|
+
osiris_utils-1.2.0.dist-info/top_level.txt,sha256=tSs2XcOs-JtYsqVepo5WVSNcilf6ALHfKyYuPaVZLco,38
|
|
1079
|
+
osiris_utils-1.2.0.dist-info/RECORD,,
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
|
|
3
|
-
from ..data.data import OsirisGridFile
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Deprecated
|
|
7
|
-
class MFT_Single(OsirisGridFile):
|
|
8
|
-
"""
|
|
9
|
-
Class to handle the mean field theory on data. Inherits from OsirisGridFile.
|
|
10
|
-
|
|
11
|
-
Parameters
|
|
12
|
-
----------
|
|
13
|
-
source : str or OsirisGridFile
|
|
14
|
-
The filename or an OsirisGridFile object.
|
|
15
|
-
axis : int
|
|
16
|
-
The axis to average over.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
def __init__(self, source, axis=1):
|
|
20
|
-
if isinstance(source, OsirisGridFile):
|
|
21
|
-
self.__dict__.update(source.__dict__)
|
|
22
|
-
else:
|
|
23
|
-
super().__init__(source)
|
|
24
|
-
self._compute_mean_field(axis=axis)
|
|
25
|
-
|
|
26
|
-
def _compute_mean_field(self, axis=1):
|
|
27
|
-
self._average = np.expand_dims(np.mean(self.data, axis=axis), axis=axis)
|
|
28
|
-
self._fluctuations = self.data - self._average
|
|
29
|
-
|
|
30
|
-
def __array__(self):
|
|
31
|
-
return self.data
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def average(self):
|
|
35
|
-
return self._average
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def delta(self):
|
|
39
|
-
return self._fluctuations
|
|
40
|
-
|
|
41
|
-
def __str__(self):
|
|
42
|
-
return super().__str__() + f"\nAverage: {self.average.shape}\nDelta: {self.delta.shape}"
|
|
43
|
-
|
|
44
|
-
def derivative(self, field, axis=0):
|
|
45
|
-
"""
|
|
46
|
-
Compute the derivative of the average or the fluctuations.
|
|
47
|
-
|
|
48
|
-
Parameters
|
|
49
|
-
----------
|
|
50
|
-
field : MeanFieldTheory.average or MeanFieldTheory.delta
|
|
51
|
-
The field to compute the derivative.
|
|
52
|
-
axis : int
|
|
53
|
-
The axis to compute the derivative.
|
|
54
|
-
"""
|
|
55
|
-
return np.gradient(field, self.dx[axis], axis=0)
|
|
File without changes
|