Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft public docs for Multi-Channel timeseries and Large Image workflows #96

Merged
merged 14 commits into from
Jun 12, 2024
80 changes: 75 additions & 5 deletions benchmarks/create_ephys_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -142,6 +142,76 @@
" mr.save_recording_generator(recgen, f'data/ephys_sim_neuropixels_{dur}s_384ch.h5')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Add channel names object"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/droumis/data/ephys_sim_neuropixels/ephys_sim_neuropixels_1s_384ch.h5 num_channels: 384\n",
"channels object already present.\n",
"/Users/droumis/data/ephys_sim_neuropixels/ephys_sim_neuropixels_10s_384ch.h5 num_channels: 384\n",
"channels object already present.\n",
"/Users/droumis/data/ephys_sim_neuropixels/ephys_sim_neuropixels_100s_384ch.h5 num_channels: 384\n",
"channels object added successfully.\n",
"channels object already present.\n",
"/Users/droumis/data/ephys_sim_neuropixels/ephys_sim_neuropixels_200s_384ch.h5 num_channels: 384\n",
"channels object added successfully.\n",
"channels object already present.\n"
]
}
],
"source": [
"import h5py\n",
"from pathlib import Path\n",
"\n",
"durations = [1, 10, 100, 200]\n",
"\n",
"for dur in durations:\n",
" # Open the existing HDF5 file in append mode\n",
" H5_PATH = Path(f'~/data/ephys_sim_neuropixels/ephys_sim_neuropixels_{dur}s_384ch.h5').expanduser()\n",
" with h5py.File(H5_PATH, 'a') as f:\n",
" num_channels = f['channel_positions'].shape[0]\n",
" print(H5_PATH, 'num_channels:', num_channels)\n",
" # skip if 'channels' object already exists\n",
" if 'channels' in f:\n",
" print(\"channels object already present.\")\n",
" else:\n",
" f.create_dataset('channels', data=list(range(384)))\n",
" print(\"channels object added successfully.\") \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"PosixPath('/Users/droumis/data/ephys_sim_neuropixels_10s_384ch.h5')"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H5_PATH"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -152,7 +222,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "neuro-eeg-viewer",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -166,9 +236,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
11 changes: 7 additions & 4 deletions workflows/multi_channel_timeseries/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: neuro-multi-chan
name: neuro-multi-chan-ts
channels:
- conda-forge
dependencies:
Expand All @@ -10,15 +10,18 @@ dependencies:
- datashader
- numpy
- pandas
- xarray
- xarray>=2024.5.0
- ipykernel
- mne
- jupyterlab
- zarr
- kerchunk
- pyarrow
- dask
- jupyter_bokeh
- h5py
- pip
- pip:
- holonote
- holonote
- ndpyramid==0.2.0
- tsdownsample
- mne
Loading