Pipeline¶
The xarray-based post-processing track: pure Dataset → Dataset stages
driven by a YAML recipe, chained in the order they are meant to run.
“Post-processing” here means: bin Lagrangian particle data to an Eulerian
grid, phase/ensemble-average it, derive turbulence metrics, and export.
flowtracks.eulerian¶
flowtracks.eulerian.eulerian_grid() is the central stage: it bins
ZarrScene/Scene particle observations onto a regular (x, y, z, phase)
grid, returning a xarray.Dataset whose dimensions and coordinates come
from the input data. Companion functions:
flowtracks.eulerian.eulerian_windowed()— per-time-window binningflowtracks.eulerian.clean_field()— mask or remove bad cellsflowtracks.eulerian.fluid_mask()/flowtracks.eulerian.qc_mask()— plausibility masksflowtracks.eulerian.finite_difference_velocity()— derivatives from a gridflowtracks.eulerian.derived_fields()— MKE, TKE, VSS, …flowtracks.eulerian.save_zarr()/flowtracks.eulerian.save_dataset()/flowtracks.eulerian.save_netcdf()— writers
The per-run ensemble and pooled (per-voxel moment) workflows are described
in docs/eulerian_statistics.md in the repository; the same module also
hosts flowtracks.eulerian.run_post_analysis_ds(),
flowtracks.eulerian.run_pooled_analysis_ds(),
flowtracks.eulerian.combine_moments() and
flowtracks.eulerian.moment_statistics().
flowtracks.phase_average¶
Phase averaging as pure Dataset → Dataset functions, driven by a YAML recipe:
flowtracks.phase_average.phase_average()flowtracks.phase_average.fluctuations()
flowtracks.phasing¶
Canonical phase-bin definitions shared with the OpenPTV family:
flowtracks.phasing.validate_bins(),
flowtracks.phasing.phase_of_frame(), flowtracks.phasing.bin_of_frame(),
flowtracks.phasing.assign_bins().
flowtracks.pipeline¶
Thin per-stage wrappers, each independently runnable — the unit the openptv-cloud orchestrator distributes:
Each reads its configuration from a YAML recipe.
flowtracks.provenance¶
flowtracks.provenance.record_run() and
flowtracks.provenance.read_runs() record what was run, with which
parameters, and what it produced — entries appended to run.zarr’s
meta.attrs["runs"].
Modular pipeline for 3DPTV data processing.
Each function is one independently-runnable stage (the decomposition the cloud orchestrator will distribute). All computation lives in the xr modules and the stage wrappers — nothing is implemented here twice.
- flowtracks.pipeline.streamlined_pipeline(config_path='config.yaml', grid_path='grid.yaml', recipe_path='post_recipe.yaml', base='.')[source]¶
Streamlined in-memory pipeline.
Step 1: ptv_is -> Lagrangian HDF5 (via flowtracks).
Step 2: Bin Lagrangian scenes directly into in-memory xarray Datasets.
Steps 3-5: Run phase-averaging, fluctuations, turbulent statistics and derived fields directly on xarray Datasets in memory.
Save final output as NetCDF or Zarr with rich CF metadata for ParaView, and optionally export binary VTK files.