Skip to content

Commit

Permalink
Bugfix: angles
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Nov 14, 2022
1 parent 2f8f024 commit c3e469c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions stimuli/components/angular.py
Expand Up @@ -181,7 +181,7 @@ def angular_segments(
shape, visual_size, ppd = resolution.resolve(shape, visual_size, ppd)

# Convert to segment angles
angles = np.array(angles) % 360
angles = np.array(angles)

# Figure out intensities
if intensities is None:
Expand All @@ -198,7 +198,7 @@ def angular_segments(
img += bool_mask["mask"] * intensity
mask += bool_mask["mask"] * (idx + 1)

return {"img": img, "mask": mask, "visual_size": visual_size, "ppd": ppd}
return {"img": img, "mask": mask, "angles": angles, "visual_size": visual_size, "ppd": ppd}


def resolve_angular_params(
Expand Down Expand Up @@ -276,16 +276,11 @@ def resolve_angular_params(
except Exception as e:
raise Exception("Could not resolve grating frequency, segment_width, n_segments") from e

# Determine angles
angular_widths = itertools.repeat(segment_width, n_segments)
angles = [0] + [*itertools.accumulate(angular_widths)]

return {
"shape": shape,
"visual_size": visual_size,
"ppd": ppd,
"frequency": frequency,
"segment_width": segment_width,
"n_segments": n_segments,
"angles": angles,
}

0 comments on commit c3e469c

Please sign in to comment.