Skip to content

Commit

Permalink
refactor(gratings,papers): update intensities order
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Sep 15, 2023
1 parent a00295f commit 1ab048a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
30 changes: 15 additions & 15 deletions stimupy/papers/RHS2007.py
Expand Up @@ -137,7 +137,7 @@ def WE_thick(ppd=PPD, pad=True):
params = {
"ppd": ppd,
"frequency": 4.0 / width,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices": (3, 6),
"target_heights": 4.0,
Expand Down Expand Up @@ -198,7 +198,7 @@ def WE_thin_wide(ppd=PPD, pad=True):
params = {
"ppd": ppd,
"frequency": 8.0 / width,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
"intensity_target": v2,
"target_indices": (4, 13),
"target_heights": 2.0,
Expand Down Expand Up @@ -250,7 +250,7 @@ def WE_dual(ppd=PPD, pad=True):
params = {
"ppd": ppd,
"frequency": 4.0 / width,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices": (3, 6),
"target_heights": 2.0,
Expand Down Expand Up @@ -320,7 +320,7 @@ def WE_anderson(ppd=PPD, pad=True):
params = {
"ppd": ppd,
"frequency": 8.0 / width,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices_top": (6,),
"target_indices_bottom": (11,),
Expand Down Expand Up @@ -389,7 +389,7 @@ def WE_howe(ppd=PPD, pad=True):
params = {
"ppd": ppd,
"frequency": 8.0 / width,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices_top": (6,),
"target_indices_bottom": (11,),
Expand Down Expand Up @@ -495,7 +495,7 @@ def WE_radial_thick_small(ppd=PPD, pad=True):
"target_indices": (1, 8),
"target_width": 4.0,
"target_center": 4.5,
"intensity_segments": (v3, v1),
"intensity_segments": (v1, v3),
"intensity_background": v2,
"intensity_target": v2,
}
Expand Down Expand Up @@ -550,7 +550,7 @@ def WE_radial_thick(ppd=PPD, pad=True):
"target_indices": (1, 10),
"target_width": 4.0,
"target_center": 6.0,
"intensity_segments": (v3, v1),
"intensity_segments": (v1, v3),
"intensity_background": v2,
"intensity_target": v2,
}
Expand Down Expand Up @@ -605,7 +605,7 @@ def WE_radial_thin_small(ppd=PPD, pad=True):
"target_indices": (1, 14),
"target_width": 2.0,
"target_center": 4.0,
"intensity_segments": (v3, v1),
"intensity_segments": (v1, v3),
"intensity_background": v2,
"intensity_target": v2,
}
Expand Down Expand Up @@ -660,7 +660,7 @@ def WE_radial_thin(ppd=PPD, pad=True):
"target_indices": (1, 22),
"target_width": 2.0,
"target_center": 6.0,
"intensity_segments": (v3, v1),
"intensity_segments": (v1, v3),
"intensity_background": v2,
"intensity_target": v2,
}
Expand Down Expand Up @@ -720,13 +720,13 @@ def WE_circular1(ppd=PPD, pad=True):

stim1 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v3, v1),
intensity_rings=(v1, v3),
**params,
)

stim2 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v1, v3),
intensity_rings=(v3, v1),
**params,
)
stim = stack_dicts(stim1, stim2)
Expand Down Expand Up @@ -781,13 +781,13 @@ def WE_circular05(ppd=PPD, pad=True):

stim1 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v3, v1),
intensity_rings=(v1, v3),
**params,
)

stim2 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v1, v3),
intensity_rings=(v3, v1),
**params,
)
stim = stack_dicts(stim1, stim2)
Expand Down Expand Up @@ -842,13 +842,13 @@ def WE_circular025(ppd=PPD, pad=True):

stim1 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v3, v1),
intensity_rings=(v1, v3),
**params,
)

stim2 = stimupy.whites.radial(
visual_size=(height, width),
intensity_rings=(v1, v3),
intensity_rings=(v3, v1),
**params,
)
stim = stack_dicts(stim1, stim2)
Expand Down
12 changes: 6 additions & 6 deletions stimupy/papers/domijan2015.py
Expand Up @@ -368,12 +368,12 @@ def grating(visual_size=VSIZES["grating"], ppd=PPD, shape=SHAPES["grating"]):

stim1 = stimupy.waves.square_linear(
**params,
intensity_bars=(v3, v1),
intensity_bars=(v1, v3),
intensity_target=v2,
)
stim2 = stimupy.waves.square_linear(
**params,
intensity_bars=(v1, v3),
intensity_bars=(v3, v1),
intensity_target=v2,
)

Expand Down Expand Up @@ -643,7 +643,7 @@ def white(visual_size=VSIZES["white"], ppd=PPD, pad=PAD, shape=SHAPES["white"]):

stim = stimupy.whites.white(
**params,
intensity_bars=(v1, v3),
intensity_bars=(v3, v1),
intensity_target=v2,
)

Expand Down Expand Up @@ -1090,7 +1090,7 @@ def white_yazdanbakhsh(

stim = stimupy.whites.yazdanbakhsh(
**params,
intensity_bars=(v1, v3),
intensity_bars=(v3, v1),
intensity_target=v2,
)

Expand Down Expand Up @@ -1176,7 +1176,7 @@ def white_anderson(

stim = stimupy.whites.anderson(
**params,
intensity_bars=(v3, v1),
intensity_bars=(v1, v3),
intensity_target=v2,
intensity_stripes=(v1, v3),
)
Expand Down Expand Up @@ -1258,7 +1258,7 @@ def white_howe(visual_size=VSIZES["white_howe"], ppd=PPD, shape=SHAPES["white_ho

stim = stimupy.whites.howe(
**params,
intensity_bars=(v3, v1),
intensity_bars=(v1, v3),
intensity_target=v2,
intensity_stripes=(v1, v3),
)
Expand Down
2 changes: 1 addition & 1 deletion stimupy/papers/murray2020.py
Expand Up @@ -735,7 +735,7 @@ def white(ppd=PPD):
"target_indices_bottom": (3, 5, 7),
"target_center_offset": 2,
"target_heights": 2,
"intensity_bars": (70, 17.5),
"intensity_bars": (17.5, 70),
"intensity_target": 35.0,
"period": "even",
}
Expand Down
32 changes: 16 additions & 16 deletions stimupy/papers/white1981.py
Expand Up @@ -202,7 +202,7 @@ def grating_white_white(ppd=PPD):
"bar_width": bar_width,
"rotation": ROTATION,
"intensity_background": v3,
"intensity_bars": (v3, v2),
"intensity_bars": (v2, v3),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand Down Expand Up @@ -245,7 +245,7 @@ def grating_white_black(ppd=PPD):
"bar_width": bar_width,
"rotation": ROTATION,
"intensity_background": v1,
"intensity_bars": (v3, v2),
"intensity_bars": (v2, v3),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand Down Expand Up @@ -288,7 +288,7 @@ def grating_black_white(ppd=PPD):
"bar_width": bar_width,
"rotation": ROTATION,
"intensity_background": v3,
"intensity_bars": (v1, v2),
"intensity_bars": (v2, v1),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand Down Expand Up @@ -331,7 +331,7 @@ def grating_black_black(ppd=PPD):
"bar_width": bar_width,
"rotation": ROTATION,
"intensity_background": v1,
"intensity_bars": (v1, v2),
"intensity_bars": (v2, v1),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand Down Expand Up @@ -372,7 +372,7 @@ def grating_white_in(ppd=PPD):
"n_bars": 9,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand All @@ -381,7 +381,7 @@ def grating_white_in(ppd=PPD):
"visual_size": 51 * bar_width,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
}
stim = stimupy.gratings.on_grating(
small_grating_params=small_params,
Expand Down Expand Up @@ -424,7 +424,7 @@ def grating_black_in(ppd=PPD):
"n_bars": 9,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand All @@ -433,7 +433,7 @@ def grating_black_in(ppd=PPD):
"visual_size": 51 * bar_width,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
}
stim = stimupy.gratings.on_grating(
small_grating_params=small_params,
Expand Down Expand Up @@ -476,7 +476,7 @@ def grating_white_out(ppd=PPD):
"visual_size": (50 * bar_width, 9 * bar_width),
"ppd": ppd,
"rotation": -ROTATION,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
"intensity_target": v2,
"target_indices": (24, 26, 28, 30),
}
Expand All @@ -485,7 +485,7 @@ def grating_white_out(ppd=PPD):
"visual_size": 50 * bar_width,
"ppd": ppd,
"rotation": -ROTATION,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
}
stim = stimupy.gratings.on_grating(
small_grating_params=small_params,
Expand Down Expand Up @@ -528,7 +528,7 @@ def grating_black_out(ppd=PPD):
"visual_size": (50 * bar_width, 9 * bar_width),
"ppd": ppd,
"rotation": -ROTATION,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices": (24, 26, 28, 30),
}
Expand All @@ -537,7 +537,7 @@ def grating_black_out(ppd=PPD):
"visual_size": 50 * bar_width,
"ppd": ppd,
"rotation": -ROTATION,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
}
stim = stimupy.gratings.on_grating(
small_grating_params=small_params,
Expand Down Expand Up @@ -580,7 +580,7 @@ def grating_white_orthogonal(ppd=PPD):
"bar_width": bar_width,
"ppd": ppd,
"rotation": ROTATION + 90,
"intensity_bars": (v3, v2),
"intensity_bars": (v2, v3),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand All @@ -589,7 +589,7 @@ def grating_white_orthogonal(ppd=PPD):
"visual_size": 51 * bar_width,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
}
stim = stimupy.gratings.on_grating_masked(
small_grating_params=small_params,
Expand Down Expand Up @@ -634,7 +634,7 @@ def grating_black_orthogonal(ppd=PPD):
"bar_width": bar_width,
"ppd": ppd,
"rotation": ROTATION + 90,
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"target_indices": (2, 4, 6, 8),
}
Expand All @@ -643,7 +643,7 @@ def grating_black_orthogonal(ppd=PPD):
"visual_size": 51 * bar_width,
"ppd": ppd,
"rotation": ROTATION,
"intensity_bars": (v3, v1),
"intensity_bars": (v1, v3),
}
stim = stimupy.gratings.on_grating_masked(
small_grating_params=small_params,
Expand Down
2 changes: 1 addition & 1 deletion stimupy/papers/white1985.py
Expand Up @@ -57,7 +57,7 @@
START_PHASE2 = 0

COMMON_PARAMS = {
"intensity_bars": (v1, v3),
"intensity_bars": (v3, v1),
"intensity_target": v2,
"distance_metric": "vertical",
}
Expand Down
2 changes: 1 addition & 1 deletion stimupy/stimuli/gratings.py
Expand Up @@ -299,7 +299,7 @@ def phase_shifted(
rotation=rotation,
phase_shift=0,
period=period,
intensity_bars=(0, intensity_target),
intensity_bars=(intensity_target, 0),
origin=origin,
round_phase_width=True,
)
Expand Down

0 comments on commit 1ab048a

Please sign in to comment.