Closed teristam closed 1 year ago
Hi Teris,
Well spotted, I knew there were something wrong with the filtering and the order I implemented stuff there. Begun to come back to it on Friday and begun to see the issue from a bit closer but I did not realised yet it was the dividing by the zero centered LP filtered that was the culprit. Well spotted. I'm still traveling right now and will be in the lab tomorrow morning.
Will fix later today.
Thanks very much.
Julien
The parameter named high_pass was renamed to baseline_low_pass to avoid confusion:
Indeed baseline substraction involve doing a very low LOW-PASS filtering (0.001 as per Thomas Akam examples) instead of a high-pass at 0.001.
Fix implemented in current Experiment workflow (data_import.py), switched to (semi) functional method in https://github.com/juliencarponcy/trialexp/commit/e1d585a4bcc4137084603a14fa555ba6f7d830f3
According to the sample notebook at https://github.com/ThomasAkam/photometry_preprocessing/blob/master/Photometry%20data%20preprocessing.ipynb
In the dF/F calculation, the denominator should be the low-pass filter signal, not the photobleached correct signal. But in
https://github.com/juliencarponcy/trialexp/blob/b5765531083a9c17be9e1fcbc56a171b1826f4a9/trialexp/process/pyphotometry/utils.py#L170-L191
the filtered signal actually is the low-passed and high-passed signal. The high-passed signal will have a baseline very close to zero, which will lead to problem when calculating
analog_1_baseline_fluo
and subsequentlydF/F