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

.json File not Found Error on Step 1: Save Input Parameters #74

Open isabella-ca opened 6 months ago

isabella-ca commented 6 months ago

Hello, I am using NPM data and I was having a problem on Step 3 earlier (wouldn't read my list of events). After reading some other troubleshooting suggestions, I re-downloaded and re-installed GuPPy from the main source code, as well as updating it. However, now I get a popup that asks me what folder my files are in, but once I select them and click "Save to file", I get the following error: image And then tracebacks, and finally: image And I can't proceed to any step beyond this, Step 2 GUI comes up blank if I try to continue. It seems like it's trying to write a .json file over the .csv filepath rather than just to the folder housing the .csvs? When I go to check the original folder, there are no .json files created.

Help is much appreciated!

venus-sherathiya commented 6 months ago

Let's say all your data folders are on Desktop. In that case, select Desktop when you get the first pop up. After that, GuPPy will launch. In the Input Parameters GUI, select the folder where your data files for a particular recording session is located. If I am not wrong, from the screenshot, it should be "b172b182_12feb2024" folder.

isabella-ca commented 6 months ago

Thank you, that worked! image But then when I try to open the Store Names GUI (I can move this to a separate thread if you prefer) I get several errors: image image (whitenoise being the name of one of my stimuli) image The "time not found in axis" error pops up multiple times.

venus-sherathiya commented 6 months ago

can you please send me the full screenshot of your raw data files which you are using for analysis ?

isabella-ca commented 6 months ago

Here is my NPM file: image

And here is a file containing the timestamp (from ComputerTimestamps) where a given stimulus was played: image

If it helps, I do see the chev1/chod1 and chev2/chod2 files, as well as the .json file, in the main folder, it's just that the storenames GUI won't open.

venus-sherathiya commented 6 months ago

This is a little different NPM file from what I have seen before. You have SystemTimestamp and ComputerTimestamp columns which I never saw before in NPM file. Is this the actual NPM raw data file ? Also, the TTL file has two columns but what I have usually seen in NPM TTL files is that the columns do not have names.

isabella-ca commented 6 months ago

Yep! NPM recently updated their output I think, so maybe that's the discrepancy? It's from their FP3002 system. Let me see if I can find what the older output looks like, if it's just a matter of removing or changing a column name I'm happy to do that manually...

In the meantime, maybe this is my problem, the stimulus file isn't an actual .TTL file, we were running stimuli out of a different computer, so we used an Arduino to sync the stimulus onset with the NPM file. The stimuli are in a .csv, just with the timestamps and name of the stimulus. I tried just now running it without column headers on the stimulus file, and I'm getting the same "Time not found in axis" error, and the GUI won't open... but the files are still being generated: image

venus-sherathiya commented 6 months ago

Let's do one thing. Is it possible for you to send me your data ? I can try to add support for this new version of NPM. If I am not wrong, your TTLs are in reference to ComputerTimestamp, right ?

isabella-ca commented 6 months ago

Tried reformatting to make it look more like in your YouTube video (https://www.youtube.com/watch?v=n1HSGRnBYPQ): image But still getting the time not found error.

Happy to send over my data, please see attached. And yes, the TTLs are in reference to the ComputerTimestamp column. bl72bl82_12feb2024_fp.csv bl72bl82_12feb2024_stimuli.csv Happy also to generate a few shorter examples, this one is ~30minutes long.

venus-sherathiya commented 6 months ago

This one is fine. No need for a shorter examples. I will try to look into it and add support for it. I will get back to you as soon as I will figure it out.

isabella-ca commented 6 months ago

Great, thank you so much!!

venus-sherathiya commented 6 months ago

Quick question, when I look at your SystemTimestamp and ComputerTimeStamp, I can see there is difference in sampling rate. If I calculate sampling rate using SystemTimestamp, it turns out to be 30 and with ComputerTimestamp, it turns out be 32. Please let me know if I am wrong. Why is it so ? Also, systemtimestamp are in seconds and computer timestamps are in microseconds, right ?

isabella-ca commented 6 months ago

That's really weird... I'm recording at 30Hz/channel for 60Hz total, so it should be 30 not 32. SystemTimestamp is in seconds, ComputerTimestamp is in milliseconds.

venus-sherathiya commented 6 months ago

Sorry, there was a typo before, I meant computer timestamps are in milliseconds. Your computer timestamps per channel turns out to be 32 (which is wrong) if you are recording at 30 Hz and your TTLs are in reference to computer timestamps. Is there a way where you can record your TTLs in system timestamps ?

isabella-ca commented 5 months ago

Strange, on my end it looks like the computer timestamps channel is covering 1000ms over the course of 60 frames (30 each per isosbestic and signal channels)... confused about why this is not the case for you? Let me try to convert the TTLs and get back to you.

venus-sherathiya commented 2 months ago

Were you able to fix the problem ? If not, please let me know over here