def get_analysis_result(raw_scan_id, db_analysis=db_analysis):
    """
    Get data from analysis store with given raw_scan_id=uid.
    More rich search can be implemented here.

    Parameters
    ----------
    raw_scan_id : int
        scan_id of original scan
    db : analysis store, optional
        where analysis result is to be saved

    Returns
    -------
    header
    """
    res = db_analysis(raw_scan_id=raw_scan_id)
    res = list(res)
    if not len(res):
        print('No analysis result is found for {}.'.format(raw_scan_id))
        return
    res = sorted(res, key=lambda x: x.start.time)
    uid = res[-1].start.uid
    hdr = db_analysis[uid]
    return hdr
