S15qkd/controller.py
def time_difference_find():
    '''
    Starts pfind and searches for the detection coincidence peak in combined timestamp files.
    '''
    global periode_count, fft_buffer_order
    global prog_pfind, first_epoch

    first_epoch, epoch_diff = wait_for_epoch_files(periode_count)

    if epoch_diff > 0:
        use_periods = periode_count - epoch_diff  # less periodes are available
    else:
        # Not sure why minus 2, but I'm following what was done in crgui_ec.
        use_periods = periode_count - 2

    args = f'-d {cwd}/{dataroot}/receivefiles \
            -D {cwd}/{dataroot}/t1 \
            -e 0x{first_epoch} \
            -n {use_periods} -V 1 \
            -q {fft_buffer_order}'
    logger.info(f'starting pfind with: {args}')
    with open(f'{cwd}/{dataroot}/pfinderror', 'a+') as f:
        proc_pfind = subprocess.Popen([prog_pfind, *args.split()],
                                      stderr=f,
                                      stdout=subprocess.PIPE)
    proc_pfind.wait()
    pfind_result = (proc_pfind.stdout.read()).decode()
    if len(pfind_result) == 0:
        logger.error('pfind did not return anything')
        raise Exception('pfind did not return anything')
    logger.info(f'Pfind result: {pfind_result.split()}')
    return [float(i) for i in pfind_result.split()]

    Starts pfind and searches for the detection coincidence peak in combined timestamp files.
    
Starts pfind and searches for the detection coincidence peak in combined timestamp files.
Starts pfind and searches for the detection coincidence peak in combined timestamp files .
def time_difference_find():
    global periode_count, fft_buffer_order
    global prog_pfind, first_epoch
    first_epoch, epoch_diff = wait_for_epoch_files(periode_count)
    if epoch_diff > 0:
        use_periods = periode_count - epoch_diff  
    else:
        use_periods = periode_count - 2
    args = f'-d {cwd}/{dataroot}/receivefiles \
            -D {cwd}/{dataroot}/t1 \
            -e 0x{first_epoch} \
            -n {use_periods} -V 1 \
            -q {fft_buffer_order}'
    logger.info(f'starting pfind with: {args}')
    with open(f'{cwd}/{dataroot}/pfinderror', 'a+') as f:
        proc_pfind = subprocess.Popen([prog_pfind, *args.split()],
                                      stderr=f,
                                      stdout=subprocess.PIPE)
    proc_pfind.wait()
    pfind_result = (proc_pfind.stdout.read()).decode()
    if len(pfind_result) == 0:
        logger.error('pfind did not return anything')
        raise Exception('pfind did not return anything')
    logger.info(f'Pfind result: {pfind_result.split()}')
    return [float(i) for i in pfind_result.split()]
def time_difference_find ( ) : global periode_count , fft_buffer_order global prog_pfind , first_epoch first_epoch , epoch_diff = wait_for_epoch_files ( periode_count ) if epoch_diff > 0 : use_periods = periode_count - epoch_diff else : use_periods = periode_count - 2 args = f'-d {cwd}/{dataroot}/receivefiles \
            -D {cwd}/{dataroot}/t1 \
            -e 0x{first_epoch} \
            -n {use_periods} -V 1 \
            -q {fft_buffer_order}' logger . info ( f'starting pfind with: {args}' ) with open ( f'{cwd}/{dataroot}/pfinderror' , 'a+' ) as f : proc_pfind = subprocess . Popen ( [ prog_pfind , * args . split ( ) ] , stderr = f , stdout = subprocess . PIPE ) proc_pfind . wait ( ) pfind_result = ( proc_pfind . stdout . read ( ) ) . decode ( ) if len ( pfind_result ) == 0 : logger . error ( 'pfind did not return anything' ) raise Exception ( 'pfind did not return anything' ) logger . info ( f'Pfind result: {pfind_result.split()}' ) return [ float ( i ) for i in pfind_result . split ( ) ]
Starts pfind and searches for the detection coincidence peak in combined timestamp files.
Starts pfind and searches for the detection coincidence peak in combined timestamp files .
'''
    Starts pfind and searches for the detection coincidence peak in combined timestamp files.
    ''' # less periodes are available # Not sure why minus 2, but I'm following what was done in crgui_ec.