Football#
Football relies on the following parameterized features:
Extensions of the BaseFeature
class to be specific to football field.
The features are all parameterized by the basic characteristics of a football
field. A user can manually specify their own field parameters in the
FootballField
class that will adjust the placement of these features,
however the features themselves will be consistent across all football
surfaces.
@author: Ross Drucker
- class sportypy._feature_classes.football.Arrow(arrow_base=0.0, arrow_length=0.0, *args, **kwargs)#
The arrows pointing to the nearest end zone.
These arrows are described by their base (which runs parallel to the goal line) and their length, which extends from the tip to the base
- arrow_base#
The length of the base of the directional arrow. This is the component of the arrow that is parallel to the major yard line to which the arrow corresponds
- Type:
float
- arrow_length#
The distance between the tip of the directional arrow and the base
- Type:
float
- class sportypy._feature_classes.football.BaseFootballFeature(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
An extension of the
BaseFeature
class for football features.The following attributes are specific to football features only. For more information on inherited attributes, please see the
BaseFeature
class definition. The default values are provided to ensure that the feature can at least be created.- field_length#
The length of the field in TV view. The default is
0.0
- Type:
float
- field_width#
The width of the field in TV view. The default is
0.0
- Type:
float
- feature_radius#
The radius needed to draw the feature. This may not be needed for all features. The default is
0.0
- Type:
float
- feature_thickness#
The thickness with which to draw the feature. This is normally given as the horizontal width of the feature in TV view, however it may be used to specify other thicknesses as needed. The default is
0.0
- Type:
float
- field_units#
The units with which the feature is drawn. The default is
"yd"
- Type:
str
- class sportypy._feature_classes.football.CoachingBox(coaching_box_length=0.0, *args, **kwargs)#
The coaching box.
This is the area beyond the restricted area designated for coaches. It is between the restricted area and the team area
- coaching_box_length#
The length of the coaching box in the direction parallel to the sideline of the field
- Type:
float
- class sportypy._feature_classes.football.CoachingBoxLine(coaching_box_line_length=0.0, *args, **kwargs)#
The line separating the coaching box from the team bench area.
The line should be a different color than either the team bench area or the coaching box
- coaching_box_line_length#
The length of the coaching box line in the
x
direction when viewing the field in TV view- Type:
float
- class sportypy._feature_classes.football.EndLine(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
The line beyond the endzone.
The end line is typically white in color, and its interior edge is out of bounds
- class sportypy._feature_classes.football.Endzone(endzone_length=0.0, *args, **kwargs)#
The endzones.
The area beyond the goal line.
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- class sportypy._feature_classes.football.FieldApron(endzone_length=0.0, boundary_thickness=0.0, field_border_thickness=0.0, restricted_area_length=0.0, restricted_area_width=0, coaching_box_length=0.0, coaching_box_width=0.0, team_bench_length_field_side=0.0, team_bench_length_back_side=0.0, team_bench_width=0.0, team_bench_area_border_thickness=0.0, extra_apron_padding=0.0, bench_shape='', *args, **kwargs)#
The apron of the field.
The field should have an apron to appropriately see all out-of-bounds features. This is typically the same color as the field itself, but will be created separately so as to allow for more customized plotting
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- boundary_line_thickness#
The thickness of the boundary lines. This should not include any border around the sidelines, the restricted areas, or team bench areas
- Type:
float
- field_border_thickness#
The thickness of the border around the field. This will be uniform around the entirety of the field. This should not include the thickness of the boundary lines
- Type:
float
- restricted_area_length#
The length of the restricted area in the direction parallel to the sideline of the field
- Type:
float
- coaching_box_length#
The length of the coaching box in the direction parallel to the sideline of the field
- Type:
float
- coaching_box_width#
The width of the coaching box
- Type:
float
- team_bench_length_field_side#
The length of the team bench’s edge closest to the field
- Type:
float
- team_bench_length_back_side#
The length of the team bench’s edge furthest from the field
- Type:
float
- team_bench_width#
The width of the team bench area
- Type:
float
- team_bench_area_border_thickness#
The thickness of the border around the team bench area. This should not include any borders around the field
- Type:
float
- extra_apron_padding#
Any additional padding around the field apron
- Type:
float
- bench_shape#
The shape of the bench area. This should be either
"rectangle"
or"trapezoid"
- Type:
str
- class sportypy._feature_classes.football.FieldBorder(endzone_length=0.0, boundary_thickness=0.0, restricted_area_length=0.0, restricted_area_width=0.0, coaching_box_length=0.0, coaching_box_width=0.0, team_bench_length_field_side=0.0, team_bench_length_back_side=0.0, team_bench_width=0.0, team_bench_border_thickness=0.0, bench_shape='', surrounds_team_bench_area=False, *args, **kwargs)#
The border around the outside of the sideline and end line.
This is not present on every field, but is not the same as the sideline or end line (although they may be the same in color)
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- boundary_line_thickness#
The thickness of the boundary lines. This should not include any border around the sidelines, the restricted areas, or team bench areas
- Type:
float
- field_border_thickness#
The thickness of the border around the field. This will be uniform around the entirety of the field. This should not include the thickness of the boundary lines
- Type:
float
- restricted_area_length#
The length of the restricted area in the direction parallel to the sideline of the field
- Type:
float
- restricted_area_width#
The width of the restricted area
- Type:
float
- coaching_box_length#
The length of the coaching box in the direction parallel to the sideline of the field
- Type:
float
- coaching_box_width#
The width of the coaching box
- Type:
float
- team_bench_length_field_side#
The length of the team bench’s edge closest to the field
- Type:
float
- team_bench_length_back_side#
The length of the team bench’s edge furthest from the field
- Type:
float
- team_bench_width#
The width of the team bench area
- Type:
float
- team_bench_border_thickness#
The thickness of the border around the team bench area. This should not include any borders around the field
- Type:
float
- surrounds_team_bench_area#
Whether or not the field border should surround the team bench area
- Type:
bool
- bench_shape#
The shape of the bench area. This should be either
"rectangle"
or"trapezoid"
- Type:
str
- class sportypy._feature_classes.football.FieldBorderOutline(endzone_length=0.0, boundary_thickness=0.0, restricted_area_length=0.0, restricted_area_width=0.0, coaching_box_length=0.0, coaching_box_width=0.0, team_bench_length_field_side=0.0, team_bench_length_back_side=0.0, team_bench_width=0.0, team_bench_border_thickness=0.0, bench_shape='', field_border_thickness=0.0, surrounds_team_bench_area=True, *args, **kwargs)#
The outline of the border around the field.
This is not present on every field, but is not the same as the sideline or end line (although they may be the same in color)
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- boundary_line_thickness#
The thickness of the boundary lines. This should not include any border around the sidelines, the restricted areas, or team bench areas
- Type:
float
- field_border_thickness#
The thickness of the border around the field. This will be uniform around the entirety of the field. This should not include the thickness of the boundary lines
- Type:
float
- restricted_area_length#
The length of the restricted area in the direction parallel to the sideline of the field
- Type:
float
- restricted_area_width#
The width of the restricted area
- Type:
float
- coaching_box_length#
The length of the coaching box in the direction parallel to the sideline of the field
- Type:
float
- coaching_box_width#
The width of the coaching box
- Type:
float
- team_bench_length_field_side#
The length of the team bench’s edge closest to the field
- Type:
float
- team_bench_length_back_side#
The length of the team bench’s edge furthest from the field
- Type:
float
- team_bench_width#
The width of the team bench area
- Type:
float
- team_bench_border_thickness#
The thickness of the border around the team bench area. This should not include any borders around the field
- Type:
float
- surrounds_team_bench_area#
Whether or not the field border should surround the team bench area
- Type:
bool
- bench_shape#
The shape of the bench area. This should be either
"rectangle"
or"trapezoid"
- Type:
str
- class sportypy._feature_classes.football.FieldConstraint(endzone_length=0.0, *args, **kwargs)#
The constraint around the interior edge of the field’s boundary lines.
This confines all interior features to be constrained inside the field, as well as any interior plots.
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- class sportypy._feature_classes.football.GoalLine(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
The goal line.
The interior edge (relative to the field of play) should lie at the 0 yard line. The center of the 1 yard line should be exactly 1 yard from this edge of the goal line
- class sportypy._feature_classes.football.HalfField(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
The half of the field.
This may be either the offensive or defensive half of the field
- class sportypy._feature_classes.football.MajorYardLine(dist_to_sideline=0.0, cross_hash_length=0.0, cross_hash_separation=0.0, yard_line_name='', *args, **kwargs)#
The major yard lines on the field.
These are the yard lines that span the entire width of the field
- dist_to_sideline#
The distance separating the major yard line from the interior edge of the boundary lines
- Type:
float
- cross_hash_length#
The length, in TV view, of the hash mark that crosses major yard lines
- Type:
float
- cross_hash_separation#
The separation between the hash marks (i.e. the minor yard lines) when measured from their interior edges
- Type:
float
- yard_line_name#
The name of the yard line. This is to make identifying them easier, but have no bearing on the final plot
- Type:
str
- class sportypy._feature_classes.football.MinorYardLine(yard_line_height=0.0, yard_line_name='', dist_to_sideline=0.0, *args, **kwargs)#
The minor yard lines on the field.
These are the yard lines spaced closer than every five yards on the field
- yard_line_height#
The height of the minor yard lines on the field in the
y
direction when viewing the field in TV view- Type:
float
- yard_line_name#
The name of the yard line. This is to make identifying them easier, but have no bearing on the final plot
- Type:
str
- class sportypy._feature_classes.football.RedZoneBorder(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
The border of the red zone.
The field border may have a different color along the red zone than it does along the rest of the field. This is not always the case, but the feature is provided for convenience
- class sportypy._feature_classes.football.RedZoneBorderOutline(field_length=0.0, field_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='yd', *args, **kwargs)#
The outline of the border of the red zone.
The outline of the border of the red zone may be a different color than the rest of the field border outline. THis is not always the case, but the feature is provided for convenience
- class sportypy._feature_classes.football.RestrictedArea(restricted_area_length=0.0, *args, **kwargs)#
The restricted area.
This is the area between the coaching box and the exterior edge of the sideline
- restricted_area_length#
The length of the restricted area
- Type:
float
- class sportypy._feature_classes.football.Sideline(endzone_length=0.0, *args, **kwargs)#
The lines that run the length of the field.
The sidelines are typically white in color, and its interior edge is out of bounds
- endzone_length#
The length of the endzone in TV view. This is measured from the field side of the goal line
- Type:
float
- class sportypy._feature_classes.football.TeamBenchArea(team_bench_length_field_side=0.0, team_bench_length_back_side=0.0, team_bench_width=0.0, *args, **kwargs)#
The team bench area.
This is the area beyond the restricted area and coaching box. It is where the team benches, non-playing players, and team staff are to remain during the game
- team_bench_length_field_side#
The length of the team bench’s edge closest to the field
- Type:
float
- team_bench_length_back_side#
The length of the team bench’s edge furthest from the field
- Type:
float
- team_bench_width#
The width of the team bench area
- Type:
float
- class sportypy._feature_classes.football.TeamBenchAreaOutline(restricted_area_length=0.0, restricted_area_width=0.0, coaching_box_length=0.0, coaching_box_width=0.0, team_bench_length_field_side=0.0, team_bench_length_back_side=0.0, team_bench_width=0.0, *args, **kwargs)#
The outline of the bench area (border, not broken line).
The border may not be necessary in all drawings
- restricted_area_length#
The length of the restricted area in the direction parallel to the sideline of the field
- Type:
float
- restricted_area_width#
The width of the restricted area
- Type:
float
- coaching_box_length#
The length of the coaching box in the direction parallel to the sideline of the field
- Type:
float
- coaching_box_width#
The width of the coaching box
- Type:
float
- team_bench_length_field_side#
The length of the team bench’s edge closest to the field
- Type:
float
- team_bench_length_back_side#
The length of the team bench’s edge furthest from the field
- Type:
float
- team_bench_width#
The width of the team bench area
- Type:
float