{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Processing monocular and binocular data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", "import sys\n", "sys.path.insert(0,\"..\")\n", "import pypillometry as pp\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data in `pypillometry` can contain different `variables` from different `eyes`. The variables and eyes supported when importing raw data are\n", "\n", "- `left_x`, `right_x` (x-coordinate in screen coordinates from the eyetracker)\n", "- `left_y`, `right_y` (y-coordinate in screen coordinates from the eyetracker)\n", "- `left_pupil`, `right_pupil` (pupil size from left and right eye)\n", "\n", "Depending on which class is chosen (`PupilData`, `GazeData` or `EyeData`), some of these variables are required:\n", "\n", "- `PupilData`: requires at least one of `left_pupil`, `right_pupil` (or both)\n", "- `GazeData`: requires at least one of `(left_x, left_y)` and/or `(right_x, right_y)`\n", "- `EyeData`: requires `x`,`y` and `pupil` from at least one eye\n", "\n", "For example, let's simulate some basic data:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "ename": "ValueError", "evalue": "At least one of the eye-traces must be provided (both x and y)", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[2], line 17\u001b[0m\n\u001b[1;32m 12\u001b[0m deye \u001b[38;5;241m=\u001b[39m pp\u001b[38;5;241m.\u001b[39mEyeData(left_x\u001b[38;5;241m=\u001b[39mleft_x, left_y\u001b[38;5;241m=\u001b[39mleft_y, left_pupil\u001b[38;5;241m=\u001b[39mleft_pupil, time\u001b[38;5;241m=\u001b[39mtime)\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# these are not ok\u001b[39;00m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;66;03m#pp.PupilData(left_x=left_x, time=time)\u001b[39;00m\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m#pp.GazeData(left_x=left_x, time=time)\u001b[39;00m\n\u001b[0;32m---> 17\u001b[0m pp\u001b[38;5;241m.\u001b[39mEyeData(left_x\u001b[38;5;241m=\u001b[39mleft_x, time\u001b[38;5;241m=\u001b[39mtime)\n", "File \u001b[0;32m~/Dropbox/work/projects/pupil/pypillometry/docs/../pypillometry/eyedata/eyedata.py:96\u001b[0m, in \u001b[0;36mEyeData.__init__\u001b[0;34m(self, time, left_x, left_y, left_pupil, right_x, right_y, right_pupil, event_onsets, event_labels, sampling_rate, screen_resolution, physical_screen_size, screen_eye_distance, name, fill_time_discontinuities, keep_orig, notes, inplace, use_cache, cache_dir, max_memory_mb)\u001b[0m\n\u001b[1;32m 94\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCreating EyeData object\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 95\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (left_x \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m left_y \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;129;01mand\u001b[39;00m (right_x \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m right_y \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[0;32m---> 96\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAt least one of the eye-traces must be provided (both x and y)\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 97\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdata\u001b[38;5;241m=\u001b[39mEyeDataDict(left_x\u001b[38;5;241m=\u001b[39mleft_x, left_y\u001b[38;5;241m=\u001b[39mleft_y, left_pupil\u001b[38;5;241m=\u001b[39mleft_pupil,\n\u001b[1;32m 98\u001b[0m right_x\u001b[38;5;241m=\u001b[39mright_x, right_y\u001b[38;5;241m=\u001b[39mright_y, right_pupil\u001b[38;5;241m=\u001b[39mright_pupil)\n\u001b[1;32m 100\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_init_common(time, sampling_rate, \n\u001b[1;32m 101\u001b[0m event_onsets, event_labels, \n\u001b[1;32m 102\u001b[0m name, fill_time_discontinuities, \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 105\u001b[0m cache_dir\u001b[38;5;241m=\u001b[39mcache_dir,\n\u001b[1;32m 106\u001b[0m max_memory_mb\u001b[38;5;241m=\u001b[39mmax_memory_mb)\n", "\u001b[0;31mValueError\u001b[0m: At least one of the eye-traces must be provided (both x and y)" ] } ], "source": [ "left_x = np.random.randn(1000)\n", "right_x = np.random.randn(1000)\n", "left_y = np.random.randn(1000)\n", "right_y = np.random.randn(1000)\n", "left_pupil = np.random.randn(1000)\n", "right_pupil = np.random.randn(1000)\n", "time = np.arange(1000)\n", "\n", "# these are all ok\n", "dpupil = pp.PupilData(left_pupil=left_pupil, right_pupil=right_pupil, time=time)\n", "dgaze = pp.GazeData(left_x=left_x, left_y=left_y, right_x=right_x, right_y=right_y, time=time)\n", "deye = pp.EyeData(left_x=left_x, left_y=left_y, left_pupil=left_pupil, time=time)\n", "\n", "# these are not ok\n", "#pp.PupilData(left_x=left_x, time=time)\n", "#pp.GazeData(left_x=left_x, time=time)\n", "pp.EyeData(left_x=left_x, time=time)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once the data is loaded, we can check which variables and eyes are available using the `.eyes` and `.variables` attribute:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(['left'], ['x', 'pupil', 'y'])" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "deye.eyes, deye.variables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Simply printing an object will also show what data sources are available and give a glimpse into the data structure:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "EyeData(petokiga, 55.6KiB):\n", " n : 1000\n", " sampling_rate : 1000.0\n", " data : ['left_x', 'left_y', 'left_pupil']\n", " nevents : 0\n", " screen_limits : not set\n", " physical_screen_size: not set\n", " screen_eye_distance : not set\n", " duration_minutes : 0.016666666666666666\n", " start_min : 0.0\n", " end_min : 0.01665\n", " parameters : {}\n", " glimpse : EyeDataDict(vars=3,n=1000,shape=(1000,)): \n", " left_x (float64): -0.05614305080280796, -0.6414526083279584, -1.704862857943198, 1.4798705854852807, 0.8472706708383512...\n", " left_y (float64): -0.7499467879300401, 0.20023206315811148, 1.2681504964811687, -0.9232746614049664, -1.6396223281209275...\n", " left_pupil (float64): 0.28284068252769706, -0.4969359675178975, -1.7109730132713936, -1.024197014557436, -0.7792117291273035...\n", "\n", " eyes : ['left']\n", " nblinks : {}\n", " blinks : {'left': None}\n", " params : {}\n", " History:\n", " *\n", " └ fill_time_discontinuities()" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "deye" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(['pupil', 'y', 'x'], ['left', 'right'])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d = pp.get_example_data(\"rlmw_002_short\")\n", "d.variables, d.eyes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Almost all of `pypillometry`'s functions have keyword arguments `eyes=` and `variables=` that specify which eyes/variables to operate on. By default, all of the variables and eyes are processed. \n", "\n", "For example, we can run the `scale()` function that will re-scale the data to have mean=0 and standard devation 1. \n", "Here, we use the context manager `pp.loglevel(\"DEBUG\")` to get output from `pypillometry` internals:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32mpp: 12:59:13\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36m_get_eye_var\u001b[0m:\u001b[36m194\u001b[0m | \u001b[34m\u001b[1mscale(): eyes=['left'], vars=['pupil', 'y', 'x']\u001b[0m\n", "\u001b[32mpp: 12:59:13\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mscale\u001b[0m:\u001b[36m820\u001b[0m | \u001b[34m\u001b[1mMean: {'left': {'pupil': 0.0017743030582778934, 'y': -0.02958842274723986, 'x': 0.025062813034298286}}\u001b[0m\n", "\u001b[32mpp: 12:59:13\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mscale\u001b[0m:\u001b[36m821\u001b[0m | \u001b[34m\u001b[1mSD: {'left': {'pupil': 0.9685169385611292, 'y': 1.012354831683368, 'x': 0.9977838504196321}}\u001b[0m\n" ] } ], "source": [ "with pp.loglevel(\"DEBUG\"):\n", " deye.scale(eyes=\"left\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The output shows that all variables from the left eye have been processed. \n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Which functions work on which data?\n", "\n", "Not all of `pypillometry`s functions can be applied to all variables. Functions that are specific to pupil data have the prefix `pupil_*` and functions that only work on gaze (x/y) data, have the prefix `gaze_`. The other functions will operate on all variables (which may or may not make sense, it is up to you to check!). \n", "\n", "Functions that work only on pupillometric data are implemented in the `PupilData` class and are therefore not available when using `GazeData`:" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "ename": "AttributeError", "evalue": "'GazeData' object has no attribute 'pupil_blinks_detect'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[32], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m dpupil\u001b[38;5;241m.\u001b[39mpupil_blinks_detect() \u001b[38;5;66;03m# works fine\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m dgaze\u001b[38;5;241m.\u001b[39mpupil_blinks_detect()\n", "\u001b[0;31mAttributeError\u001b[0m: 'GazeData' object has no attribute 'pupil_blinks_detect'" ] } ], "source": [ "dpupil.pupil_blinks_detect() # works fine\n", "dgaze.pupil_blinks_detect() # fails\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Functions that are implemented in `GenericEyeData` will work for both:" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "GazeData(gememoda, 103.9KiB):\n", " n : 1000\n", " sampling_rate : 1000.0\n", " data : ['left_x', 'left_y', 'right_x', 'right_y', 'mean_y', 'mean_x']\n", " nevents : 0\n", " screen_limits : not set\n", " physical_screen_size: not set\n", " screen_eye_distance : not set\n", " duration_minutes : 0.016666666666666666\n", " start_min : 0.0\n", " end_min : 0.01665\n", " parameters : {scale: {...}}\n", " glimpse : EyeDataDict(vars=6,n=1000,shape=(1000,)): \n", " left_x (float64): -0.0813862278918966, -0.6679957999740566, -1.7337679601147598, 1.458039004980029, 0.8240340404971094...\n", " left_y (float64): -0.711567073755129, 0.22701574459144955, 1.2819012451103702, -0.8827796447335403, -1.5903849667971501...\n", " right_x (float64): 0.9626973487677861, -0.17827876962019754, 0.1106137723940685, -0.9696903516215334, 0.6644680267943046...\n", " right_y (float64): 0.31340189774712973, 1.1308736355320714, -0.7814852910860114, -1.2597233647796173, -0.3645995245346349...\n", " mean_y (float64): -0.2900743012870026, 0.9746687313634781, 0.3671378610511327, -1.541330111846402, -1.4116343476312987...\n", " mean_x (float64): 0.6144940257680912, -0.5963646337735499, -1.1476480335279726, 0.353192240734368, 1.0459758453244563...\n", "\n", " History:\n", " *\n", " └ fill_time_discontinuities()\n", " └ merge_eyes()\n", " └ scale()" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dpupil.scale() # works\n", "dgaze.scale() # works" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating new variables or eyes\n", "\n", "In some cases, new variables or \"eyes\" can be created. For example, we might consider to reduce a binocular dataset to one where we average the timeseries from the two eyes. In that case, we can use function `merge_eyes()`:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PupilData(debibiki, 56.3KiB):\n", " n : 1000\n", " sampling_rate : 1000.0\n", " eyes : ['mean', 'left', 'right']\n", " data : ['left_pupil', 'right_pupil', 'mean_pupil']\n", " nevents : 0\n", " nblinks : {}\n", " blinks : {'mean': None, 'left': None, 'right': None}\n", " duration_minutes: 0.016666666666666666\n", " start_min : 0.0\n", " end_min : 0.01665\n", " params : {}\n", " glimpse : EyeDataDict(vars=3,n=1000,shape=(1000,)): \n", " left_pupil (float64): 0.28284068252769706, -0.4969359675178975, -1.7109730132713936, -1.024197014557436, -0.7792117291273035...\n", " right_pupil (float64): 2.5061323051140176, 0.5500808555889285, -0.4194523189113897, 0.5384978966510412, -1.3899010906520874...\n", " mean_pupil (float64): 1.3944864938208574, 0.026572444035515508, -1.0652126660913916, -0.24284955895319738, -1.0845564098896956...\n", "\n", " History:\n", " *\n", " └ fill_time_discontinuities()\n", " └ merge_eyes(eyes=['left', 'right'],variables=['pupil'],method=mean)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dpupil.merge_eyes(eyes=[\"left\", \"right\"], variables=[\"pupil\"], method=\"mean\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can see that a new \"eye\" with variable \"pupil\" called `mean_pupil` has been created. In this case, the original data `left_pupil` and `right_pupil` have been preserved (this can be changed by using `keep_eyes=False`).\n", "\n", "In other cases, the package can create new variables. For example, the function `pupil_estimate_baseline()` will estimate tonic fluctuation in the pupil (see https://osf.io/preprints/psyarxiv/7ju4a_v2/) and will create a new variable `_baseline`." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['pupil', 'baseline', 'y', 'x']" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d = pp.get_example_data(\"rlmw_002_short\")\n", "d.pupil_estimate_baseline()\n", "d.variables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Debugging\n", "\n", "If you want to be sure what steps `pupillometry` is taking, and which variables/eyes are being processed, \n", "you can use the `pp.loglevel()` context manager to temporarily increase the logging level (the result is a rather lengthy and detailed debug-output):" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36m_get_eye_var\u001b[0m:\u001b[36m194\u001b[0m | \u001b[34m\u001b[1mpupil_estimate_baseline(): eyes=['left', 'right'], vars=['pupil', 'baseline', 'y', 'x']\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mpupil_estimate_baseline\u001b[0m:\u001b[36m413\u001b[0m | \u001b[34m\u001b[1mEstimating baseline for eye left\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m198\u001b[0m | \u001b[34m\u001b[1mDownsampling factor is 50\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m208\u001b[0m | \u001b[34m\u001b[1mDownsampling done\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m214\u001b[0m | \u001b[34m\u001b[1mPeak-detection done, 42 peaks detected\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m217\u001b[0m | \u001b[34m\u001b[1mB-spline matrix built, dims=(410, 46)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m228\u001b[0m | \u001b[34m\u001b[1mCompiling Stan model: /home/mmi041/Dropbox/work/projects/pupil/pypillometry/docs/../pypillometry/stan/baseline_model_asym_laplac.stan\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m250\u001b[0m | \u001b[34m\u001b[1mOptimizing Stan model\u001b[0m\n", "13:12:00 - cmdstanpy - INFO - Chain [1] start processing\n", "13:12:00 - cmdstanpy - INFO - Chain [1] done processing\n", "13:12:00 - cmdstanpy - WARNING - The default behavior of CmdStanVB.stan_variable() will change in a future release to return the variational sample, rather than the mean.\n", "To maintain the current behavior, pass the argument mean=True\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m259\u001b[0m | \u001b[34m\u001b[1mEstimating PRF model (NNLS)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m270\u001b[0m | \u001b[34m\u001b[1m2nd Peak-detection done, 32 peaks detected\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m274\u001b[0m | \u001b[34m\u001b[1m2nd B-spline matrix built, dims=(410, 36)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m291\u001b[0m | \u001b[34m\u001b[1mOptimizing 2nd Stan model\u001b[0m\n", "13:12:00 - cmdstanpy - INFO - Chain [1] start processing\n", "13:12:00 - cmdstanpy - INFO - Chain [1] done processing\n", "13:12:00 - cmdstanpy - WARNING - The default behavior of CmdStanVB.stan_variable() will change in a future release to return the variational sample, rather than the mean.\n", "To maintain the current behavior, pass the argument mean=True\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mpupil_estimate_baseline\u001b[0m:\u001b[36m413\u001b[0m | \u001b[34m\u001b[1mEstimating baseline for eye right\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m198\u001b[0m | \u001b[34m\u001b[1mDownsampling factor is 50\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m208\u001b[0m | \u001b[34m\u001b[1mDownsampling done\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m214\u001b[0m | \u001b[34m\u001b[1mPeak-detection done, 42 peaks detected\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m217\u001b[0m | \u001b[34m\u001b[1mB-spline matrix built, dims=(410, 46)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m228\u001b[0m | \u001b[34m\u001b[1mCompiling Stan model: /home/mmi041/Dropbox/work/projects/pupil/pypillometry/docs/../pypillometry/stan/baseline_model_asym_laplac.stan\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m250\u001b[0m | \u001b[34m\u001b[1mOptimizing Stan model\u001b[0m\n", "13:12:00 - cmdstanpy - INFO - Chain [1] start processing\n", "13:12:00 - cmdstanpy - INFO - Chain [1] done processing\n", "13:12:00 - cmdstanpy - WARNING - The default behavior of CmdStanVB.stan_variable() will change in a future release to return the variational sample, rather than the mean.\n", "To maintain the current behavior, pass the argument mean=True\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m259\u001b[0m | \u001b[34m\u001b[1mEstimating PRF model (NNLS)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m270\u001b[0m | \u001b[34m\u001b[1m2nd Peak-detection done, 35 peaks detected\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m274\u001b[0m | \u001b[34m\u001b[1m2nd B-spline matrix built, dims=(410, 39)\u001b[0m\n", "\u001b[32mpp: 13:12:00\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mbaseline_envelope_iter_bspline\u001b[0m:\u001b[36m291\u001b[0m | \u001b[34m\u001b[1mOptimizing 2nd Stan model\u001b[0m\n", "13:12:00 - cmdstanpy - INFO - Chain [1] start processing\n", "13:12:00 - cmdstanpy - INFO - Chain [1] done processing\n", "13:12:00 - cmdstanpy - WARNING - The default behavior of CmdStanVB.stan_variable() will change in a future release to return the variational sample, rather than the mean.\n", "To maintain the current behavior, pass the argument mean=True\n" ] } ], "source": [ "with pp.loglevel(\"DEBUG\"):\n", " d.pupil_estimate_baseline()\n" ] } ], "metadata": { "kernelspec": { "display_name": "pypil", "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.12.5" } }, "nbformat": 4, "nbformat_minor": 2 }