def curveqa(pyccd_result, ordinal):
    """
    Curve fit information for the segment in which the ordinal intersects with.

    Defaults to 0 in cases where the given ordinal day to calculate from
    is either < 1 or it does not intersect with a segment identified in
    pyccd.

    Args:
        pyccd_result: dict return from pyccd
        ordinal: ordinal day to calculate from

    Returns:
        int
    """
    ret = 0

    if ordinal > 0:
        for segment in pyccd_result['change_models']:
            if segment['start_day'] <= ordinal <= segment['end_day']:
                ret = segment['curve_qa']
                break

    return ret