From e5235e9b53380cadf02c81032c186ebb0eda636a Mon Sep 17 00:00:00 2001 From: JRblt Date: Thu, 31 Oct 2024 21:24:34 +0100 Subject: [PATCH] Update the contiguous ragged example to match latest class --- examples/example_contiguous_ragged.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/example_contiguous_ragged.py b/examples/example_contiguous_ragged.py index 89e3922..e1f476c 100644 --- a/examples/example_contiguous_ragged.py +++ b/examples/example_contiguous_ragged.py @@ -29,9 +29,17 @@ # %% -# this is because, under the hood, trajan is generating a Traj2D non ragged dataset that follows the usual trajan conventions +# it is possible to get a 2d-array dataset version using trajan: -xr_data.traj.ds +# compare: +print(f"{xr_data.traj.ds = }") + +# with: +xr_data_as_2darray = xr_data.traj.to_2d() +print(f"{xr_data_as_2darray = }") + +# naturally, the 2darray version can be dumped to disk if you want: +xr_data_as_2darray.to_netcdf("./xr_spotter_bulk_test_data_as_2darray.nc") # %%