flap.testdata

This is a test data source for flap.

It is assumed that measurement channels collect temporal data on a 2D mesh in the physical space.

The measurement channels are named as TEST-<row>-<column>.

  • <row>: 1….15

  • <column>: 1…10

The row/column locations relative to the array corner are:

  • xr = (<column>-1)*0.5 [cm]

  • yr = 0

  • zr = (<row>-1)*0.4 [cm]

Conversion to device coordinates is: alpha = 15 degree

  • x = xr*cos(alpha) - zr*sin(alpha)

  • z = xr*sin(alpha) + zr*cos(alpha)

  • y = yr

The Device (R, Z, phi) coordinate system origin is at (x, y, z) = (0, 0, 0). R is along x. Z is z.

Created on Thu Jan 17 10:29:56 2019

@author: Sandor Zoletnik (zoletnik.sandor@ek-cer.hu) Centre for Energy Research

flap.testdata.add_coordinate(data_object, coordinates=None, exp_id=None, options=None)

The registered function for adding coordinates to the data object.

Handled coordinates: Device x, Device y, Device z.

Parameters:
data_objectflap.DataObject

The data object to add the coordinates to.

coordinateslist of str, optional, default=None

The coordinates to add.

exp_idstr, optional, default=None

Experiment ID. (Currently unused.)

optionsdict, optional, default=None

Options. (Currently unused.)

flap.testdata.register(data_source=None)

Register data source.

Parameters:
data_sourcestr, optional, default=None

Data source description.

flap.testdata.testdata_get_data(exp_id=None, data_name='*', no_data=False, options=None, coordinates=None, data_source=None)

Data read function for flap test data source.

Channel names:
  • ‘TEST-<col>-<row>’: Signals on a 15x5 spatial matrix

  • ‘VIDEO’: A test image with timescale as for the signals.

Parameters:
exp_idstr, optional, default=None

Experiment ID.

data_namestr, optional, default=’*’

Name of data channels to select.

no_databool, optional, default=False

If True, do not read the data itself.

optionsdict, optional, default=None

Options for test data.

Possible keys and values:

  • ‘Scaling’ (default=Volt):

    • ‘Volt’: Voltage scaling.

    • ‘Digit’: Digital scaling.

  • ‘Signal’ (default=’Sin’):

    • ‘Sin’: Sine signals.

    • ‘Const.’: Constant values with row * COLUMN_NUMBER + column.

    • ‘Complex-Sin’: Same as Sine, but a cosine imaginary part is added.

    • ‘Random’: Random (normal dist.) signal in all channels.

  • ‘Row number’ (default=10):

    • int: Number of rows for signal matrix.

  • ‘Column number’ (default=15):

    • int: Number of columns for signal matrix.

  • ‘Matrix angle’ (default=0):

    • float: The angle [deg] of the signal matrix.

  • ‘Image’ (default=’Gauss’):

    • ‘Gauss’: Gaussian spot.

    • ‘Random’: Random int16 values between 0 and 4095.

  • ‘Spotsize’ (default=100):

    • int: Full width at half maximum of spot, in pixels.

  • ‘Width’ (default=640):

    • int: Image width in pixels (x size).

  • ‘Height’ (default=480):

    • int: Image height in pixels (y size).

  • ‘Frequency’ (default=1e3):

    • float: Fixed frequency of signals [Hz]. For “Gauss” video data, the rotation frequency of the spot

    • [f2,f2]: Changes from channel-to-channel between these frequencies [Hz].

    • flap.DataObject: Should be data object with ‘Time’ coordinate and ‘Frequency’ as data.

      If has one channel, describes frequency vs. time for all channels.

      If multiple signals (coordinate ‘Signal’ name describes signals), describes frequency vs. time per channel. Should have the same number of channels as for the generation.

  • ‘Length’ (default=0.1):

  • float: Length in seconds. The sample rate is 1 MHz.

  • ‘Samplerate’ (default=1e6):

    • float: Sample rate [Hz]

coordinateslist of flap.Coordinate, optional, default=None

Coordinates for ‘Time’ or ‘Sample’ axes.

data_sourcesrc, optional, default=None

Data source description.

Returns:
flap.DataObject