pymovements.base
This module holds the base classes Screen and Experiment.
Classes
Experiment class for holding experiment properties. |
|
Screen class for holding screen properties and transforming pixel coordinates to degrees of visual angle. |
- class pymovements.base.Experiment(screen_width_px: int, screen_height_px: int, screen_width_cm: float, screen_height_cm: float, distance_cm: float, sampling_rate: float)[source]
Bases:
objectExperiment class for holding experiment properties.
- sampling_rate
Sampling rate in Hz
- Type
float
- class pymovements.base.Screen(width_px: int, height_px: int, width_cm: float, height_cm: float, distance_cm: float)[source]
Bases:
objectScreen class for holding screen properties and transforming pixel coordinates to degrees of visual angle.
- width_px
Screen width in pixels
- Type
int
- height_px
Screen height in pixels
- Type
int
- width_cm
Screen width in centimeters
- Type
float
- height_cm
Screen height in centimeters
- Type
float
- distance_cm
Eye-to-screen distance in centimeters
- Type
float
- x_max_dva
Maximum screen x-coordinate in degrees of visual angle
- Type
float
- y_max_dva
Minimum screen y-coordinate in degrees of visual angle
- Type
float
- x_min_dva
Maximum screen x-coordinate in degrees of visual angle
- Type
float
- y_min_dva
Minimum screen y-coordinate in degrees of visual angle
- Type
float
- pix2deg(arr: float | list[float] | list[list[float]] | np.ndarray, center_origin: bool = True) np.ndarray[source]
Converts pixel screen coordinates to degrees of visual angle.
- Parameters
arr (float, array_like) – Pixel coordinates to transform into degrees of visual angle
center_origin (bool) – Center origin to (0,0) if positions origin is in bottom left corner
- Returns
degrees_of_visual_angle – Coordinates in degrees of visual angle
- Return type
np.ndarray
- Raises
ValueError – If positions aren’t two-dimensional.