Skip to content

Commit

Permalink
allow r=0 in FromArrayProfile (and derived) method (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
hightower8083 authored Jun 12, 2024
1 parent 154b803 commit 71c893a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lasy/profiles/from_array_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ def __init__(self, wavelength, pol, array, dim, axes, axes_order=["x", "y", "t"]
else:
self.array = array

# The first point is at dr/2.
# To make correct interpolation within the first cell, mirror
# field and axes along r.
r = np.concatenate((-axes["r"][::-1], axes["r"]))
array = np.concatenate((array[::-1], array))
# If the first point of radial axis is not 0, we "mirror" it,
# to make correct interpolation within the first cell
if axes["r"][0] != 0.0:
r = np.concatenate(([-axes["r"][0]], axes["r"]))
array = np.concatenate(([array[0]], array))
else:
r = axes["r"]

self.combined_field_interp = RegularGridInterpolator(
(r, axes["t"]),
Expand Down

0 comments on commit 71c893a

Please sign in to comment.