Example #1
0
    def create(cls, params, experiments, reflections=None):
        '''
    Compute or load the profile model.

    :param params: The input phil parameters
    :param experiments: The experiment list
    :param reflections: The reflection table
    :return: The profile model

    '''
        from dials.interfaces import ProfileModelIface
        Extension = ProfileModelIface.extension(params.profile.algorithm)
        Algorithm = Extension().algorithm()
        create_profile_model = True
        if hasattr(params, 'create_profile_model'):
            create_profile_model = params.create_profile_model
        if (create_profile_model and reflections is not None
                and "shoebox" in reflections):
            for expr, indices in reflections.iterate_experiments_and_indices(
                    experiments):
                expr.profile = Algorithm.create(params.profile,
                                                reflections.select(indices),
                                                expr.crystal, expr.beam,
                                                expr.detector, expr.goniometer,
                                                expr.scan)
        else:
            for expr in experiments:
                expr.profile = Algorithm.create(params.profile, None,
                                                expr.crystal, expr.beam,
                                                expr.detector, expr.goniometer,
                                                expr.scan, expr.profile)
        return experiments
Example #2
0
    def create(cls, params, experiments, reflections):
        '''
    Compute or load the profile model.

    :param params: The input phil parameters
    :param experiments: The experiment list
    :param reflections: The reflection table
    :return: The profile model

    '''
        from dials.interfaces import ProfileModelIface
        Extension = ProfileModelIface.extension(params.profile.algorithm)
        Algorithm = Extension().algorithm()
        for expr, indices in reflections.iterate_experiments_and_indices(
                experiments):
            expr.profile = Algorithm.create(params.profile,
                                            reflections.select(indices),
                                            expr.crystal, expr.beam,
                                            expr.detector, expr.goniometer,
                                            expr.scan)
        return experiments
Example #3
0
  def create(cls, params, experiments, reflections):
    '''
    Compute or load the profile model.

    :param params: The input phil parameters
    :param experiments: The experiment list
    :param reflections: The reflection table
    :return: The profile model

    '''
    from dials.interfaces import ProfileModelIface
    Extension = ProfileModelIface.extension(params.profile.algorithm)
    Algorithm = Extension().algorithm()
    for expr, indices in reflections.iterate_experiments_and_indices(experiments):
      expr.profile = Algorithm.create(
        params.profile,
        reflections.select(indices),
        expr.crystal,
        expr.beam,
        expr.detector,
        expr.goniometer,
        expr.scan)
    return experiments