{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Viewer Notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook is to view events from an HDF5 set." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import cait as ai\n", "%config InlineBackend.figure_formats = ['svg'] # we need this for a suitable resolution of the plots" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameters" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Adapt these parameters to your HDF5 set." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2021-07-04T22:43:31.879406Z", "start_time": "2021-07-04T22:43:31.873352Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Adapt these parameters to your measurement!\n" ] } ], "source": [ "print('Adapt these parameters to your measurement!')\n", "\n", "PATH_DATA = ... # the path to the data set\n", "FNAME = ... # the file name, without extension ('.h5') and appendix, e.g. bck_001\n", "NMBR_CHANNELS = 2 # the number channels in the file\n", "RECORD_LENGTH = 16384 # the number of samples per record window (written in par file)\n", "SAMPLE_FREQUENCY = 25000 # the sample frequency of the measurement (written in par file)\n", "APPENDIX = False # if the file has an automatically appended Cait appendix, e.g. '-P_0-L_1'\n", "CHANNELS = None # if you set the appendix to true, you need to put here a list of the channel number inside the rdt file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Event Interface" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create instance\n", "\n", "ei = ai.EventInterface(record_length=RECORD_LENGTH,\n", " sample_frequency=SAMPLE_FREQUENCY,\n", " nmbr_channels=NMBR_CHANNELS)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ei.load_h5(path=PATH_DATA,\n", " fname=FNAME,\n", " channels=CHANNELS,\n", " appendix=APPENDIX,\n", " which_to_label=['events'])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# includes\n", "\n", "# ei.load_labels_csv(path='', type='events')\n", "# ei.create_labels_csv(path='')\n", "ei.load_of()\n", "ei.load_sev_par(name_appendix='_down4')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# start\n", "\n", "ei.start(start_from_idx=0, print_label_list=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Content" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dh = ai.DataHandler(nmbr_channels=NMBR_CHANNELS)\n", "\n", "dh.set_filepath(path_h5=PATH_DATA,\n", " fname=FNAME,\n", " channels=CHANNELS,\n", " appendix=APPENDIX)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dh.content()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Done." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }