LernerLab / GuPPy

Guided Photometry Analysis in Python, a free and open-source FP analysis tool.
GNU General Public License v3.0
63 stars 11 forks source link

Misalignment of PSTH when using csv input #35

Closed rkast1 closed 1 year ago

rkast1 commented 1 year ago

I am running into a problem where the timestamps of my behavioral events are being distorted/misaligned during the photometry processing by Guppy. I can't figure out what is causing the misalignment, but it looks like there is an across trials gradual accumulation of longer and longer lag between the actual behavioral event and the time 0 assigned in the PSTHs. Note that I am using an Inper FP system, with a 20.4992 Hz sampling rate (per wavelength). To demonstrated what I am seeing, I've attached a screen shot of the heatmap I can generate directly within the Inper software, and a heatmap generated within Guppy. Please note that the order of the trials is reversed from top to bottom in the Guppy Visualization compared to the Inper one. I am happy to provide my csv data and provide the input parameters .json file if they would be helpful for troubleshooting purposes.

Screen Shot 2023-03-29 at 3 00 31 PM

Screen Shot 2023-03-29 at 2 51 16 PM

venus-sherathiya commented 1 year ago

Please send me the .json file, storeslist.csv file and your csv data files. I will look into it. You can send me at venus.sherathiya@northwestern.edu

rkast1 commented 1 year ago

Thank you, Venus. I have solved the issue. It appears that an incorrect sampling rate was the culprit. I had written 20 Hz in the sampling_rate column and later corrected this in my isobestic to the actual sampling rate, 20.4992 Hz, but had overlooked that the signal csv still had 20 Hz listed, which was creating a lag. Take home is that the exact sampling rate is important in that third column. Thanks again for making a super helpful tool!