Skip to content

Commit

Permalink
fix: radial and rectilinear waves now correctly resolve n_phases
Browse files Browse the repository at this point in the history
  • Loading branch information
LynnSchmittwilken committed May 12, 2023
1 parent c2e6575 commit ecce0b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stimupy/components/waves.py
Expand Up @@ -352,6 +352,10 @@ def sine(
warnings.warn("Period ignored for oblique gratings")

# Resolve params
if distance_metric == "radial" or distance_metric == "rectilinear":
if n_phases is not None:
n_phases = n_phases * 2

if distance_metric == "angular":
params = resolve_grating_params(
visual_angle=360,
Expand All @@ -373,13 +377,17 @@ def sine(
period=period,
round_phase_width=round_phase_width,
)

length = params["length"]
ppd_1D = params["ppd"]
visual_angle = params["visual_angle"]
frequency = params["frequency"]
phase_width = params["phase_width"]
n_phases = params["n_phases"]

if distance_metric == "radial" or distance_metric == "rectilinear":
n_phases = n_phases / 2

# Determine size/shape of whole image
if None in shape:
shape = [length * alpha[1], length * alpha[0]]
Expand Down

0 comments on commit ecce0b9

Please sign in to comment.