# Neuropixels Visual Coding Drifting Grating Phase Information

**URL:** <https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826>\
**Category:** Technical\
**Tags:** brain-observatory-visual-coding, allensdk\
**Created:** [January 13, 2026, 11:08pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826 "2026-01-13T23:08:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![basementcrusader](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/basementcrusader/32/2482_2.png) [@basementcrusader](https://community.brain-map.org/u/basementcrusader)\
**Post date:** [January 13, 2026, 11:08pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/1 "2026-01-13T23:08:33Z")

</div>

Hi,

I am doing some work that requires me to know _ **exactly** _ what a particular stimulus appears like on screen. For the static gratings, the phase information is included in the pandas dataframe returned by calling

> individualSession. **get\_stimulus\_table** ()

which allows me to use the method

> brainObservatoryMonitor. **grating\_to\_screen** (kwargs)

to create a representation of the static grating.

However, the drifting gratings and the ‘gabor’ stimuli only show the values [3644.933333333, 3644.933333333] for each row in the stimulus table, which is not informative to me for understanding what the phase of the grating is in in time. Please let me know how I could find this information.

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [January 14, 2026, 10:51pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/2 "2026-01-14T22:51:21Z")

</div>

For the drifting gratings and Gabors, we did not explicitly specify the phase when generating the stimuli, so it must be using the PsychoPy defaults.

According to the [`GratingStim` documentation](https://www.psychopy.org/api/visual/gratingstim.html#psychopy.visual.GratingStim), the phase of a drifting grating is determined by two values, the phase in x and the phase in y. I believe those are the two numbers you’re getting out of the stimulus table.

I am not entirely sure what units those values represent, but I can do some more digging if it would be helpful.

---

<div class="post-metadata">

**Author:** ![basementcrusader](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/basementcrusader/32/2482_2.png) [@basementcrusader](https://community.brain-map.org/u/basementcrusader)\
**Post date:** [January 22, 2026, 9:55pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/3 "2026-01-22T21:55:56Z")

</div>

Hi Josh,

It would be very helpful if I could know what those default values and their units are if possible.

Thanks,  
Nick

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [January 27, 2026, 6:00pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/4 "2026-01-27T18:00:52Z")

</div>

I think the main issue is that `grating_to_screen` was only intended to produce static images, so it can’t handle dynamic stimuli like drifting gratings.

We did take some screen captures of the Gabor and drifting gratings on the experimental rigs. Here are the images for the Gabor stimulus: [Dropbox](https://www.dropbox.com/scl/fo/tmx1k00fsxp7yi03j59l9/AKUvM1h4TSJYJxW5oTHF4H4?rlkey=64jnijy7j1ufnwy6czwf96b4z&st=qqf3fqd4&dl=0)

Would these be sufficient for your needs, or do you need to be able to re-generate the stimulus yourself?

---

<div class="post-metadata">

**Author:** ![basementcrusader](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/basementcrusader/32/2482_2.png) [@basementcrusader](https://community.brain-map.org/u/basementcrusader)\
**Post date:** [January 27, 2026, 6:21pm UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/5 "2026-01-27T18:21:21Z")

</div>

Hi Josh,

I’ve actually modified grating to screen to create dynamic stimuli, however I need to at least know the starting phase of the grating in order for that to be accurate. I can infer what comes after that from the temporal frequency and frame rate. If you have screenshots from every possible permutation of location, angle, and grating phase, that would be ok, however I don’t think that’s available.

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [January 28, 2026, 1:02am UTC](https://community.brain-map.org/t/neuropixels-visual-coding-drifting-grating-phase-information/4826/6 "2026-01-28T01:02:50Z")

</div>

Here is what we captured for drifting gratings: [Dropbox](https://www.dropbox.com/scl/fi/xe7q56h6vsecpgv9t1wd9/neuropixels_drifting_gratings.zip?rlkey=qhjz25vb467ppnrbusg24jzsy&st=lnotbjoz&dl=0)

It should include every combination of temporal frequency and direction that was used. We did not vary the starting phase of the drifting gratings (only the static gratings), so hopefully this gives you the information you need.
