Include temperature deposition shape factor#1355
Merged
MaxThevenet merged 6 commits intoHi-PACE:developmentfrom Mar 17, 2026
Merged
Include temperature deposition shape factor#1355MaxThevenet merged 6 commits intoHi-PACE:developmentfrom
MaxThevenet merged 6 commits intoHi-PACE:developmentfrom
Conversation
Contributor
Author
|
Input file Figure script import numpy as np
import scipy.constants as const
import matplotlib.pyplot as plt
# Set global font sizes for the plots
plt.rcParams['font.size'] = 10 # global default
from openpmd_viewer import OpenPMDTimeSeries
ts_0 = OpenPMDTimeSeries('/data/dust/user/emarchet/runs/branch_Tdep/shapef_0/input_0_3d/diags/hdf5/', check_all_files=False)
ts_1 = OpenPMDTimeSeries('/data/dust/user/emarchet/runs/branch_Tdep/shapef_1/input_0_3d/diags/hdf5/', check_all_files=False)
ts_2 = OpenPMDTimeSeries('/data/dust/user/emarchet/runs/branch_Tdep/shapef_2/input_0_3d/diags/hdf5/', check_all_files=False)
ts_3 = OpenPMDTimeSeries('/data/dust/user/emarchet/runs/branch_Tdep/shapef_3/input_0_3d/diags/hdf5/', check_all_files=False)
iteration = 0
def get_u (ts):
print(ts.avail_fields, '\n')
ux_sq_e, _ = ts.get_field(field='ux^2_electrons', iteration=iteration, slice_across=None)
ux_e, info_ux_e = ts.get_field(field='ux_electrons', iteration=iteration, slice_across=None)
#print(ux_sq_e.ndim)
#print(ux_e.ndim)
uy_sq_e, _ = ts.get_field(field='uy^2_electrons', iteration=iteration, slice_across=None)
uy_e, _ = ts.get_field(field='uy_electrons', iteration=iteration, slice_across=None)
#ts.get_field?
#info_ux_e?
x = info_ux_e.x
y = info_ux_e.y
z = info_ux_e.z
# Calculate the plasma temperatures
Tx_e = (ux_sq_e - ux_e**2) * const.m_e * const.c**2 / const.e
Ty_e = (uy_sq_e - uy_e**2) * const.m_e * const.c**2 / const.e
print(Tx_e.shape, '\n')
#print(Ty_e.shape)
return Tx_e, Ty_e, x, y, z
Tx_e_0, Ty_e_0, x, y, z = get_u(ts_0)
Tx_e_1, Ty_e_1, *_, = get_u(ts_1)
Tx_e_2, Ty_e_2, *_, = get_u(ts_2)
Tx_e_3, Ty_e_3, *_, = get_u(ts_3)
# Get the shape of the array (128, 64, 64)
shape = Tx_e_0.shape
x_mid = shape[2]//2 # Middle of the x-dimension
y_mid = shape[1]//2 # Middle of the y-dimension
z_mid = shape[0]//2 # Middle of the z-dimension
# Plot
Tx_list = [Tx_e_0, Tx_e_1, Tx_e_2, Tx_e_3]
Tx2d_list = [Tx[z_mid, :, :] for Tx in Tx_list]
titles = [f"Shapef {i}" for i in range(4)]
fig, axes = plt.subplots(2, 2, figsize=(10, 8))
for i, ax in enumerate(axes.ravel()):
m = ax.pcolormesh(x, y, Tx2d_list[i].T, shading="auto", cmap='plasma', vmin=0, vmax=2)
fig.colorbar(m, ax=ax)
ax.set_title(titles[i])
ax.set_xlabel("x (m)")
ax.set_ylabel("y (m)")
ax.ticklabel_format(axis="both", style="sci", scilimits=(0, 0))
ax.grid(True)
plt.suptitle("Electron Temperature Tx_e (eV)")
plt.tight_layout()
plt.show() |
Member
|
Thanks for this PR! Could you fix conflicts with dev and make sure CI passes? |
MaxThevenet
reviewed
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes the possibility to select the order of the plasma temperature deposition shape factor, when applicable.
constisconst)