pymovements.gaze.transforms.deg2pix#
- pymovements.gaze.transforms.deg2pix(*, screen_resolution: tuple[int, int], screen_size: tuple[float, float], distance: float | str, pixel_origin: str = 'upper left', n_components: int, position_column: str = 'position', pixel_column: str = 'pixel') pl.Expr #
Convert degrees of visual angle to pixel screen coordinates.
- Parameters:
screen_resolution (tuple[int, int]) – Pixel screen resolution as tuple (width, height).
screen_size (tuple[float, float]) – Screen size in centimeters as tuple (width, height).
distance (float | str) – Must be either a scalar or a string. If a scalar is passed, it is interpreted as the Eye-to-screen distance in centimeters. If a string is passed, it is interpreted as the name of a column containing the Eye-to-screen distance in millimiters for each sample.
pixel_origin (str) – The desired location of the pixel origin. (default: ‘upper left’) Supported values:
center
,upper left
.n_components (int) – Number of components in input column.
position_column (str) – The input position column name. (default: ‘position’)
pixel_column (str) – The output pixel column name. (default: ‘pixel’)
- Returns:
The respective polars expression.
- Return type:
pl.Expr