cardioception.PAT.task.dialLoop#
- cardioception.PAT.task.dialLoop(parameters, trialNumber, block, startPhase, stages=None, silenceTimeout=None)[source]#
Run the engine and the dial until space ends the last stage.
A trial is one stage: the dial and the fixation cross, and space ends it after minTrialTime. The tutorial is several stages on the same beeps. Until the first beep has played, the screen says that the task is listening for the heartbeat, the dial is hidden and the wheel does nothing. A stage still running after maxTrialTime seconds (a lost ECG, say, when space would never work) ends the loop with no choice, status timeout.
- Parameters
- parametersdict
Task parameters.
- trialNumberint
Trial number given to the engine.
- blockstr
Shown in the experimenter status line.
- startPhasefloat
Start phase of the beeps, in degrees.
- stageslist of Stage | None
The screens to go through. Default is one trial screen.
- silenceTimeoutfloat | None
If no beep has played this many seconds after the loop started, the loop ends without a press and logs a warning, as nothing on screen can then progress. None, the default, waits for the first beep however long it takes (the experimenter sees the warning in the status line and can press Esc).
- Returns
- pressdict
phase_deg and delay_ms (the dial at the press, NaN after a timeout), press_time (LSL seconds), wall_time (time.time()), duration (seconds from the start of the trial), n_dial_moves, status (ok, or timeout when maxTrialTime or silenceTimeout ran out) and timed_out (true when the loop ended on a timeout rather than on a press).