Skip to main content

Documentation for ScryLab v0.1.6

Changelogs

Send Signal

POST /api/signals/send

Sends a signal to an existing data source.

Tip

Step-by-step guide with complete code examples: Import Data from Python & MATLAB

Request

POST /api/signals/send HTTP/1.1
Host: localhost:5678
Content-Type: application/json

JSON Inline

Body Parameters

ParameterTypeRequiredDescription
namestringYesSignal name
yarrayYesY values (amplitude)
xarrayNoX values (time/frequency). Auto-generated if not provided
zarray/2D-arrayNoZ values for trace lines (1D) or spectrograms (2D)
y_unitstringNoUnit of the Y axis (e.g. "V", "A")
x_unitstringNoUnit of the X axis (e.g. "s", "Hz")
z_unitstringNoUnit of the Z axis (e.g. "dB", "°C")
target_source_idstringYesID of the target data source

Example: Simple Signal

{
"name": "Sine 5Hz",
"y": [0, 0.841, 0.909, 0.141, ...],
"x": [0, 0.1, 0.2, 0.3, ...],
"y_unit": "V",
"x_unit": "s",
"target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"
}

Example: Trace Line (1D Z axis)

{
"name": "Colored Sine",
"y": [0, 0.841, 0.909, ...],
"x": [0, 0.1, 0.2, ...],
"z": [0.5, 0.7, 0.9, ...],
"y_unit": "V",
"x_unit": "s",
"z_unit": "°C",
"target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"
}

Example: Spectrogram (2D Z Matrix)

{
"name": "Spectrogram",
"y": [0, 10, 20, ...],
"x": [0, 0.1, 0.2, ...],
"z": [[0.1, 0.2, ...], [0.3, 0.4, ...], ...],
"y_unit": "Hz",
"x_unit": "s",
"z_unit": "dB",
"target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"
}

Info

Z axis format:

  • 1D array (length = length of x and y): trace line with color coding
  • 2D matrix (shape: [len(y), len(x)]): spectrogram/heatmap

File Reference

Body Parameters

ParameterTypeRequiredDescription
namestringYesSignal name
filestringYesAbsolute path to a .npz or .mat file
y_unitstringNoUnit of the Y axis
x_unitstringNoUnit of the X axis
z_unitstringNoUnit of the Z axis
target_source_idstringYesID of the target data source

Example

{
"name": "Large Signal",
"file": "/home/user/data/signal.npz",
"y_unit": "V",
"x_unit": "s",
"target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"
}

File format

  • NumPy (.npz): Must contain an array named y. Optional: x and z.
  • MATLAB (.mat): Must contain a variable named y. Optional: x and z.

Files created automatically by the ScryLab Python client in ~/.cache/scrylab/transport/ are deleted after a successful import. Files at any other path are left untouched.

Linux Flatpak

/tmp/ is not shared with the host inside the Flatpak sandbox. Use ~/.cache/scrylab/transport/ or another path under ~/ as a temporary location.

Response

Status Code: 200 OK

Body:

{
"status": "ok",
"result": {
"signal_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Sine 5Hz",
"sample_count": 1000
}
}

Response Fields

FieldTypeDescription
result.signal_idstringID of the imported signal
result.namestringActual name of the signal
result.sample_countintegerNumber of imported samples

Errors

StatusMeaning
400Invalid parameters or malformed file (e.g. missing y array)
404target_source_id not found
500Server error (e.g. file not readable)

Example:

{
"status": "error",
"error": "No handler found for source ID: 937896ff-..."
}