Calculate the radians of visual angle that the participant screen subtends. Parameters ---------- calibration : Calibration An instance of Calibration. Must have valid values for ``"screen_size"`` and ``"screen_distance"`` keys. Returns ------- visual angle
(calibration)
| 26 | |
| 27 | |
| 28 | def get_screen_visual_angle(calibration): |
| 29 | """Calculate the radians of visual angle that the participant screen subtends. |
| 30 | |
| 31 | Parameters |
| 32 | ---------- |
| 33 | calibration : Calibration |
| 34 | An instance of Calibration. Must have valid values for ``"screen_size"`` and |
| 35 | ``"screen_distance"`` keys. |
| 36 | |
| 37 | Returns |
| 38 | ------- |
| 39 | visual angle in radians : ndarray, shape (2,) |
| 40 | The visual angle of the monitor width and height, respectively. |
| 41 | """ |
| 42 | _validate_type(calibration, Calibration, "calibration") |
| 43 | _check_calibration(calibration, want_keys=("screen_size", "screen_distance")) |
| 44 | size = np.array(calibration["screen_size"]) |
| 45 | return 2 * np.arctan(size / (2 * calibration["screen_distance"])) |
no test coverage detected