Theta Sweep Pipeline Examples¶
ThetaSweepPipeline bundles navigation tasks, direction/grid-cell models,
and visualisation utilities into an end-to-end workflow. The scripts below illustrate a minimal run and a fully customised setup.
theta_sweep_from_external_data.py¶
Location:
examples/pipeline/theta_sweep_from_external_data.pyScenario: Generate a smooth closed-loop trajectory (or load a recorded path) and run the complete theta-sweep pipeline.
Workflow:
Create
timesandpositionsarrays—either synthetic Catmull–Rom samples or an imported dataset.Instantiate
ThetaSweepPipelinewith the default model and theta parameters.Call
pipeline.run(output_dir="theta_sweep_results")to render animations and summary plots.
Output:
theta_sweep_results/containing GIF/MP4 animations, population-activity heat maps, and trajectory diagnostics.Console summary with duration and save paths.
Extensions:
Combine with Tasks and Navigation Examples (
import_external_trajectory.py) to replay experimental trajectories.Adjust
env_size/dtor runtime optionsanimation_fpsandanimation_dpifor quality/performance trade-offs.
advanced_theta_sweep_pipeline.py¶
Location:
examples/pipeline/advanced_theta_sweep_pipeline.pyScenario: Expose every configuration knob—network sizes, theta parameters, output settings, and verbose reports.
Workflow:
Build a deterministic L-shaped trajectory with controlled perturbations.
Pass custom
direction_cell_params/grid_cell_params/theta_params/spatial_nav_paramswhen constructing the pipeline.Execute
run(..., save_animation=True, save_plots=True, verbose=True)and inspect the returnedresultsdictionary.Extract arrays such as
gc_activityandtheta_phasefromresults["data"]for additional analysis.
Output:
advanced_theta_sweep_results/containing animations, figures, and cached simulation tensors.Extensions:
Experiment with
theta_strength_hd/gcortheta_cycle_lento compare rhythm settings.Export
grid_activity/dc_activityas.npzfiles for comparison with experimental recordings.
Usage tips¶
Both scripts depend on
open_loop_navigationandtheta_sweep. Revisit Tasks and Navigation Examples or CANN Network Examples if you need implementation details.Animation rendering can take a few minutes—watch the progress bar. On headless machines keep
show=Falseor installimageio[ffmpeg].