@@ -0,0 +1,1657 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport nix%0Aimport numpy as np%0Aimport matplotlib.pylab as plt%0A%0A%0Adef create_sinewave(duration=1, freq=10, stepsize=0.01):%0A    x = np.arange(0, duration*2*np.pi, stepsize)%0A    y = np.sin(freq*x)%0A    return x, y %0A%0A%0Adef plot_data(data_array):%0A    x_axis = data_array.dimensions%5B0%5D%0A    x = np.arange(0, data_array.data.shape%5B0%5D)%0A    x = x * x_axis.sampling_interval + x_axis.offset%0A    y = data_array.data%0A    plt.plot(x, y)%0A    plt.xlabel(x_axis.label + %22 %5B%22 + x_axis.unit + %22%5D%22)%0A    plt.ylabel(data_array.label + %22 %5B%22 + data_array.unit + %22%5D%22)%0A    plt.title(data_array.name)%0A    plt.show()%0A%0A%0Aif __name__ == %22__main__%22:%0A    # fake some data%0A    duration = 2%0A    frequency = 20%0A    stepsize = 0.02%0A    x, y = create_sinewave(duration, frequency, stepsize)%0A    %0A    # create a new file overwriting any existing content%0A    file_name = 'regular_data_example.h5'%0A    file = nix.File.open(file_name, nix.FileMode.Overwrite)%0A%0A    # create a 'Block' that represents a grouping object. Here, the recording session.%0A    # it gets a name and a type %0A    block = file.create_block(%22block name%22, %22nix.session%22)%0A%0A    # create a 'DataArray' to take the sinewave, add some information about the signal%0A    data = block.create_data_array(%22sinewave%22, %22nix.regular_sampled%22, data=y)%0A    data.unit = %22mV%22%0A    data.label = %22voltage%22%0A    # add a descriptor for the xaxis%0A    dim = data.append_sampled_dimension(stepsize)%0A    dim.unit = %22s%22%0A    dim.label = %22time%22%0A    dim.offset = 0.0 # optional%0A    %0A    # let's plot the data from the stored information%0A    plot_data(data)%0A    file.close()%0A    %0A%0A%0A%0A%0A%0A%0A    # close file%0A    file.close()%0A%0A

add regularly sampled example