{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "93051561", "metadata": {}, "outputs": [], "source": [ "import nbimporter\n", "import os\n", "\n", "from utils import slice_session" ] }, { "cell_type": "markdown", "id": "d3d945db", "metadata": {}, "source": [ "## .dat files concatenation" ] }, { "cell_type": "code", "execution_count": null, "id": "03aa6d32", "metadata": {}, "outputs": [], "source": [ "source = \"/home/sobolev/projects/sandbox/\"\n", "f0_name = 'continuous1.dat'\n", "f2_name = 'continuous3.dat'\n", "\n", "with open(os.path.join(source, f0_name), \"ab\") as original, open(os.path.join(source, f2_name), \"rb\") as f2:\n", " original.write(f2.read())" ] }, { "cell_type": "markdown", "id": "f2a6ae56", "metadata": {}, "source": [ "## Slice the sessions" ] }, { "cell_type": "code", "execution_count": 2, "id": "602a0954", "metadata": {}, "outputs": [], "source": [ "sessions_008228 = [\n", "'008228_hippoSIT_2022-05-27_10-24-45',\n", "'008228_hippoSIT_2022-05-27_15-31-55',\n", "'008228_hippoSIT_2022-05-28_12-20-33',\n", "'008228_hippoSIT_2022-05-30_20-57-26',\n", "'008228_hippoSIT_2022-05-31_10-10-19',\n", "'008228_hippoSIT_2022-05-31_15-29-24',\n", "'008228_hippoSIT_2022-05-31_20-12-21',\n", "'008228_hippoSIT_2022-06-01_10-19-39',\n", "'008228_hippoSIT_2022-06-01_15-20-55',\n", "'008228_hippoSIT_2022-06-02_14-30-09',\n", "'008228_hippoSIT_2022-06-02_21-39-53',\n", "'008228_hippoSIT_2022-06-03_10-20-25',\n", "'008228_hippoSIT_2022-06-03_12-13-09',\n", "]" ] }, { "cell_type": "code", "execution_count": 3, "id": "43751d73", "metadata": {}, "outputs": [], "source": [ "sessions_008229 = [\n", "'008229_hippoSIT_2022-05-27_19-47-51',\n", "'008229_hippoSIT_2022-05-28_13-21-39',\n", "'008229_hippoSIT_2022-05-29_10-45-44',\n", "'008229_hippoSIT_2022-05-29_17-16-59',\n", "'008229_hippoSIT_2022-05-30_15-35-25',\n", "'008229_hippoSIT_2022-05-30_21-40-24',\n", "'008229_hippoSIT_2022-05-31_11-00-02',\n", "'008229_hippoSIT_2022-05-31_16-38-23',\n", "'008229_hippoSIT_2022-06-01_11-08-51',\n", "'008229_hippoSIT_2022-06-01_16-09-26',\n", "'008229_hippoSIT_2022-06-02_15-26-01',\n", "'008229_hippoSIT_2022-06-02_20-42-08',\n", "'008229_hippoSIT_2022-06-03_09-18-49',\n", "]" ] }, { "cell_type": "code", "execution_count": 7, "id": "59e72763", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-27_19-47-51 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-28_13-21-39 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-29_10-45-44 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-29_17-16-59 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-30_15-35-25 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-30_21-40-24 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-31_11-00-02 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-05-31_16-38-23 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-06-01_11-08-51 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-06-01_16-09-26 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-06-02_15-26-01 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-06-02_20-42-08 done\n", "Moviepy - Running:\n", ">>> \"+ \" \".join(cmd)\n", "Moviepy - Command successful\n", "Session 008229_hippoSIT_2022-06-03_09-18-49 done\n" ] } ], "source": [ "t_start = 0\n", "t_end = 600 # in seconds\n", "\n", "for session in sessions_008229:\n", " src_path = os.path.join('/home/sobolev/nevermind/Andrey/data/008229/', session)\n", " dst_path = os.path.join('/home/sobolev/nevermind/Andrey/sandbox/4Kate', session)\n", "\n", " slice_session(src_path, dst_path, t_start, t_end)\n", " print('Session %s done' % session)" ] }, { "cell_type": "code", "execution_count": null, "id": "ce19ba80", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }