Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cophus committed Oct 23, 2024
1 parent e3f4c9c commit b922504
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py4DSTEM/process/diffraction/flowlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def make_flowline_rainbow_image(
def make_flowline_rainbow_legend(
im_size=np.array([256, 256]),
sym_rotation_order=2,
theta_offset=0.0,
theta_offset_degrees=0.0,
white_background=False,
return_image=False,
radial_range=np.array([0.45, 0.9]),
Expand All @@ -813,7 +813,7 @@ def make_flowline_rainbow_legend(
Args:
im_size (np.array): Size of legend image in pixels.
sym_rotation_order (int): rotational symmety for colouring
theta_offset (float): Offset the anglular coloring by this value in radians.
theta_offset_degrees (float): Offset the anglular coloring by this value in radians.
white_background (bool): For either color or greyscale output, switch to white background (from black).
return_image (bool): Return the image array.
radial_range (np.array): Inner and outer radius for the legend ring.
Expand All @@ -827,17 +827,17 @@ def make_flowline_rainbow_legend(
# Coordinates
x = np.linspace(-1, 1, im_size[0])
y = np.linspace(-1, 1, im_size[1])
ya, xa = np.meshgrid(-y, x)
ya, xa = np.meshgrid(y, x)
ra = np.sqrt(xa**2 + ya**2)
ta = np.arctan2(ya, xa) + theta_offset
ta = np.arctan2(ya, xa) + np.deg2rad(theta_offset_degrees)
ta_sym = ta * sym_rotation_order

# mask
mask = np.logical_and(ra > radial_range[0], ra < radial_range[1])

# rgb image
z = mask * np.exp(1j * ta_sym)
hue_start = -90
hue_start = 0
amp = np.abs(z)
vmin = np.min(amp)
vmax = np.max(amp)
Expand Down

0 comments on commit b922504

Please sign in to comment.