{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## The data structure is based on xarray.Dataset" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "PIV data requires: \n", "- data in 2D or 3D matrices\n", "- coordinates for x,y or x,y,z \n", "- metadata that will contain the information from the header, information about the origin of the data file (image, experimental settings), units for each variables, coordinates, etc. \n", "\n", "\n", "Among various possibilities the most suitable one is `xarray`, or so-called N-D labeled arrays, Read more about this format in this [paper](https://openresearchsoftware.metajnl.com/articles/10.5334/jors.148/) or in their [docs](https://xarray.pydata.org/en/stable/)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import xarray as xr" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (x: 3, y: 4, t: 1)\n", "Coordinates:\n", " * x (x) float64 32.0 80.0 128.0\n", " * y (y) float64 16.0 53.33 90.67 128.0\n", " * t (t) int64 0\n", "Data variables:\n", " u (x, y, t) float64 1.0 3.333 5.667 8.0 1.0 ... 1.0 3.333 5.667 8.0\n", " v (x, y, t) float64 0.1297 0.463 0.7963 1.13 ... 0.2745 0.6078 0.9412\n", " chc (x, y, t) float64 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0\n", "Attributes:\n", " variables: ['x', 'y', 'u', 'v']\n", " units: ['pix', 'pix', 'pix/dt', 'pix/dt']\n", " dt: 1.0\n", " files: