flowtracks 1.6.2.dev3__py3-none-any.whl → 1.6.2.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flowtracks/_version.py +3 -3
- flowtracks/eulerian.py +6 -0
- flowtracks/io.py +10 -1
- flowtracks/writers.py +19 -1
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/METADATA +1 -1
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/RECORD +28 -28
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/batch_Lagrangian_to_Eulerian.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/hdf5_scene_analysis.ipynb +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/linking_trajectories.ipynb +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_dual_rig_trajectories.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_flowtracks.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_hdf5_vs_zarr_scene_analysis.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_linking_trajectories_zarr.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_phase_averaging_demo.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_phase_metrics.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_vtk_writers_preview.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/marimo_zarr_dashboard.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/repeated_interpolation.ipynb +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/run_pipeline.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/visualize_marimo.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/visualize_results.py +0 -0
- {flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/scripts/analyse_fhdf.py +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/WHEEL +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/entry_points.txt +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/licenses/LICENSE.txt +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/licenses/LICENSES/BSD-3-Clause.txt +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/licenses/LICENSES/GPL-3.0-only.txt +0 -0
- {flowtracks-1.6.2.dev3.dist-info → flowtracks-1.6.2.dev4.dist-info}/top_level.txt +0 -0
flowtracks/_version.py
CHANGED
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.6.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 6, 2, '
|
|
21
|
+
__version__ = version = '1.6.2.dev4'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 6, 2, 'dev4')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gc00cb25a5'
|
flowtracks/eulerian.py
CHANGED
|
@@ -150,6 +150,12 @@ def eulerian_grid(scene, grid_params, first, last, cycletime=None,
|
|
|
150
150
|
caller-side frame selection (see :func:`flowtracks.phasing.bin_of_frame`);
|
|
151
151
|
this gridder always tiles contiguously.
|
|
152
152
|
|
|
153
|
+
Input contract (NOT validated — the caller states it): positions in
|
|
154
|
+
METRES, velocities in METRES PER SECOND. The output dataset is labelled
|
|
155
|
+
``m`` / ``m s-1`` (CF) on that basis. Per-frame velocities (no frame
|
|
156
|
+
rate known) average arithmetically fine, but the ``m s-1`` label is then
|
|
157
|
+
wrong — relabel to ``m frame-1`` downstream, or state the frame rate.
|
|
158
|
+
|
|
153
159
|
smoothing_sigma (in grid cells, scalar or per-axis (sx, sy, sz)) applies
|
|
154
160
|
Gaussian kernel smoothing to the velocity sums AND the counts before the
|
|
155
161
|
division (Shepard/kernel estimate); min_count then acts on smoothed counts.
|
flowtracks/io.py
CHANGED
|
@@ -1226,7 +1226,8 @@ def read_zarr_trajectories(zarr_path, first=None, last=None, group="trajectories
|
|
|
1226
1226
|
return []
|
|
1227
1227
|
|
|
1228
1228
|
|
|
1229
|
-
def save_zarr_trajectories(trajects, zarr_path, group="trajectories", overwrite=True
|
|
1229
|
+
def save_zarr_trajectories(trajects, zarr_path, group="trajectories", overwrite=True,
|
|
1230
|
+
units=None):
|
|
1230
1231
|
"""
|
|
1231
1232
|
Save a list of Trajectory objects into a Zarr directory store.
|
|
1232
1233
|
|
|
@@ -1235,6 +1236,11 @@ def save_zarr_trajectories(trajects, zarr_path, group="trajectories", overwrite=
|
|
|
1235
1236
|
zarr_path - path to the target .zarr directory.
|
|
1236
1237
|
group - sub-group name inside the Zarr store.
|
|
1237
1238
|
overwrite - if True, overwrite existing arrays in the group.
|
|
1239
|
+
units - dict of per-array units recorded on the group, e.g.
|
|
1240
|
+
{"pos": "m", "vel": "m s-1", "accel": "m s-2", "time": "frame"}.
|
|
1241
|
+
The writer never guesses: omit it only when the caller truly does
|
|
1242
|
+
not know, in which case no unit claim is stored. Honest rule: no
|
|
1243
|
+
frame rate means per-frame velocity units ("m frame-1"), never "m s-1".
|
|
1238
1244
|
"""
|
|
1239
1245
|
import zarr
|
|
1240
1246
|
|
|
@@ -1275,4 +1281,7 @@ def save_zarr_trajectories(trajects, zarr_path, group="trajectories", overwrite=
|
|
|
1275
1281
|
accel_arr = np.concatenate(all_accel, axis=0)
|
|
1276
1282
|
target_group.create_array("accel", data=accel_arr, overwrite=overwrite)
|
|
1277
1283
|
|
|
1284
|
+
if units:
|
|
1285
|
+
target_group.attrs.update({f"{k}_units": v for k, v in units.items()})
|
|
1286
|
+
|
|
1278
1287
|
|
flowtracks/writers.py
CHANGED
|
@@ -134,13 +134,20 @@ def _clean(values: np.ndarray) -> np.ndarray:
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
def write_eulerian_series(ds: xr.Dataset, out_dir: Path, prefix: str = "phase",
|
|
137
|
-
|
|
137
|
+
time_dim: str = "phase", dt: float = 1.0,
|
|
138
|
+
units: dict | None = None) -> Path:
|
|
138
139
|
"""Write one Eulerian grid file per ``time_dim`` step plus a ``.pvd`` series.
|
|
139
140
|
|
|
140
141
|
Grid type is chosen from axis spacing: ``vtkImageData`` (``.vti``) when x,
|
|
141
142
|
y and z are each uniformly spaced, ``vtkRectilinearGrid`` (``.vtr``)
|
|
142
143
|
otherwise. Vector fields named by ``VEL_VARS`` are combined into a single
|
|
143
144
|
"velocity" array; every other data variable is written as a scalar.
|
|
145
|
+
|
|
146
|
+
``units`` maps array name to unit string (e.g. ``{"velocity": "m s-1"}``)
|
|
147
|
+
and is stored as grid field data (``units:<name>``); when omitted, the
|
|
148
|
+
dataset's own ``units`` attrs are carried over where present. VTK has no
|
|
149
|
+
unit system, so this is annotation, not enforcement — but the reader no
|
|
150
|
+
longer has to guess.
|
|
144
151
|
"""
|
|
145
152
|
import pyvista as pv
|
|
146
153
|
|
|
@@ -179,6 +186,17 @@ def write_eulerian_series(ds: xr.Dataset, out_dir: Path, prefix: str = "phase",
|
|
|
179
186
|
# skip rather than silently reshape/truncate them.
|
|
180
187
|
continue
|
|
181
188
|
grid.point_data[name] = _clean(da.values).ravel(order="F")
|
|
189
|
+
fields = dict(units) if units else {}
|
|
190
|
+
for name, da in snap.data_vars.items():
|
|
191
|
+
if name not in fields and da.attrs.get("units"):
|
|
192
|
+
fields[name] = da.attrs["units"]
|
|
193
|
+
if "velocity" in grid.point_data:
|
|
194
|
+
for v in VEL_VARS:
|
|
195
|
+
if v in fields:
|
|
196
|
+
fields["velocity"] = fields.pop(v)
|
|
197
|
+
break
|
|
198
|
+
for k, val in fields.items():
|
|
199
|
+
grid.field_data[f"units:{k}"] = np.array([str(val)])
|
|
182
200
|
path = out_dir / f"{prefix}_{i:04d}.{ext}"
|
|
183
201
|
grid.save(str(path))
|
|
184
202
|
entries.append((i * dt, path))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowtracks
|
|
3
|
-
Version: 1.6.2.
|
|
3
|
+
Version: 1.6.2.dev4
|
|
4
4
|
Summary: Library for handling 3D PTV trajectory databases and Lagrangian/Eulerian turbulence post-processing.
|
|
5
5
|
Author-email: Yosef Meller <yosefm@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only AND BSD-3-Clause
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
flowtracks/__init__.py,sha256=iCexskmRtpNJ0fNZWRFkQAqrku7csbKy5NtL2YQNYeo,1532
|
|
2
|
-
flowtracks/_version.py,sha256=
|
|
2
|
+
flowtracks/_version.py,sha256=ZWyF90B5Js1Ikxd3zd_HluOAb1r35l1-eoSda5mck90,541
|
|
3
3
|
flowtracks/an_scene.py,sha256=QV_gtzp-5h1CqAW1Y6ieGco9BxXQDE4f_7-fcy3fluI,7361
|
|
4
4
|
flowtracks/analysis.py,sha256=nob5-pKxjPzB34_oQsxmxYALz4Q_s1BTpC5_VgXX3ss,6320
|
|
5
5
|
flowtracks/combine.py,sha256=-UQtbTH4vjQS88_92h5UZlS60OfQofTWEV6SL1prXgI,4455
|
|
6
|
-
flowtracks/eulerian.py,sha256=
|
|
6
|
+
flowtracks/eulerian.py,sha256=PMt0_TtjrFwRPEvSEKm_wn8YZdClSux4yXEuxiB2EjM,41872
|
|
7
7
|
flowtracks/flux.py,sha256=w4K_jjDWTBIOj4BkoeNoKjIRcvg_6stCqNF8iivxF-A,15137
|
|
8
8
|
flowtracks/format_docstrings.py,sha256=iJVJmtTUYEDEcmF5XSRZ08zpvlVc9lU66CZeqSpEKic,1987
|
|
9
9
|
flowtracks/future_idea_xarray_dask_zarr.py,sha256=4ZS6QuZ2s_sUaiCW0XBo74GrP5fw_clVyhWNjT5gbds,6101
|
|
10
10
|
flowtracks/graphics.py,sha256=Pror0OmWXmlZz5yyEY2qKKQM5t_BMtKeYIAw26I0JeQ,13043
|
|
11
11
|
flowtracks/interpolation.py,sha256=njuB-bvWK5M2tc2Ibm6ZWNg6Tm6H-PTn0a63IldlJaA,39414
|
|
12
|
-
flowtracks/io.py,sha256=
|
|
12
|
+
flowtracks/io.py,sha256=sujLgtY8WIymMZugDv2jlQeL9QR_hZn-MaZPPKsAPvA,48366
|
|
13
13
|
flowtracks/nhist.py,sha256=3xdrfSTSpTojXJcyhwBgagHBmKrm0U_AEsP3BjP9H1o,4089
|
|
14
14
|
flowtracks/pairs.py,sha256=ehYDDTmjeRuzkSAMpdlwnwwAZOPNLKGF_e5HmcKw-2g,4034
|
|
15
15
|
flowtracks/particle.py,sha256=sVng1X8Xp3V9_wgJK2EGsDEx1OFQjd3L63Fzn--MWkM,671
|
|
@@ -25,29 +25,29 @@ flowtracks/stitching.py,sha256=HFsIRdAfqyhmES1OwIFslyWTF9U7kPJ5OKtjBl4YWqA,16895
|
|
|
25
25
|
flowtracks/trajectory.py,sha256=uL4-byZ2tycdrAwGoET4AfLHuKaWRnc8VHLO5zv9MOg,11831
|
|
26
26
|
flowtracks/vortex.py,sha256=4lG3QkvvnWhAHy4tl1pJrBGFLdrlP4pxNdhCZI1VZ4Q,2529
|
|
27
27
|
flowtracks/wall_shear.py,sha256=k9Q5FEchIO9J_onXPOw4PNJQfmsrSyVVvX4RdW-rQlE,6788
|
|
28
|
-
flowtracks/writers.py,sha256=
|
|
28
|
+
flowtracks/writers.py,sha256=NAVz8H2w-Wtiy__acB9uT_NDSO6RqpEywcxm8tk1peg,9273
|
|
29
29
|
flowtracks/zarr_scene.py,sha256=PKCtiTT1t0Hj74Q572ra5DM3uM8lQK1A6DzzfUxvIzI,10468
|
|
30
|
-
flowtracks-1.6.2.
|
|
31
|
-
flowtracks-1.6.2.
|
|
32
|
-
flowtracks-1.6.2.
|
|
33
|
-
flowtracks-1.6.2.
|
|
34
|
-
flowtracks-1.6.2.
|
|
35
|
-
flowtracks-1.6.2.
|
|
36
|
-
flowtracks-1.6.2.
|
|
37
|
-
flowtracks-1.6.2.
|
|
38
|
-
flowtracks-1.6.2.
|
|
39
|
-
flowtracks-1.6.2.
|
|
40
|
-
flowtracks-1.6.2.
|
|
41
|
-
flowtracks-1.6.2.
|
|
42
|
-
flowtracks-1.6.2.
|
|
43
|
-
flowtracks-1.6.2.
|
|
44
|
-
flowtracks-1.6.2.
|
|
45
|
-
flowtracks-1.6.2.
|
|
46
|
-
flowtracks-1.6.2.
|
|
47
|
-
flowtracks-1.6.2.
|
|
48
|
-
flowtracks-1.6.2.
|
|
49
|
-
flowtracks-1.6.2.
|
|
50
|
-
flowtracks-1.6.2.
|
|
51
|
-
flowtracks-1.6.2.
|
|
52
|
-
flowtracks-1.6.2.
|
|
53
|
-
flowtracks-1.6.2.
|
|
30
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/batch_Lagrangian_to_Eulerian.py,sha256=e7mQFqyqvCeAHRKiN1IaxdNJi0e2FU84c7QNrx0L-m0,2296
|
|
31
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/hdf5_scene_analysis.ipynb,sha256=jn0Z_ZVL1-iXaiKXwyAeb74NbXsBpnocCxCSDh814eU,243097
|
|
32
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/linking_trajectories.ipynb,sha256=udz0GLDiPv68BYySg4yO1HWzaB9Sdy3YA3IhnIHDeII,8820
|
|
33
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_dual_rig_trajectories.py,sha256=dzeK0C-knwq1bPOwo0p1RhWrb0RPp-T31rBaGEptXcc,6737
|
|
34
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_flowtracks.py,sha256=7FIJNwBx9aBRmaM5ofmYTXSWEjE0wZqDfs8J47Tmw6U,9440
|
|
35
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_hdf5_vs_zarr_scene_analysis.py,sha256=bjXlMsLJTxJ0JkvGcVZbuDOFYZU4OvdabtDUgqb15So,4536
|
|
36
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_linking_trajectories_zarr.py,sha256=Ny_WUbiZWo0aKw-u2KGFWrhMv-8BvNgBy0UHIqCobYg,8210
|
|
37
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_phase_averaging_demo.py,sha256=vg6j2ayKGl-5uj08bdzzb6pujzJJQ_5bUsG7UuPP7dM,9270
|
|
38
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_phase_metrics.py,sha256=kBc2e_b-orDrm3AnuUXCcxsvmfQWyCtE826pFeolMGE,9367
|
|
39
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_vtk_writers_preview.py,sha256=Otrhhp-QFf6F94EOs6rWu5xOCpbS16EfWy_iMFp7e_I,14611
|
|
40
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/marimo_zarr_dashboard.py,sha256=jVIum6hdEelH4ef7vRgsfLhrbmMsuErsJBzxrnEImnw,9268
|
|
41
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/repeated_interpolation.ipynb,sha256=t9SfoIWRu5XP0SrphWbQy508uzyEibVz61FGjl51fjA,8861
|
|
42
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/run_pipeline.py,sha256=5fGE2tIP6XjFZ1sEYmqBujuLaXFfRL-rNnbr2p2CDfM,7205
|
|
43
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/visualize_marimo.py,sha256=jWrg5IWjY-bmSQwQjaO5qTr0t_G48CsqJYpevdQrxeY,13026
|
|
44
|
+
flowtracks-1.6.2.dev4.data/data/flowtracks-examples/visualize_results.py,sha256=SbPg3EoDcuIyo0rUz3E-AnT4sLWDVJFhgC6xVcracW4,7583
|
|
45
|
+
flowtracks-1.6.2.dev4.data/scripts/analyse_fhdf.py,sha256=QH08NdImGukTEGuZEKFxjStcSelXBv-8A-22G6KtXqM,1315
|
|
46
|
+
flowtracks-1.6.2.dev4.dist-info/licenses/LICENSE.txt,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
47
|
+
flowtracks-1.6.2.dev4.dist-info/licenses/LICENSES/BSD-3-Clause.txt,sha256=XiJR9O5snDB6sAz0bcncOU6msceZgjPRxejWEQGg40Q,1505
|
|
48
|
+
flowtracks-1.6.2.dev4.dist-info/licenses/LICENSES/GPL-3.0-only.txt,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
49
|
+
flowtracks-1.6.2.dev4.dist-info/METADATA,sha256=5FSsqSUpZRPt6m3eOTVB-aQF_2vDOZOelKmkNibfg-k,4773
|
|
50
|
+
flowtracks-1.6.2.dev4.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
51
|
+
flowtracks-1.6.2.dev4.dist-info/entry_points.txt,sha256=U6028E7yQZQiZoXWMl7w4xgZUPwPxAGiAuuMB__c-yQ,60
|
|
52
|
+
flowtracks-1.6.2.dev4.dist-info/top_level.txt,sha256=cR54RNb9y2Wfr_BfuOezmNJOMB4GfIHh1-luXTREnQA,11
|
|
53
|
+
flowtracks-1.6.2.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flowtracks-1.6.2.dev3.data → flowtracks-1.6.2.dev4.data}/data/flowtracks-examples/run_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|