def check_time_frame(accu_block,rel_pos_frame,actual_frame_time,seconds_ref,seconds_duration):
    """
    Check if actual timestamp of this frame is inside the experiment time wnidow.
    
    Parameters
    ----------
     accu_block
         accumulation period id (-1 if outside scan window).
     rel_pos_frame
         relative frame position in accumulation period.
     actual_frame_time
         actual timestamp (considering delays) for the first sample of the frame.
     seconds_ref
         start of the scan [s].
     seconds_duration
         duration of the scan [s].
     
    Returns
    -------
     process_frame : int
         1 if frame inside scan.
     after_end_time : int
         1 if frame after end of defined window.
    """
    process_frame=1
    after_end_time=0
    if accu_block<0:
        process_frame=0
    elif actual_frame_time<seconds_ref:
        if rel_pos_frame!=0: # if zero then split frame
            process_frame=0
    elif actual_frame_time>(seconds_ref+seconds_duration):
        process_frame=0
        after_end_time=1


    return([process_frame,after_end_time])