# About reading ongoing phase of a drifting grating stimulus

**URL:** <https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124>\
**Category:** Support\
**Created:** [April 20, 2026, 12:38pm UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124 "2026-04-20T12:38:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcadena](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jcadena](https://mworks.discourse.group/u/jcadena)\
**Post date:** [April 20, 2026, 12:38pm UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124/1 "2026-04-20T12:38:10Z")

</div>

Hi Chris,

I hope everything is going smoothly on your end.

I have a very basic question. I am using drifting grating stimuli which, after a random period of time, increase the speed of one of them. The issue is that I want to increase the speed at a very specific phase. Therefore, is there a way to read the current phase of a drifting grating stimulus?

Thanks a lot in advance.

Have a good one,

Cheers,

Jaime

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [April 21, 2026, 2:38pm UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124/2 "2026-04-21T14:38:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [April 21, 2026, 2:47pm UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124/3 "2026-04-21T14:47:07Z")

</div>

Hi Jaime,

The current phase isn’t exposed via a parameter. However, it is included in [#stimDisplayUpdate](https://mworks.github.io/documentation/latest/reference/sysvars.html#stimdisplayupdate) announcements, and you can access its value at run time via [Python actions](https://mworks.github.io/documentation/latest/components/run_python_file.html).

For an example of this, see [StartingPhase](https://github.com/mworks/mworks/tree/master/examples/Tests/Stimulus/DriftingGrating/StartingPhase). This experiment calls the Python function `get_current_phase` (defined in [get\_current\_phase.py](https://github.com/mworks/mworks/blob/75eadf27a7df8faa73c87b95c57f48794fb0d6c5/examples/Tests/Stimulus/DriftingGrating/StartingPhase/get_current_phase.py)) to obtain the current phase and display it on screen. You could use a similar function to check for the specific phase at which to increase the grating speed.

If you have any questions, please let me know.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![jcadena](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jcadena](https://mworks.discourse.group/u/jcadena)\
**Post date:** [April 22, 2026, 8:16am UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124/4 "2026-04-22T08:16:22Z")

</div>

> [@cstawarz](#):
>
> [StartingPhase](https://github.com/mworks/mworks/tree/master/examples/Tests/Stimulus/DriftingGrating/StartingPhase)

Hi Chris,

Thanks a lot. this was very helpful!

Cheers,

Jaime

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 25, 2026, 2:58pm UTC](https://mworks.discourse.group/t/about-reading-ongoing-phase-of-a-drifting-grating-stimulus/1124/5 "2026-08-25T14:58:27Z")

</div>


