portugueslab / stytra

A modular package to control stimulation and track behaviour
http://www.portugueslab.com/stytra/
GNU General Public License v3.0
41 stars 26 forks source link

Data and metadata saving #14

Closed goodluckandsendhelp closed 4 years ago

goodluckandsendhelp commented 5 years ago

Hello, I'm looking at the files included in the package but I can't seem to find where the data and metadata are saved. I assume that it would be a csv file in the folder where camera captures are saved, but somehow I can't seem to find any csv files saved during test runs at all. I appreciate your help.

goraj commented 5 years ago

Hi, you can change the output path using dir_save kwarg in https://github.com/portugueslab/stytra/blob/a7ec8ed649d69ae4fc2bd7a07465ca45d618c51e/stytra/experiments/__init__.py#L95 Example:

    st = Stytra(protocol=Protocol(), dir_save='D:\\')`

Without setting dir_save it will generate an OS dependent temporary directory. You can see the path used in the Stytra UI on upper right corner.

vilim commented 5 years ago

Thanks @goraj! just to add: you can change the path also by clicking the button with the file location in the GUI.

vilim commented 5 years ago

@goodluckandsendhelp does this answer you question?

goodluckandsendhelp commented 4 years ago

Dear Vilim,

Thank you so much for your help. Your answer was very helpful. However, I do have another question regarding Stytra if you don't mind, please. I found that when running a protocol, Stytra always crashes if we stop the protocol before it's fully run in "Protocol running" on GUI. Is there anything I can do to stop Stytra from crashing when doing so, please?

I look forward to your reply. Thank you so much for your time

Kind regards, Boyi


From: Vilim Štih notifications@github.com Sent: 12 July 2019 09:59 To: portugueslab/stytra stytra@noreply.github.com Cc: Boyi Shen bs92@st-andrews.ac.uk; Mention mention@noreply.github.com Subject: {Disarmed} Re: [portugueslab/stytra] Data and metadata saving (#14)

@goodluckandsendhelphttps://github.com/goodluckandsendhelp does this answer you question?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/portugueslab/stytra/issues/14?email_source=notifications&email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMRB7Y3CHVNB2W5XPO4TAADP7BBXRANCNFSM4H6KEAWA.

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "url": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

vilim commented 4 years ago

Glad to help, you’re welcome!

Sorry to hear that, it should not crash. Please paste here the error message that appears in the terminal prompt after the crash. Also, it would be helpful to have the outputs of the conda list and conda info commands that you can run in the anaconda prompt. I would suggest you to open a new issue for this.

On 29. Jul 2019, at 09:44, goodluckandsendhelp notifications@github.com wrote:

Dear Vilim,

Thank you so much for your help. Your answer was very helpful. However, I do have another question regarding Stytra if you don't mind, please. I found that when running a protocol, Stytra always crashes if we stop the protocol before it's fully run in "Protocol running" on GUI. Is there anything I can do to stop Stytra from crashing when doing so, please?

I look forward to your reply. Thank you so much for your time

Kind regards, Boyi


From: Vilim Štih notifications@github.com Sent: 12 July 2019 09:59 To: portugueslab/stytra stytra@noreply.github.com Cc: Boyi Shen bs92@st-andrews.ac.uk; Mention mention@noreply.github.com Subject: {Disarmed} Re: [portugueslab/stytra] Data and metadata saving (#14)

@goodluckandsendhelphttps://github.com/goodluckandsendhelp does this answer you question?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/portugueslab/stytra/issues/14?email_source=notifications&email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMRB7Y3CHVNB2W5XPO4TAADP7BBXRANCNFSM4H6KEAWA.

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "url": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ] — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

goodluckandsendhelp commented 4 years ago

Dear Vilim,

Thank you so much for your email.

There are two issues when we run Stytra this week:

Stytra was functioning wonderfully before these issues raised yesterday. Here are what appeared in the Anaconda prompt as we initiate Stytra:

(base) C:\WINDOWS\system32>python -m stytra.experiments.bs_testrun0 Second screen not available

:3: NumbaPerformanceWarning: ←[1m←[1m←[1m←[1mnp.dot() is faster on conti guous arrays, called on (array(float64, 2d, A), array(float64, 2d, A))←[0m←[0m←[ 0m←[0m :3: NumbaPerformanceWarning: ←[1m←[1m←[1m←[1mnp.dot() is faster on conti guous arrays, called on (array(float64, 2d, C), array(float64, 2d, A))←[0m←[0m←[ 0m←[0m C:\ProgramData\Anaconda3\lib\site-packages\stytra\gui\fishplots.py:236: RuntimeW arning: All-NaN slice encountered self.vmax = np.nanmax(vel) C:\ProgramData\Anaconda3\lib\site-packages\numba\ir_utils.py:1959: NumbaPendingD eprecationWarning: ←[1m Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'bout_coords' of function 'find_bouts_online'. For more information visit http://numba.pydata.org/numba-doc/latest/reference/de precation.html#deprecation-of-reflection-for-list-and-set-types ←[1m File "..\..\ProgramData\Anaconda3\lib\site-packages\stytra\tracking\online_bouts .py", line 52:←[0m ←[1m@jit(nopython=True) ←[1mdef find_bouts_online( ←[0m←[1m^←[0m←[0m ←[0m warnings.warn(NumbaPendingDeprecationWarning(msg, loc=loc)) C:\ProgramData\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\PlotCurveItem .py:131: RuntimeWarning: All-NaN slice encountered b = (np.nanmin(d), np.nanmax(d)) C:\ProgramData\Anaconda3\lib\site-packages\stytra\gui\fishplots.py:236: RuntimeW arning: All-NaN slice encountered self.vmax = np.nanmax(vel) Here are what appeared next in the Anaconda prompt as we pause the running protocol: C:\ProgramData\Anaconda3\lib\site-packages\skimage\io\_io.py:141: UserWarning: C :\Data\testrun0_protocol\190730_f0\160353_img.png is a low contrast image warn('%s is a low contrast image' % fname) Thank you so much for your time. I sincerely look forward to your reply. Kind regards, Boyi ________________________________ From: Vilim Štih Sent: 29 July 2019 14:52 To: portugueslab/stytra Cc: Boyi Shen ; Mention Subject: {Disarmed} Re: [portugueslab/stytra] Data and metadata saving (#14) Glad to help, you’re welcome! Sorry to hear that, it should not crash. Please paste here the error message that appears in the terminal prompt after the crash. Also, it would be helpful to have the outputs of the `conda list` and `conda info` commands that you can run in the anaconda prompt. I would suggest you to open a new issue for this. > On 29. Jul 2019, at 09:44, goodluckandsendhelp wrote: > > Dear Vilim, > > Thank you so much for your help. Your answer was very helpful. However, I do have another question regarding Stytra if you don't mind, please. I found that when running a protocol, Stytra always crashes if we stop the protocol before it's fully run in "Protocol running" on GUI. Is there anything I can do to stop Stytra from crashing when doing so, please? > > I look forward to your reply. Thank you so much for your time > > Kind regards, > Boyi > ________________________________ > From: Vilim Štih > Sent: 12 July 2019 09:59 > To: portugueslab/stytra > Cc: Boyi Shen ; Mention > Subject: {Disarmed} Re: [portugueslab/stytra] Data and metadata saving (#14) > > > @goodluckandsendhelp does this answer you question? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread. > > [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "url": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y6F47B27IUKNQATMULP7BBXRA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZFPNY#issuecomment-510810039", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ] > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub, or mute the thread. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y3KKDDVGEDX6JQYLSLQB3YYHA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3AYVDI#issuecomment-516000397", "url": "https://github.com/portugueslab/stytra/issues/14?email_source=notifications\u0026email_token=AMRB7Y3KKDDVGEDX6JQYLSLQB3YYHA5CNFSM4H6KEAWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3AYVDI#issuecomment-516000397", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
vilim commented 4 years ago

I find it difficult to pinpoint the source of the problems, all the terminal messages you pasted (please use the code formatting syntax ``` next time, it makes them much easier to read) are warnings and the appearance of any of them does not crash Stytra. For camera related issues, restarting the computer and ensuring no other processes (such as the Ximea tools) are accessing the camera usually solves the issues.

Also, I would not not recommend writing your code inside the Stytra package itself (unless it is something of general interest), just install it with pip and it will be accessible for your scripts.

Finally, you seem to be running python from an administrative prompt, which should not be necessary and is certainly not recommended. I would suggest uninstalling and freshly installing anaconda localy (for a single user), this often sorts out many issues.

vilim commented 4 years ago

Closing this issue due to inactivity