Process raw sessions¶
Uses this package
This section runs aind-behavior-vr-foraging-packaging on raw session folders, to produce the same tables that are in the shared dataset.
If the sessions you need are already in the shared dataset, you do not need any of this.
You need this when a session is not processed yet, when you have the raw data locally, or when you are changing how the tables are made.
1. Install¶
2. Process one session¶
A raw session folder is what the rig wrote: behavior/, the AIND metadata JSONs, and so on.
process_session computes every table and writes one parquet per table:
from aind_behavior_vr_foraging.data_contract import dataset
from aind_behavior_vr_foraging_packaging.pipeline.session import process_session
ds = dataset("path/to/session") # the raw session folder
tables = process_session(ds, output_dir="output/my_session")
# output/my_session/session.parquet, sites.parquet, position_velocity.parquet, ...
tables maps each table name to its dataframe (pandas), already in memory:
The tables are the same as in the shared dataset; every column is described in Processed tables.
3. Or many sessions from the command line¶
uv tool install aind-behavior-vr-foraging-packaging
vr-foraging-packaging batch --input-dir /data/raw --output-dir /data/export
--input-dir holds one raw session folder per session. See Many sessions for the output layout and how to read it back.
Next¶
-
One session in Python
Single tables, output formats (parquet, NWB), errors and provenance.
-
Many sessions
The
batchcommand, its output layout, and reading the export. -
Raw streams
Read the raw files of a session directly, for anything the tables do not cover.