get_trace_data
Read amplitude values of a spectrum-analyzer trace with its frequency or time axis, power unit, trace type, and summary statistics; optionally run a fresh sweep or reduce points by peak-preserving decimation.
Instructions
Read the amplitude values of one trace (1-6, default the selected trace) with the computed frequency axis, the power unit, the trace type and summary statistics (min, max, mean, peak level and peak frequency). The axis is linear from :FREQuency:STARt? to :FREQuency:STOP? over :SENSe:SWEep:POINts? points (zero span has no frequency axis: a time axis from 0 to the sweep time is returned and the result says so). format is ascii (default: about 14 KB, 7 significant digits, no state change, fastest on the unit), real32 (binary, about 4 KB, the same 7 digits) or real64 (binary, about 8 KB, full double precision); for a binary format the instrument's data format is switched for the read and always put back. fresh runs one single sweep first so the data is a complete, current sweep (continuous mode is switched back on afterwards); without it the values are whatever the trace currently holds, which in continuous mode can be mid-sweep. max_points (>= 2) reduces the response by peak-preserving min/max decimation and the result says so with the original count; the statistics always use the full trace. include_axis (default true) adds the per-point axis.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_trace_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | Run a single sweep first and read the finished trace; restores continuous mode if it was on (default false) | |
| trace | No | Trace 1-6; default the selected trace (:TRACe:SELect?) | |
| format | No | Transfer format (default ascii; real32/real64 switch the instrument's :FORMat for the read and restore it) | |
| instrument | No | Which instrument to use (a name from list_instruments). Default: the `default` instrument, or the only one configured | |
| max_points | No | Return at most this many points using peak-preserving min/max decimation (default: all points) | |
| include_axis | No | Include the per-point frequency (or time) axis (default true) |