Skip to content

v0.7.1

Latest
Compare
Choose a tag to compare
@niksirbi niksirbi released this 06 Jun 09:54
· 7 commits to main since this release
fe28a5f

✨ Highlight ✨ netCDF is the file format 🗃️ of choice for saving movement datasets 💾

  • Test and document saving movement datasets to netCDF by @niksirbi in #606

Saving to netCDF is the recommended way to preserve the complete state of your analysis, including all variables, coordinates, and attributes. Below is an example of how you may integrate netCDF into you movement-powered workflows:

from movement.io import load_poses
from movement.filtering import rolling_filter
from movement.kinematics import compute_speed

ds = load_poses.from_file(
    "path/to/my_data.h5", source_software="DeepLabCut", fps=30
)

# Apply a rolling median filter to smooth the position data
ds["position_smooth"] = rolling_filter(
    ds["position"], window=5, statistic="median"
)

# Compute speed based on the smoothed position data
ds["speed"] = compute_speed(ds["position_smooth"])

# Save the dataset to a netCDF file
# This includes the original position and confidence data,
# the smoothed position, and the computed speed
ds.to_netcdf("my_data_processed.nc")

To later load the dataset back from disk:

import xarray as xr

ds = xr.open_dataset("my_data_processed.nc")

Miscellaneous

  • Completely remove deprecated median_filter function by @niksirbi in #611
  • Add log_to_attrs decorator to scale function by @niksirbi in #604

Warning

The deprecated movement.filtering.median_filter() function has been completely removed. Use movement.filtering.median_filter() instead, with statistic="median".

Housekeeping

New Contributors

Full Changelog: v0.7.0...v0.7.1