{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook is set up to be used with Python 3(.6+). Also to properly run this notebook the following libraries need to be installed:\n", "- `pip install matplotlib`\n", "- `pip install numpy`\n", "- `pip install pandas`\n", "- `pip install nixio==1.5.0b4`\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# First lets check which files are available to us in the general and in the excercise folder\n", "import os\n", "\n", "os.listdir()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "os.listdir(\"./excercise\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Use the pandas library to read in columns from CSV files\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# The raw data files do not provide column headers so we'll write them first.\n", "# Check the \"README.md\" files for details.\n", "col_names = [\"current_frame\", \"time_elapsed\", \"obj_substracted\", \"substracted_value\", \"obj_value\", \"obj_size\", \"background_value\", \"x_old\", \"y_old\"]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Read the content of the first file.\n", "content = pd.read_csv(\"./excercise/20121202Pflp178GCaMP5kN2shift_210421W1bag.log\", header=None, names=col_names)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Briefly check the content\n", "content" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Plot raw data to get a general idea how it looks like\n", "import matplotlib.pyplot as plot\n", "\n", "x = content[\"current_frame\"]\n", "y = content[\"obj_substracted\"]\n", "plot.plot(x,y)\n", "plot.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we are set\n", "- create a NIX file and a Block in it.\n", "- create a DataArray for each raw data file and transfer the data of one of the columns.\n", "- properly add Dimensions, labels and units.\n", "- plot the data from the data stored in the NIX file.\n", "- add meaningful metadata to the general NIX file and the individual DataArrays from information found in the README.md.\n", "- connect all three DataArrays via a MultiTag. You can use the shift paradim as a reference or come up with your own points of interest.\n", "- Plot the data using the MultiTag.\n", "- If you work with Binder, make sure you regularly download the notebook to your local machine." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.1" } }, "nbformat": 4, "nbformat_minor": 4 }