From bca6994dc3873c8e8b6c181206cc30bfa735b377 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Mon, 27 Mar 2023 08:43:27 -0700 Subject: [PATCH] Update openPMD metadata (#118) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- lasy/utils/openpmd_output.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lasy/utils/openpmd_output.py b/lasy/utils/openpmd_output.py index 13c20ee2..d8463060 100644 --- a/lasy/utils/openpmd_output.py +++ b/lasy/utils/openpmd_output.py @@ -47,7 +47,8 @@ def write_to_openpmd_file(dim, file_prefix, file_format, grid, wavelength, pol): # Define the mesh m = i.meshes["laserEnvelope"] m.grid_spacing = [ - (hi - lo) / npoints for hi, lo, npoints in zip(box.hi, box.lo, box.npoints) + (hi - lo) / (npoints - 1) + for hi, lo, npoints in zip(box.hi, box.lo, box.npoints) ][::-1] m.grid_global_offset = box.lo m.unit_dimension = {