def motor_positions_cristal(logfile, setup):
    """
    Load the scan data and extract motor positions.

    :param logfile: h5py File object of CRISTAL .nxs scan file
    :param setup: the experimental setup: Class SetupPreprocessing()
    :return: (mgomega, gamma, delta) motor positions
    """
    if setup.rocking_angle != 'outofplane':
        raise ValueError(
            'Only out of plane rocking curve implemented for CRISTAL')
    if not setup.custom_scan:
        group_key = list(logfile.keys())[0]
        mgomega = logfile['/' + group_key + '/scan_data/actuator_1_1'][:
            ] / 1000000.0
        delta = logfile['/' + group_key +
            '/CRISTAL/Diffractometer/I06-C-C07-EX-DIF-DELTA/position'][:]
        gamma = logfile['/' + group_key +
            '/CRISTAL/Diffractometer/I06-C-C07-EX-DIF-GAMMA/position'][:]
    else:
        mgomega = setup.custom_motors['mgomega'] / 1000000.0
        delta = setup.custom_motors['delta']
        gamma = setup.custom_motors['gamma']
    return mgomega, gamma, delta
