C-Trap Data Analysis

Installation instructions

Install Lakeview

Install Python packages

Install uv (Python package manager)

How to do this depends on your Operating System.

On Windows:

On Mac OS:

In a terminal execute:

curl -LsSf https://astral.sh/uv/install.sh sh

Create a virtual environment for pylake (needed only the first time)

uv venv pylake

Activate the virtual environment (needed each session)

source pylake/Scripts/activate

Install the needed packaged (needed only first time):

uv pip install lumicks.pylake uv pip install jupyter

It may be needed to install jupyter extensions:

jupyter labextension install jupyter-matplotlib

Launch Jupyter by typing (needed each session)

jupyter notebook

Startup during daily use. Open a terminal, type:

cd Projects source pylake/Scripts/activate jupyter notebook

Example notebook code (follow the  tutorial):

Jupyter notebook

import numpy as np
import matplotlib.pyplot as plt
import lumicks.pylake as lk
filenames = lk.download_from_doi("10.5281/zenodo.7729525", "test_data")
file = lk.File("test_data/kymo.h5")

plt.figure()
file.force1x.plot()
plt.savefig("force1x.png")
plt.show()

d_data = file["Distance"]["Distance 1"]
hf_downsampled, d_cropped = file["Force HF"]["Force 1x"].downsampled_like(d_data)

plt.figure()
d_cropped.plot()
hf_downsampled.plot()
plt.show()

Script sharing website http://harbor.lumicks.com/

-Authored by Nico Stuurman March 2025