Пример #1
0
def autofocus_move_motor(self, stepsize, motor, pos_now, wait_time=None):
    '''
    Moves motor accordingly.
    '''

    # dict
    letter = ['x', 'y', 'z']
    name = ['DRVX', 'DRVY', 'DRVZ']

    # calculate proper waiting time
    if wait_time is None:
        wait_time = fg.config['motor']['standard_move_time_'+letter[motor]] * \
            abs(stepsize) / fg.config['motor']['standard_move_dist_'+letter[motor]]

    # move and update config
    toolbox.move_motor(self=self,
                       instance=None,
                       motor_sel=motor,
                       motor_stepsize=stepsize)
    #fg.config['motor']['calibration_'+letter[motor]+'_pos'] += stepsize
    pos_now += stepsize

    # wait for movement to finish
    sleep(wait_time)

    return wait_time, pos_now
Пример #2
0
def tomography_callback(self):
    '''
    Real image acquisition-routine for tomographd mode. 
    '''
    # parameters
    nbr_steps = fg.config['tomo']['steps']+1
    fg.config['tomo']['done'] = False

    # get update (motor-movement direction)
    fg.config['tomo']['direction'] = -1 if fg.config['tomo']['posSTART'] >= fg.config['tomo']['posEND'] else 1
    if  fg.config['tomo']['posSTART'] ==  fg.config['tomo']['posEND']:
        logger.warning("Start and END-Pos are the same hence the system will take {} images at the same position.".format(nbr_steps))

    # iterate through tomography stack
    for imnbr in range(fg.config['tomo']['steps']+1):
        # actualize global number
        fg.config['tomo']['step_number'] = imnbr

        # to update measurement numbers indirectly
        if imnbr == fg.config['tomo']['steps']:
            fg.config['tomo']['done'] = True

        # take image with selected method
        toolbox.take_image(self)

        # move to next position 
        toolbox.move_motor(self, instance=None, motor_sel=fg.config['tomo']['motor'],
                motor_stepsize=fg.config['tomo']['stepsize'])
Пример #3
0
 def btn_function_move_motor(self, instance):
     if fg.my_dev_flag:
         print(
             "I am I am delivering data to the arduino by pidgeon. Takes a while..."
         )
     if not 'pb_motor' in fg.EVENT:
         toolbox.move_motor(self, instance)
         toolbox.select_method(self, instance, "motor_mov_buttons")