Skip to content

crashmetrics.bncap

bncap

Bharat NCAP adult occupant protection scoring (AIS-197).

Follows AIS-197 (Bharat NCAP): Annexure IV (assessment criteria), Annexure VI (safety assist qualifiers), Annexure VII (modifiers) and Annexure VIII (scoring), with the star thresholds of Table 2A.

Tests: ODB frontal at 64 km/h (Hybrid III 50th driver and passenger, 16 points), MDB side at 50 km/h (ES-2, 16 points) and the pole side test at 29 km/h (pass/fail, pole_test_passed).

Scoring

Each criterion scores 0-4 points on a linear sliding scale between the higher (4 points) and lower (0 points) performance limit (sliding_points). Neck shear and tension and femur compression are scored from their exceedance curves against force-duration limits (curve_points): the lowest point on the curve gives the score. A body region takes its lowest-scoring criterion, then point modifiers are subtracted (not below zero). Region scores are rounded to 3 decimals.

Frontal: the regions of driver and passenger are grouped into head & neck, chest, knee/femur/pelvis and leg & foot; each group takes the worst region or limb of the two occupants (16 points). Side: head, chest, abdomen and pelvis, 4 points each (16 points).

Capping (Annexure IV 3.2 and 4.2): a biomechanical value above the lower performance (capping) limit of a critical region (frontal head, neck, chest; side head, chest, abdomen, pelvis) removes all points of that test and caps the rating at 0 stars; a critical region scoring zero after modifiers caps it at 1 star.

Protocol edition

Every function here implements the 2023 edition of Bharat NCAP (AIS-197, published September 2023), which rates cars from 1 October 2023 and is valid for four years, until 30 September 2027 (PROTOCOL, VALID_FROM, VALID_UNTIL). The scoring functions take edition=2023 and their results carry a protocol text, so a stored result says which rules produced it. Bharat NCAP 2.0 (AIS-197 Revision 1, ratings from October 2027: 100 points in five pillars) is not implemented yet; asking for edition=2027 raises an error rather than scoring by the old rules. edition_for_date gives the edition for a rating date.

Units: forces in N, moments in N m, deflections and displacements in mm, accelerations in g, VC in m/s, time in s.

EDITION module-attribute

EDITION = 2023

Bharat NCAP edition implemented here: AIS-197 of September 2023.

VALID_FROM module-attribute

VALID_FROM = dt.date(2023, 10, 1)

First day of Bharat NCAP ratings under AIS-197 (2023).

VALID_UNTIL module-attribute

VALID_UNTIL = dt.date(2027, 9, 30)

Last day of the 2023 edition: four years (AIS-197 Section 1.0). Bharat NCAP 2.0 (AIS-197 Revision 1) applies from October 2027.

PROTOCOL module-attribute

PROTOCOL = "Bharat NCAP AIS-197 (2023 edition, ratings 1 Oct 2023 - 30 Sep 2027)"

Text stored in every result, naming the rules that produced it.

SUPPORTED_EDITIONS module-attribute

SUPPORTED_EDITIONS: tuple[int, ...] = (2023,)

Editions this package can score.

NECK_SHEAR_CURVES module-attribute

NECK_SHEAR_CURVES: tuple[Curve, Curve] = (
    (
        (0.0, 1900.0),
        (25.0, 1200.0),
        (35.0, 1200.0),
        (45.0, 1100.0),
    ),
    (
        (0.0, 3100.0),
        (25.0, 1500.0),
        (35.0, 1500.0),
        (45.0, 1100.0),
    ),
)

Neck shear (higher, lower performance) curves, (duration ms, force N), Annexure IV 3.2.2. The lower curve is also the capping limit.

NECK_TENSION_CURVES module-attribute

NECK_TENSION_CURVES: tuple[Curve, Curve] = (
    ((0.0, 2700.0), (35.0, 2300.0), (60.0, 1100.0)),
    ((0.0, 3300.0), (35.0, 2900.0), (60.0, 1100.0)),
)

Neck tension (higher, lower performance) curves, Annexure IV 3.2.2.

FEMUR_CURVES module-attribute

FEMUR_CURVES: tuple[Curve, Curve] = (
    ((0.0, 3800.0),),
    ((0.0, 9070.0), (10.0, 7560.0)),
)

Femur compression (higher, lower performance) curves, Annexure IV 3.2.4: 3.8 kN; 9.07 kN at 0 ms to 7.56 kN at 10 ms and longer.

FRONTAL_LIMITS module-attribute

FRONTAL_LIMITS: dict[str, tuple[float, float]] = {
    "hic15": (500.0, 700.0),
    "head_a3ms": (72.0, 88.0),
    "neck_extension": (42.0, 57.0),
    "chest_compression": (22.0, 42.0),
    "viscous_criterion": (0.5, 1.0),
    "knee_displacement": (6.0, 15.0),
    "tibia_index": (0.4, 1.3),
    "tibia_force": (2000.0, 8000.0),
    "pedal_rearward": (100.0, 200.0),
}

Frontal (higher, lower) performance limits, Annexure IV 3.2.

SIDE_LIMITS module-attribute

SIDE_LIMITS: dict[str, tuple[float, float]] = {
    "hic15": (500.0, 700.0),
    "head_a3ms": (72.0, 88.0),
    "rib_deflection": (22.0, 42.0),
    "rib_vc": (0.32, 1.0),
    "abdominal_force": (1000.0, 2500.0),
    "pubic_force": (3000.0, 6000.0),
}

Side (ES-2) (higher, lower) performance limits, Annexure IV 4.2.

AOP_STAR_THRESHOLDS module-attribute

AOP_STAR_THRESHOLDS: tuple[tuple[int, float], ...] = (
    (5, 27.0),
    (4, 22.0),
    (3, 16.0),
    (2, 10.0),
    (1, 4.0),
)

Minimum frontal + side score per star rating (AIS-197 Table 2A).

COP_STAR_THRESHOLDS module-attribute

COP_STAR_THRESHOLDS: tuple[tuple[int, float], ...] = (
    (5, 41.0),
    (4, 35.0),
    (3, 27.0),
    (2, 18.0),
    (1, 9.0),
)

Child occupant protection (49 points) thresholds (Table 2B).

COP_STAR_THRESHOLDS_TWO_SEATER module-attribute

COP_STAR_THRESHOLDS_TWO_SEATER: tuple[
    tuple[int, float], ...
] = ((5, 20.0), (4, 17.0), (3, 13.0), (2, 9.0), (1, 5.0))

Child occupant protection thresholds for two-seaters (22 points), Annexure VIII 4.3.

Series module-attribute

Series = tuple[ArrayLike, ArrayLike]

(time in s, signal) of a channel.

CurveScore dataclass

CurveScore(
    points: float,
    level: float,
    duration_ms: float,
    exceeds_lower: bool,
)

Score of an exceedance curve between two force-duration curves.

points instance-attribute

points: float

Lowest point score on the curve (0-4).

level instance-attribute

level: float

Level of the exceedance curve where the score is lowest.

duration_ms instance-attribute

duration_ms: float

Duration at that level, ms.

exceeds_lower instance-attribute

exceeds_lower: bool

True if the curve goes above the lower performance (capping) curve.

FrontalOccupant dataclass

FrontalOccupant(
    neck_shear: Series,
    neck_tension: Series,
    neck_extension: float,
    chest_compression: float,
    viscous_criterion: float,
    femur: tuple[Series, Series],
    knee_displacement: tuple[float, float],
    tibia_index: tuple[float, float],
    tibia_force: tuple[float, float],
    hic15: float | None = None,
    head_a3ms: float | None = None,
    hard_contact: bool = True,
    pedal_rearward: float | None = None,
    modifiers: Mapping[str, float] = dict(),
)

Hybrid III 50th results in the ODB test (driver or passenger).

Leg values are given per side as (left, right); for the tibia give the worse of upper and lower. Modifiers are points to subtract per region: "head", "neck", "chest", "knee_left", "knee_right", "lower_leg_left", "lower_leg_right", "foot" (see the *_modifier helpers for the sliding ones).

neck_shear instance-attribute

neck_shear: Series

Upper neck Fx history, N (both directions assessed).

neck_tension instance-attribute

neck_tension: Series

Upper neck Fz history, N (tension positive).

neck_extension instance-attribute

neck_extension: float

Extension moment at the occipital condyle, N m (magnitude).

femur instance-attribute

femur: tuple[Series, Series]

Femur Fz histories (left, right), compression negative.

tibia_force instance-attribute

tibia_force: tuple[float, float]

Peak tibia compression, N (positive).

hard_contact class-attribute instance-attribute

hard_contact: bool = True

If False (peak head acceleration <= 80 g and no other evidence), the head scores 4 points.

pedal_rearward class-attribute instance-attribute

pedal_rearward: float | None = None

Worst pedal rearward displacement, mm (driver only).

SideOccupant dataclass

SideOccupant(
    hic15: float,
    head_a3ms: float,
    rib_deflection: float,
    rib_vc: float,
    abdominal_force: float,
    pubic_force: float,
    modifiers: Mapping[str, float] = dict(),
)

ES-2 results in the MDB side test.

rib_deflection instance-attribute

rib_deflection: float

Worst rib, mm.

rib_vc instance-attribute

rib_vc: float

Worst rib VC, m/s.

abdominal_force instance-attribute

abdominal_force: float

Peak total abdominal force, N.

pubic_force instance-attribute

pubic_force: float

Peak pubic symphysis force, N.

modifiers class-attribute instance-attribute

modifiers: Mapping[str, float] = field(default_factory=dict)

Points to subtract per region ("head", "chest", "abdomen", "pelvis"), e.g. {"chest": backplate_modifier(fy) + t12_modifier(fy, mx)}.

RegionResult dataclass

RegionResult(
    points: float,
    raw_points: float,
    governing: str,
    criteria: dict[str, float],
    capped: bool,
    values: dict[str, float] = dict(),
)

points instance-attribute

points: float

Points after modifiers, rounded to 3 decimals (not below zero).

raw_points instance-attribute

raw_points: float

Points before modifiers.

governing instance-attribute

governing: str

Criterion with the lowest score.

criteria instance-attribute

criteria: dict[str, float]

Points per criterion.

capped instance-attribute

capped: bool

A criterion of a critical region is above its capping limit.

values class-attribute instance-attribute

values: dict[str, float] = field(default_factory=dict)

Criterion values (HIC15, mm, N ...). For force-duration criteria (neck shear and tension, femur) the level of the exceedance curve where the score is lowest, N.

TestResult dataclass

TestResult(
    points: float,
    groups: dict[str, float],
    regions: dict[str, dict[str, RegionResult]],
    capped: bool,
    critical_zero: bool,
    test_modifiers: float,
    protocol: str = PROTOCOL,
)

points instance-attribute

points: float

Test score (0-16); 0 if capped.

groups instance-attribute

groups: dict[str, float]

Points per (grouped) body region.

regions instance-attribute

regions: dict[str, dict[str, RegionResult]]

Region results per occupant.

capped instance-attribute

capped: bool

A capping limit was exceeded (0 stars).

critical_zero instance-attribute

critical_zero: bool

A critical region scores zero after modifiers (at most 1 star).

protocol class-attribute instance-attribute

protocol: str = PROTOCOL

Rules that produced the result (PROTOCOL).

AopRating dataclass

AopRating(
    stars: int,
    points: float,
    frontal: float,
    side: float,
    reasons: tuple[str, ...],
    protocol: str = PROTOCOL,
)

points instance-attribute

points: float

Frontal + side points (0-32).

reasons instance-attribute

reasons: tuple[str, ...]

Why the rating is below what the points give, if it is.

protocol class-attribute instance-attribute

protocol: str = PROTOCOL

Rules that produced the result (PROTOCOL).

check_edition

check_edition(edition: int) -> str

Return PROTOCOL for a supported edition; raise for any other.

2027 (Bharat NCAP 2.0) is refused with an explanation, so old rules are never applied to a new-edition rating by mistake.

edition_for_date

edition_for_date(date: date) -> int

Bharat NCAP edition that applies to a rating on date.

2023 for 1 October 2023 to 30 September 2027. Earlier dates (before the programme started) and later dates (Bharat NCAP 2.0, not implemented yet) raise ValueError.

sliding_points

sliding_points(
    value: float,
    hpl: float,
    lpl: float,
    max_points: float = MAX_POINTS,
) -> float

Linear sliding scale: max_points at or below the HPL, 0 at or above the LPL.

colour

colour(points: float) -> str

Colour of a 4-point region score (Annexure VIII): green 4.000, yellow 2.670-3.999, orange 1.330-2.669, brown 0.001-1.329, red 0.

curve_points

curve_points(
    time: ArrayLike,
    signal: ArrayLike,
    curves: tuple[Curve, Curve],
    direction: Literal[
        "positive", "negative", "absolute"
    ] = "positive",
    mode: Literal[
        "cumulative", "continuous"
    ] = "cumulative",
    max_points: float = MAX_POINTS,
) -> CurveScore

Score an exceedance curve against higher and lower force-duration curves (Annexure IV 3.2.2 and 3.2.4).

For each level L of the exceedance curve, with duration D(L) at or above it, the points are interpolated between the higher curve H(D) (max_points) and the lower curve W(D) (0). The score is the lowest point on the curve.

Parameters:

Name Type Description Default
curves tuple[Curve, Curve]

(higher, lower) curves as (duration ms, value) points, linear between points and constant after the last.

required
direction Literal['positive', 'negative', 'absolute']

Part of the signal assessed (e.g. "negative" for femur compression stored as negative force, "absolute" for shear).

'positive'
mode Literal['cumulative', 'continuous']

AIS-197 assesses the curves as cumulative exceedance.

'cumulative'

steering_column_modifier

steering_column_modifier(
    rearward: float = 0.0,
    upward: float = 0.0,
    lateral: float = 0.0,
) -> float

Steering column displacement penalty, 0-1 point (Annexure VII 2.1.5): none up to 90 % of the EEVC limits (100 mm rearward, 80 mm upward, 100 mm lateral), 1 point beyond 110 %; worst of the three. Applied to the driver's head.

a_pillar_modifier

a_pillar_modifier(displacement: float) -> float

A-pillar rearward displacement penalty on the chest, 0-2 points: 0 up to 100 mm, 2 above 200 mm (Annexure VII 2.1.6.1).

pedal_upward_modifier

pedal_upward_modifier(displacement: float) -> float

Upward pedal displacement penalty on the lower leg, 0-1 point: none up to 90 % of 80 mm, 1 point beyond 110 % (Annexure VII 2.1.8).

pedal_blocking_modifier

pedal_blocking_modifier(rearward: float) -> float

Blocked pedal penalty on the foot and ankle, 0-1 point between 50 and 175 mm rearward displacement (Annexure VII 2.1.9.2).

backplate_modifier

backplate_modifier(fy: float) -> float

Side backplate load penalty on the chest, 0-2 points between Fy 1.0 and 4.0 kN (fy in N, Annexure VII 3.2).

t12_modifier

t12_modifier(fy: float, mx: float) -> float

Side T12 load penalty on the chest, 0-2 points, worst of Fy 1.5-2.0 kN and Mx 150-200 N m (Annexure VII 3.3 text; its limits table gives 1.0 kN as the Fy higher limit). fy in N, mx in N m; magnitudes are used.

frontal_modifiers

frontal_modifiers(
    *,
    driver: bool = True,
    steering_column: tuple[float, float, float]
    | None = None,
    a_pillar: float | None = None,
    pedal_upward: tuple[float, float] = (0.0, 0.0),
    blocked_pedal_rearward: float | None = None,
    unstable_airbag_contact: bool = False,
    hazardous_airbag_deployment: bool = False,
    incorrect_airbag_deployment: str
    | Sequence[str]
    | None = None,
    steering_wheel_contact: bool = False,
    compartment_integrity_lost: bool = False,
    shoulder_belt_load: float | None = None,
    knee_variable_contact: tuple[bool, bool] = (
        False,
        False,
    ),
    knee_concentrated_load: tuple[bool, bool] = (
        False,
        False,
    ),
    knee_variable_contact_areas: tuple[
        tuple[bool, bool], tuple[bool, bool]
    ]
    | None = None,
    footwell_rupture: bool = False,
    edition: int = EDITION,
) -> dict[str, float]

Frontal (ODB) modifiers by name, as points per region for FrontalOccupant (AIS-197 2023, Annexure VII Section 2).

Each argument is one modifier, so none is applied to the wrong region or forgotten:

============================= ======================= ============ Argument Region Penalty ============================= ======================= ============ steering_column head 0-1, sliding unstable_airbag_contact head 1 hazardous_airbag_deployment head 1 incorrect_airbag_deployment each region given 1 each a_pillar chest 0-2, sliding steering_wheel_contact chest 1 compartment_integrity_lost chest 1 shoulder_belt_load chest 2 above 6 kN knee_variable_contact knee (per leg) 1 knee_concentrated_load knee (per leg) 1 knee_variable_contact_areas knee (per leg) 0.5 per area pedal_upward lower leg (per leg) 0-1, sliding blocked_pedal_rearward foot 0-1, sliding footwell_rupture foot 1 ============================= ======================= ============

Parameters:

Name Type Description Default
driver bool

False for the passenger: the steering, pedal and footwell modifiers are driver-only and raise an error if given.

True
steering_column tuple[float, float, float] | None

Rearward, upward and lateral steering column displacement, mm.

None
a_pillar float | None

A-pillar rearward displacement, mm.

None
pedal_upward tuple[float, float]

Upward pedal displacement acting on the (left, right) lower leg, mm.

(0.0, 0.0)
blocked_pedal_rearward float | None

Rearward displacement of a blocked pedal, mm.

None
incorrect_airbag_deployment str | Sequence[str] | None

Region or regions the airbag was meant to protect, 1 point each (Annexure VII 2.1.4): "head" for a steering wheel airbag, ("knee_left", "knee_right") for a passenger knee airbag, ("head", "chest") for a seat airbag protecting both.

None
shoulder_belt_load float | None

Peak shoulder belt force, N.

None
knee_variable_contact tuple[bool, bool]

(left, right) flags, 1 point each.

(False, False)
knee_concentrated_load tuple[bool, bool]

(left, right) flags, 1 point each.

(False, False)
knee_variable_contact_areas tuple[tuple[bool, bool], tuple[bool, bool]] | None

Driver only, when the concentrated loading modifier is applied to neither knee (Annexure VII 2.1.7.2): each knee zone is split into the column area (75 mm either side of the steering column centreline) and the rest of the facia, 0.5 point each. Give ((left_column, left_facia), (right_column, right_facia)) instead of knee_variable_contact.

None
edition int

Bharat NCAP edition (2023).

EDITION

Returns:

Type Description
dict

Points to subtract per region; regions without a penalty are left out. Pass it as FrontalOccupant(..., modifiers=...).

side_modifiers

side_modifiers(
    *,
    backplate_fy: float | None = None,
    t12_fy: float | None = None,
    t12_mx: float | None = None,
    incorrect_airbag_deployment: str
    | Sequence[str]
    | None = None,
    edition: int = EDITION,
) -> dict[str, float]

Side (MDB) modifiers by name, as points per region for SideOccupant (AIS-197 2023, Annexure VII Section 3).

  • backplate_fy: backplate load penalty (backplate_modifier, 0-2) on the chest.
  • t12_fy, t12_mx: T12 load penalty (t12_modifier, 0-2) on the chest, added to the backplate penalty.
  • incorrect_airbag_deployment: region or regions the airbag was meant to protect, 1 point each (3.1), for example "head" for a curtain airbag, ("head", "chest") for a seat airbag protecting both. A knee airbag deploying incorrectly in the side test is penalised in the frontal test instead (frontal_modifiers).

Forces in N, moment in N m; peak magnitudes. A hazardous airbag deployment seen in the pole test (-1 point, 4.2) is carried over with score_side(..., other_test_modifiers=1).

score_frontal

score_frontal(
    driver: FrontalOccupant,
    passenger: FrontalOccupant,
    door_openings: int = 0,
    fuel_leakage: bool = False,
    other_test_modifiers: float = 0.0,
    edition: int = EDITION,
) -> TestResult

ODB frontal test score, 16 points (AIS-197 2023, Annexures IV and VIII).

Groups: head & neck (head, neck), chest, knee/femur/pelvis (both knees) and leg & foot (both lower legs and the driver's foot), each the worst region or limb of driver and passenger. Test modifiers: 1 point per door opening, 1 point for fuel leakage (or the EV / hybrid post-crash penalty) and other_test_modifiers points.

score_side

score_side(
    occupant: SideOccupant,
    door_openings: int = 0,
    fuel_leakage: bool = False,
    other_test_modifiers: float = 0.0,
    edition: int = EDITION,
) -> TestResult

MDB side test score, 16 points: head, chest (worst rib), abdomen and pelvis, 4 points each (AIS-197 2023, Annexures IV 4.2 and VIII). All four are critical regions. other_test_modifiers covers e.g. a hazardous airbag deployment carried over from the pole test (1 point).

pole_test_passed

pole_test_passed(
    hic15: float,
    head_peak: float,
    head_contact: bool,
    rib_deflection: float,
    rib_vc: float,
    abdominal_force: float,
    pubic_force: float,
    edition: int = EDITION,
) -> bool

Side pole test, 29 km/h (AIS-197 2023, Annexure IV 5.2, Annexure VII 4.1): HIC15 < 700, peak resultant head acceleration < 80 g, no direct head contact with the pole, and thorax, abdomen and pelvis below the side lower performance limits (modifiers not applied).

aop_rating

aop_rating(
    frontal: TestResult,
    side: TestResult,
    max_stars_allowed: int = 5,
    edition: int = EDITION,
) -> AopRating

Adult occupant protection star rating (AIS-197 2023, Table 2A and Annexure VII Section 5).

  • Stars from the frontal + side points: 27 / 22 / 16 / 10 / 4 for 5 / 4 / 3 / 2 / 1 stars.
  • A capping limit exceeded in either test: 0 stars.
  • A critical region at zero points (red): at most 1 star.
  • Front and side scores differing by more than 35 % (taken here as 35 % of the 16-point test maximum): one star less, unless both scores exceed 8.2 points and the total exceeds 22.
  • max_stars_allowed: the highest rating whose safety assist qualifiers (Annexure VI: ESC, side head protection with a side pole test, pedestrian protection, seat belt reminders) are met; see pole_test_passed.

cop_stars

cop_stars(points: float, two_seater: bool = False) -> int

Child occupant protection stars from its points (49, or 22 for two-seaters), AIS-197 Table 2B and Annexure VIII 4.3.