Open HenryJFlynn opened 1 year ago
To start with this issue I decided the first graph will calculate how much water the mouse receives and will update with each trial. The first task that come with this graph is writing a code that will tally up how many times the mouse receives a reward in a trial.
I successfully was able to create a tally of the mount of times the mouse receives a reward. I plan to use this list to plot the number of trials and the water output. Additionally I would like for the graph to calculate the output the amount of water.
I was able to make a graph but I realized that the code is not correctly counting the times a reward is outputted so I am now working on correcting that. Additionally the data is not saving correctly it only stores the log so that should be fixed as well.
In be able to correct the counter I wanted to find where the current states are being deiced. In this section of the code the current state is a number that relates to the state transition diagram. Then I made it count how many times the current state is the pre stimreward or the center port reward delivery. It seems that by using this method the count is now correct.
I now plan to make this data graph-able this will have to either take place in the mouse2afc or the pybpod.
I had originally tried to take this data and import it into the run section in mouse2afc but this was not possible so now I am trying to graph this data in the pybpod section.
This is the correct totals of the values that happen over the trials. I plan to append these values and graph them. I originally tried to do this in the run function in the pybpod section like how I was able to in the mouse2afc. So I am going to do it in the transtion_to_new_state def.
by implementing this line of code in the run section in the BbpodBase it allows for the graph to be displayed after the experiment is completed. Now all I need to do is make sure that the data that is plotting is correct and see if there is a way for the amount of water set in the parameters to be calculated into the amount to give an accurate amount of water.
by running this the graphs data is correct and running.
by creating a plotting def and calling it in the run state machine def it was able to correctly graph the data for how many times a motivator and a reward is given per trial.
Now I plan to make the graph appear at the the beginning and update with each trial
After some thought I moved the counting back over to the mouse2afc directory so that I can calculate the total ware with the task parameters. Now that the data is correctly updating I now just need to make it graph. Additionally this is taking place in the data file under CustomData.
By updating the code the parameter values can be found and them multiplied by the count to determine the correct amount of water that is dispersed.
By multiplying these values the graph is now correctly showing the amount of water that is dispersed over each trial.
Now all I need to do I make this graph in real time. After that is completed I would like to make a graph that shows how long each trial takes.
I was able to make the graph update in real time while the experiment is running by doing these following steps.
Initializing the graph in the data file
Creating a definition to update the plot
Lastly implementing it in the run section int mouse2afc file
Now I would like to see if I could make a second graph but instead of amount of water dispersed over a trial I would like to see how much time it takes per trial.
Background:
In the MATLAB protocol, there are live plots of experimental parameters such as mouse performance No such feature exists with the PyBpod protocol
Goal:
Create plots of experimental parameters similar the functionalities in MATLAB
See https://github.com/HenryJFlynn/mouse2afc/issues/32 for the original issue