abscissa
Closed
abscissa
I have a draft implementation of wdata
which works as follows:
import numpy as np
from wdata import io
Nxyz = (5, 6)
x = np.linspace(0, 1, Nxyz[0]) # Equally spaced
y = np.exp(np.linspace(0, 1, Nxyz[1])) # Unequally spaced
xyz = np.meshgrid(x, y, indexing="ij", sparse=True)
t = np.exp(np.linspace(0, 2, 4))
data = io.WData(prefix="test1", data_dir='tmp', xyz=xyz, t=t)
data.save(force=True)
$ tree tmp
tmp
|-- test1.wtxt
|-- test1__t.wdat
`-- test1__y.wdat
$ cat tmp/test1.wtxt
# Generated by wdata.io: [2021-05-31 09:14:20 UTC+0000 = 2021-05-31 02:14:20 PDT-0700]
nx 5 # Lattice size in x direction
ny 6 # ... y ...
dx 0.25 # Spacing in x direction
dy varying # ... y ...
prefix test1 # datafile prefix: <prefix>_<var>.<format>
datadim 2 # Block size: 1:Nx, 2:Nx*Ny, 3:Nx*Ny*Nz
cycles 4 # Number Nt of frames/cycles per dataset
t0 1.0 # Time value of first frame
dt varying # Time interval between frames
x0 0.0 # First point in x lattice
y0 1.0 # First point in y lattice
The abscissa for t
and y
are implicitly stored as _t
and _y
.
mentioned in commit 0264e4b4
Please register or sign in to reply