osiris-utils 1.1.10a0__py3-none-any.whl → 1.2.1__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.
Files changed (54) hide show
  1. benchmarks/benchmark_hdf5_io.py +46 -0
  2. benchmarks/benchmark_load_all.py +54 -0
  3. docs/source/_static/Imagem1.png +0 -0
  4. docs/source/_static/custom.css +24 -8
  5. docs/source/api/decks.rst +48 -0
  6. docs/source/api/postprocess.rst +72 -8
  7. docs/source/api/sim_diag.rst +9 -7
  8. docs/source/api/utilities.rst +6 -6
  9. docs/source/conf.py +28 -8
  10. docs/source/examples/example_Derivatives.md +78 -0
  11. docs/source/examples/example_FFT.md +152 -0
  12. docs/source/examples/example_InputDeck.md +149 -0
  13. docs/source/examples/example_Simulation_Diagnostic.md +213 -0
  14. docs/source/examples/quick_start.md +51 -0
  15. docs/source/examples.rst +14 -0
  16. docs/source/index.rst +8 -0
  17. examples/edited-deck.1d +1 -1
  18. examples/example_Derivatives.ipynb +24 -36
  19. examples/example_FFT.ipynb +44 -23
  20. examples/example_InputDeck.ipynb +24 -277
  21. examples/example_Simulation_Diagnostic.ipynb +27 -17
  22. examples/quick_start.ipynb +17 -1
  23. osiris_utils/__init__.py +10 -6
  24. osiris_utils/cli/__init__.py +6 -0
  25. osiris_utils/cli/__main__.py +85 -0
  26. osiris_utils/cli/export.py +199 -0
  27. osiris_utils/cli/info.py +156 -0
  28. osiris_utils/cli/plot.py +189 -0
  29. osiris_utils/cli/validate.py +247 -0
  30. osiris_utils/data/__init__.py +15 -0
  31. osiris_utils/data/data.py +41 -171
  32. osiris_utils/data/diagnostic.py +285 -274
  33. osiris_utils/data/simulation.py +20 -13
  34. osiris_utils/decks/__init__.py +4 -0
  35. osiris_utils/decks/decks.py +83 -8
  36. osiris_utils/decks/species.py +12 -9
  37. osiris_utils/postprocessing/__init__.py +28 -0
  38. osiris_utils/postprocessing/derivative.py +317 -106
  39. osiris_utils/postprocessing/fft.py +135 -24
  40. osiris_utils/postprocessing/field_centering.py +28 -14
  41. osiris_utils/postprocessing/heatflux_correction.py +39 -18
  42. osiris_utils/postprocessing/mft.py +10 -2
  43. osiris_utils/postprocessing/postprocess.py +8 -5
  44. osiris_utils/postprocessing/pressure_correction.py +29 -17
  45. osiris_utils/utils.py +26 -17
  46. osiris_utils/vis/__init__.py +3 -0
  47. osiris_utils/vis/plot3d.py +148 -0
  48. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.1.dist-info}/METADATA +61 -7
  49. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.1.dist-info}/RECORD +53 -35
  50. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.1.dist-info}/WHEEL +1 -1
  51. osiris_utils-1.2.1.dist-info/entry_points.txt +2 -0
  52. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.1.dist-info}/top_level.txt +1 -0
  53. osiris_utils/postprocessing/mft_for_gridfile.py +0 -55
  54. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.1.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 1D from the left to the right. This may be changed in the future to allow
93
- for integration in both directions or for other more general cases.
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
- Returns
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
- if len(array.shape) != 1:
111
- raise ValueError(f"Array must be 1D\n Array shape: {array.shape}")
112
- flip_array = np.flip(array)
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 IOError:
187
+ except OSError:
179
188
  print("cannot open " + filename_in)
180
189
  exit()
181
190
 
@@ -0,0 +1,3 @@
1
+ from .plot3d import plot_3d
2
+
3
+ __all__ = ["plot_3d"]
@@ -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.1.10a0
3
+ Version: 1.2.1
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
@@ -46,16 +43,23 @@ Dynamic: license-file
46
43
 
47
44
  OSIRIS_UTILS
48
45
  ============
46
+ .. image:: https://raw.githubusercontent.com/joaopedrobiu6/osiris_utils/main/docs/source/_static/Imagem1.png
47
+ :width: 200px
48
+ :align: right
49
+
50
+
49
51
  |Pypi|
50
52
 
51
53
  .. image:: https://github.com/joaopedrobiu6/osiris_utils/actions/workflows/ci.yml/badge.svg
52
54
  :target: https://github.com/joaopedrobiu6/osiris_utils/actions
53
55
  :alt: CI status
56
+
54
57
  .. image:: https://codecov.io/gh/joaopedrobiu6/osiris_utils/branch/main/graph/badge.svg
55
58
  :target: https://codecov.io/gh/joaopedrobiu6/osiris_utils
56
59
  :alt: Coverage
57
60
 
58
-
61
+ .. image:: https://zenodo.org/badge/889119723.svg
62
+ :target: https://doi.org/10.5281/zenodo.17382244
59
63
 
60
64
  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
65
  High-level functions are provided to manipulate data from OSIRIS, from reading the data of the diagnostics, to making post-processing calculations.
@@ -95,6 +99,48 @@ Quick-start
95
99
  cd osiris_utils
96
100
  python examples/quick_start.py examples/example_data/thermal.1d
97
101
 
102
+ Command-Line Interface
103
+ ----------------------
104
+
105
+ osiris_utils includes a command-line interface for common operations. After installation, the ``osiris`` command becomes available::
106
+
107
+ osiris --version # Check version
108
+ osiris --help # Show available commands
109
+
110
+ **Available Commands:**
111
+
112
+ - ``osiris info`` - Display metadata about OSIRIS files and simulations
113
+ - ``osiris export`` - Convert data to CSV, JSON, or NumPy formats
114
+ - ``osiris plot`` - Create quick visualizations
115
+ - ``osiris validate`` - Check file integrity
116
+
117
+ **Examples:**
118
+
119
+ Show simulation information::
120
+
121
+ osiris info path/to/simulation
122
+ osiris info path/to/file.h5 --brief
123
+
124
+ Export data to different formats::
125
+
126
+ osiris export file.h5 --format csv --output data.csv
127
+ osiris export diagnostic/dir --format npy --output data.npy
128
+
129
+ Generate quick plots::
130
+
131
+ osiris plot file.h5 --save plot.png
132
+ osiris plot file.h5 --save plot.png --title "Ez Field" --cmap viridis
133
+
134
+ Validate simulation data::
135
+
136
+ osiris validate path/to/simulation
137
+ osiris validate path/to/simulation --check-missing
138
+
139
+ For detailed help on any command::
140
+
141
+ osiris <command> --help
142
+
143
+
98
144
  Documentation
99
145
  -------------
100
146
 
@@ -106,7 +152,15 @@ The documentation is available at https://osiris-utils.readthedocs.io or via thi
106
152
 
107
153
  .. _authors:
108
154
 
109
- Authors and Contributors
110
- ------------------------
155
+ Author
156
+ ------
111
157
 
112
158
  - João Biu
159
+
160
+ Contributors
161
+ ------------
162
+
163
+ - Diogo Carvalho
164
+ - João Cândido
165
+ - Margarida Pereira
166
+
@@ -1,17 +1,27 @@
1
- docs/source/conf.py,sha256=fcEgAXDRbk8PX2ygvDwabnwK6Bjdiz4eYV-PwzFPZKA,6079
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=1y08f-JzVCs_revzNsKO6PB6J4KIz4wGVCZEmz-6ozM,6573
2
4
  docs/source/contrib.rst,sha256=CkYSzy3msde38fy0zROAjDsdRHYYvQSAJwjkJczFmGI,35
3
- docs/source/index.rst,sha256=9DQxea3_rZIe9g_nQs9MDJ7XXmeWpB59lDflyrKi66Q,508
4
- docs/source/_static/custom.css,sha256=aLsKMK8rejJzzCdISkHhDG8Eq-f7T4v4DmQInYzeRDI,909
5
+ docs/source/examples.rst,sha256=IFl6kRAYUHO1hmExBYKBCPPFjS82gol8cQYXLNawsi8,303
6
+ docs/source/index.rst,sha256=djTvENMR-HNC5q0Wh8hsrB7in5IY6augL9OLxnlpsFA,599
7
+ docs/source/_static/Imagem1.png,sha256=4NtHIBlqc1qoryC9qPz8PzAl2WCkegb1eQTXBDePfv8,878979
8
+ docs/source/_static/custom.css,sha256=KJO7s8zlu2_16WICQB7U5NTfcJelwmHmA1Uj3WqfSLg,1103
5
9
  docs/source/_static/quick_start_ez.png,sha256=_pxXBOTl30EMkCcbiehp-F0vk-nd8r9VF25Cz4tORPU,50829
6
- docs/source/api/postprocess.rst,sha256=wtjCE6Ny1vxl-cM33aVFG-qxy1uAcgumjRW1usDUv-U,19812
7
- docs/source/api/sim_diag.rst,sha256=rmXjjXGe5Hc7eyHYP-vTD-CvmkX5xGM1VBkkEQ-i-Wo,8786
8
- docs/source/api/utilities.rst,sha256=94iHs3OAy5YsVq5ZalxVSDIP9B8Uo_7ZZDK1oi-j7Fc,9441
9
- examples/edited-deck.1d,sha256=nmvnqx-QinyIhbmg9VDBzA0q3g_9pfe26Oq3MBXc5dI,1030
10
- examples/example_Derivatives.ipynb,sha256=86zVF9iM3530oeJe1g_K9o4AwZjrzFiNxogArv6jrTs,146041
11
- examples/example_FFT.ipynb,sha256=i5-gUHx9mB2RnjaRJ8IDeQ2Rx0sajxqKyN9E0zVHdpU,8856
12
- examples/example_InputDeck.ipynb,sha256=tX3vcC_HQkTI2U1WUAU0C6fjQbr6isDXiz19d8siKYQ,14398
13
- examples/example_Simulation_Diagnostic.ipynb,sha256=4ExK6TLdNla-0QUuBmgKfdGDne1vnZMgzom-j-uf2sI,11888
14
- examples/quick_start.ipynb,sha256=i6B24dzLXAc6oOqoytxC1Ir0btdBdb02R2TOC15XY2s,1797
10
+ docs/source/api/decks.rst,sha256=iTcMUiSSlb7rmqzwLG4T5bjShFiAWdSIsDBWQljkbwE,1147
11
+ docs/source/api/postprocess.rst,sha256=8Uhtp9V3CVeYghk_aavWJqGEccOj3v67ZJR1FpdWHoI,21751
12
+ docs/source/api/sim_diag.rst,sha256=Ma4jMZXSLvVMxiDQtJzM51iskh3hx2NX6MD-ATIIqNs,8919
13
+ docs/source/api/utilities.rst,sha256=DlJVDykwuoN7YEF6e75UbSG3fQiCNbcDGM89mNMOcUI,9599
14
+ docs/source/examples/example_Derivatives.md,sha256=p0tLobnmLyFKPkDSeFshKpzYi4rYVjBnn2oo_ekcB7g,2378
15
+ docs/source/examples/example_FFT.md,sha256=JbFNm0C8EVEhnY6vTiKFD2IKBVwFoCpv-35OcrzRl7M,6086
16
+ docs/source/examples/example_InputDeck.md,sha256=OOch34FN-nmqQAqw0R17aiLsmTs0D3Qc4icdulbNTBw,4359
17
+ docs/source/examples/example_Simulation_Diagnostic.md,sha256=IpW5xJITRcKoxAoqYqSZuBDk3M4RxnKiK7oD-lEezCQ,7459
18
+ docs/source/examples/quick_start.md,sha256=yt0b9Lz85ylMGEZPKLQpD7qFeISkEJo_FutMJP6wSu4,837
19
+ examples/edited-deck.1d,sha256=D6fIVzw_mtSnQbQPALs9tl9Fnm2oBnRJuWu7ecCKv4U,1018
20
+ examples/example_Derivatives.ipynb,sha256=L9NBEdTLMv7n7og0o9tvQ0We77vuCJVAzMIAAQcRd4k,4584
21
+ examples/example_FFT.ipynb,sha256=bOb1VWZYpTw4zct8-sxr7AbNGhz3ZrB7eW5Pl84MaGc,9093
22
+ examples/example_InputDeck.ipynb,sha256=k4fD_3SwwHVWe6r19ZxwyPIvGN3r04lDUWeqW3SMTgc,7484
23
+ examples/example_Simulation_Diagnostic.ipynb,sha256=EXoh9bGvTsIZ5gwACMmRaJwtBUD6wD9vA1qCbnBwZaU,12025
24
+ examples/quick_start.ipynb,sha256=UPbQVOsg8NPoovbP6Ed6AeILutXrJtk472LEwktaWG4,2054
15
25
  examples/quick_start.py,sha256=fMBNTf2MfABll5ljfX79SgpLl2y20VdwRTcNzr2S-NA,932
16
26
  examples/example_data/run-info,sha256=kkATYyBQify6tyc_Cd8aj6Q09OsWj-7fVPuDEefMMo0,2438
17
27
  examples/example_data/thermal.1d,sha256=w4PuwO4RHr9GbAQnwh2YEUI0JpH_2icG9QaynE4rwKo,1010
@@ -1036,27 +1046,35 @@ examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000251.h5,sha256=Y5
1036
1046
  examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000252.h5,sha256=uehzDEpMDT1iPAnD12HjB5Lpy59p5VR39HWRmouiFJ0,15368
1037
1047
  examples/example_data/MS/UDIST/electrons/vfl1/vfl1-electrons-000253.h5,sha256=Kt6DXemyVU6l0jhNYb10NYFo3xWZsQRQStUaWaEZJAE,15368
1038
1048
  examples/example_data/TIMINGS/timings-final,sha256=1i_dcQ1hIxs78eeD4e6WNWUxJ_vXKRvbIVDAPGl9_R4,2910
1039
- osiris_utils/__init__.py,sha256=YcD7gApMN-CPz_rkx7ZHnIoqA2yAWetUhgd7b0hABto,2461
1049
+ osiris_utils/__init__.py,sha256=fW35MElhEp9sMzpZjM91uMsTK7UL_YZD3eP1xGgANfY,2492
1040
1050
  osiris_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1041
- osiris_utils/utils.py,sha256=5XxFFZd1cK-xujlKIR1-21jPZwNJge7rqkNZlTyCgCs,8401
1042
- osiris_utils/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1043
- osiris_utils/data/data.py,sha256=OdmArrWPmLlBwibZZL0ct1Mg_ApPL15HPQna49EvnNs,27979
1044
- osiris_utils/data/diagnostic.py,sha256=rmHLnKG2pWA53gV5nzc8j-6hwBXx99ErYEnggt33Ub4,38535
1045
- osiris_utils/data/simulation.py,sha256=r3YN9jdyLtF5fpovc8-xYDYkKJ3eTibNNqxWdHudNjg,6854
1046
- osiris_utils/decks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1047
- osiris_utils/decks/decks.py,sha256=r0dyg4lZyxvEFcL6p-H7rn-UyawPlYItcftJ4Xb_GpI,9925
1048
- osiris_utils/decks/species.py,sha256=hHWfK0vPGcEiFfRWssMjRleDHjlqgsN47655yeVlWNM,1073
1049
- osiris_utils/postprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1050
- osiris_utils/postprocessing/derivative.py,sha256=_AO8qEEAXRQKrRNGpk8lpFOeKycGZ-cIlF3AsxgPE7Y,10120
1051
- osiris_utils/postprocessing/fft.py,sha256=rPu7-qJ2joaiP9I_saVj6V1pKGo58OEIgloIr0BBDj8,8954
1052
- osiris_utils/postprocessing/field_centering.py,sha256=5smTPlmJQb8rsfEVLZoV7fXiypIgLVMlYfgPB3YS12I,12374
1053
- osiris_utils/postprocessing/heatflux_correction.py,sha256=ppydiI_jfBxy3MZW_YoovtuZQMtmQEp21PV6kYCMJ_M,7072
1054
- osiris_utils/postprocessing/mft.py,sha256=KPoUZmwXcKbOGSHz01FPsDKlMSZDUrSeHQhlVbU5bhU,12969
1055
- osiris_utils/postprocessing/mft_for_gridfile.py,sha256=EGTghHliN9Q7KDYasnkKdc2QolD4tdlAxWnkPonS2aQ,1502
1056
- osiris_utils/postprocessing/postprocess.py,sha256=tcYVJR5eWeCTiWfnu9OKUfHk_E7-H8ek_QkMGVvRRg4,1077
1057
- osiris_utils/postprocessing/pressure_correction.py,sha256=FFi-KaV0pD5I6vBPFMRkyRZym2n8lb_m-CB0onihpRQ,6443
1058
- osiris_utils-1.1.10a0.dist-info/licenses/LICENSE.txt,sha256=z1lVzLA_QsfcnLffhfWMrFw5cR_nuwpvbOGCOFUN7iY,1066
1059
- osiris_utils-1.1.10a0.dist-info/METADATA,sha256=shUAXQDPbSCDYiWXQ_SEqn64Ca_m0bNVC1tYkBVSDLY,4275
1060
- osiris_utils-1.1.10a0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1061
- osiris_utils-1.1.10a0.dist-info/top_level.txt,sha256=8FzwamPQqVoj13it2XTog8aXYQ7cuyYyCFyGNz4tn3s,27
1062
- osiris_utils-1.1.10a0.dist-info/RECORD,,
1051
+ osiris_utils/utils.py,sha256=q537utor4ewlvO1q8v12uTjfP17wVUxE8hcoTEY5hr8,8704
1052
+ osiris_utils/cli/__init__.py,sha256=g0SAwNJPoBG19DQ7hVVhKDRnwfA-cB8fPuvQbsuTaa0,169
1053
+ osiris_utils/cli/__main__.py,sha256=fr75vWfTCaq0uFCasQz-j2FGIAfHx41gYjROTWKO7hs,2023
1054
+ osiris_utils/cli/export.py,sha256=L-SxBAMH9yT96wj9zWmKvb3hsJp20tN-i46W1LiJXeY,6217
1055
+ osiris_utils/cli/info.py,sha256=E2JPwGpO3T6OJFWDOuLIRD6gJkbYxNoyDztyHLo22JQ,5177
1056
+ osiris_utils/cli/plot.py,sha256=HV69rxcouDQTA3MNFx62HUWaEKMcVSoKQ1NUR4yoSvI,5063
1057
+ osiris_utils/cli/validate.py,sha256=MdOzsVzgQPwVNHmoAICpcRn-POhpz9yN2I9bb8TYRro,7253
1058
+ osiris_utils/data/__init__.py,sha256=Yc7SyMDBO-HHE8VNqug1yf_gxyl2uawVd80E0q3FDAE,394
1059
+ osiris_utils/data/data.py,sha256=VtoMDoTj8nXZlGZeCjIgIZUICtwkST9TxBFShzYsnAI,22059
1060
+ osiris_utils/data/diagnostic.py,sha256=sy-e4hz4G8Am9wjtkeTr3w64elMLXGizsfGcA9xfHAw,39181
1061
+ osiris_utils/data/simulation.py,sha256=bn5-Uv894dm38PNhUtMl9TZCmEBQlVqN4DuteM6ui-Y,7256
1062
+ osiris_utils/decks/__init__.py,sha256=m6lNzGk5DSHs9wpRmW6d3vdir4Wg28ImWkeg5fzQx3k,114
1063
+ osiris_utils/decks/decks.py,sha256=HW9iAGP2xjtJ5VpHceLhXYK2tnB4rcYdsfDquRQVv3o,12194
1064
+ osiris_utils/decks/species.py,sha256=f8BY-Zb_LhHP5KFlkQNbzF3uQZl7vtDKXHXZvlKzps8,1106
1065
+ osiris_utils/postprocessing/__init__.py,sha256=bN8YlzTXd1Kr8eYqyWtGv8WFF0N_9f5XlsN1uUIHyLc,1180
1066
+ osiris_utils/postprocessing/derivative.py,sha256=OIp71mfjhNWxhW_HzEQ6NTUKSgWeqpbujCrp0NX-CRE,19715
1067
+ osiris_utils/postprocessing/fft.py,sha256=EN44iH8nvhMnHbBBTKT5ZFB1A_8DCgexVFoK7SomHuI,14009
1068
+ osiris_utils/postprocessing/field_centering.py,sha256=YTYzdEvRFh6fhxPYn95UAZ1eQcC9AP2kf7En2ynRfPs,12952
1069
+ osiris_utils/postprocessing/heatflux_correction.py,sha256=NtCOkjQuW95v3PHpDJODZBYFFetfsCS3AWNu5DoVA_I,8105
1070
+ osiris_utils/postprocessing/mft.py,sha256=MOGHpiDBsfZdbCHWP1999NGt8j790RB39GHjdcQp0Mw,13128
1071
+ osiris_utils/postprocessing/postprocess.py,sha256=-_zydCuK7RsH2kTT5vGpIZd5dQco9iIaSMKwUSex5Ww,1144
1072
+ osiris_utils/postprocessing/pressure_correction.py,sha256=N0UwUmW7eEcr1OdgzyIwY-rFxUKXomfsQvTUobKXBlw,7223
1073
+ osiris_utils/vis/__init__.py,sha256=Vr0o8wtRFtPOJdSK5cRIa_bDvbylAe2sHTk8c7qO_tM,51
1074
+ osiris_utils/vis/plot3d.py,sha256=ywP9UGI4i3SRgUdsz-ILHxc7W_StCSN1D1U4Tmpd_6o,4658
1075
+ osiris_utils-1.2.1.dist-info/licenses/LICENSE.txt,sha256=z1lVzLA_QsfcnLffhfWMrFw5cR_nuwpvbOGCOFUN7iY,1066
1076
+ osiris_utils-1.2.1.dist-info/METADATA,sha256=p7q91bTXXIo2cZzX2gXsDno84ItWr4_x9oI3kKG4uM0,5582
1077
+ osiris_utils-1.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
1078
+ osiris_utils-1.2.1.dist-info/entry_points.txt,sha256=s3WXJWsWF5AWEFhJ8rXscjGttQCOXvViOiNmX45AJjo,49
1079
+ osiris_utils-1.2.1.dist-info/top_level.txt,sha256=tSs2XcOs-JtYsqVepo5WVSNcilf6ALHfKyYuPaVZLco,38
1080
+ osiris_utils-1.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ osiris = osiris_utils.cli:main
@@ -1,3 +1,4 @@
1
+ benchmarks
1
2
  docs
2
3
  examples
3
4
  osiris_utils
@@ -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)