dispel.signal.orientation module#

A module to detect and process phone orientation during tests.

class dispel.signal.orientation.OrientationRange#

Bases: tuple

tuple of phone range orientation in degree

static __new__(_cls, lower, upper)#

Create new instance of OrientationRange(lower, upper)

lower#

Alias for field number 0

upper#

Alias for field number 1

class dispel.signal.orientation.PhoneOrientation[source]#

Bases: AVEnum

A class enumerator regrouping supported phone orientations.

FACE_DOWN = 6#
FACE_UP = 5#
LANDSCAPE_LEFT = 2#
LANDSCAPE_RIGHT = 1#
PORTRAIT_UPRIGHT = 3#
PORTRAIT_UPSIDE_DOWN = 4#
property frontal_axis: str#

Get the name of the axis facing the observer.

get_classifier(pitch_freedom, yaw_freedom)[source]#

Get the phone orientation classifier.

Parameters:
Returns:

A function that takes as input the gravity data frame and output a pandas series of boolean corresponding to the phone orientation classification.

Return type:

Callable[[pandas.DataFrame], pandas.Series]

property is_down: bool#

Return whether the orientation is upside down.

property is_flat: bool#

Return whether the orientation is in a flat mode.

property is_landscape: bool#

Return whether the orientation is in landscape mode.

property is_portrait: bool#

Return whether the orientation is in portrait mode.

is_top_axis_valid(top_axis_gravity, pitch_angle, yaw_angle)[source]#

Check whether the condition on the top axis is verified.

Parameters:
  • top_axis_gravity (float) –

  • pitch_angle (float) –

  • yaw_angle (float) –

Return type:

bool

property is_up: bool#

Return whether the orientation is upright.

property side_axis: str#

Get the name of the axis on the side of the phone.

property top_axis: str#

Get the name of the axis perpendicular to the ground.