示例#1
0
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#

from __future__ import division
from dials.array_family import flex
from logging import info, debug
from dials.util import log
debug_handle = log.debug_handle()
info_handle = log.info_handle()
import libtbx
from libtbx.utils import Sorry
from dials.algorithms.indexing.indexer import indexer_base
from dials.algorithms.indexing.known_orientation import indexer_known_orientation
from dials.algorithms.indexing.real_space_grid_search import indexer_real_space_grid_search
from dials.algorithms.indexing.fft3d import indexer_fft3d
from dials.algorithms.indexing.fft1d import indexer_fft1d
from dxtbx.model.experiment.experiment_list import Experiment, ExperimentList
from dials.algorithms.indexing.nave_parameters import nave_parameters
import math
from dials.algorithms.indexing.indexer import master_params

def calc_2D_rmsd_and_displacements(reflections):

  displacements = flex.vec2_double(reflections['xyzobs.px.value'].parts()[0], reflections['xyzobs.px.value'].parts()[1]) - \
                  flex.vec2_double(reflections['xyzcal.px'].parts()[0], reflections['xyzcal.px'].parts()[1])
  rmsd = math.sqrt(flex.mean(displacements.dot( displacements )))

  return rmsd,displacements

def plot_displacements(reflections, predictions, experiments):
示例#2
0
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#

from __future__ import absolute_import, division
from __future__ import print_function
import logging
logger = logging.getLogger(__name__)

from dials.array_family import flex
from dials.util import log
debug_handle = log.debug_handle(logger)
info_handle = log.info_handle(logger)
import libtbx
from libtbx.utils import Sorry
from dials.algorithms.indexing.indexer import indexer_base
from dials.algorithms.indexing.known_orientation import indexer_known_orientation
from dials.algorithms.indexing.real_space_grid_search import indexer_real_space_grid_search
from dials.algorithms.indexing.fft3d import indexer_fft3d
from dials.algorithms.indexing.fft1d import indexer_fft1d
from dxtbx.model.experiment_list import Experiment, ExperimentList
from dials.algorithms.indexing.nave_parameters import nave_parameters
import math
from dials.algorithms.indexing.indexer import master_params


def calc_2D_rmsd_and_displacements(reflections):

    displacements = flex.vec2_double(reflections['xyzobs.px.value'].parts()[0], reflections['xyzobs.px.value'].parts()[1]) - \
                    flex.vec2_double(reflections['xyzcal.px'].parts()[0], reflections['xyzcal.px'].parts()[1])
    rmsd = math.sqrt(flex.mean(displacements.dot(displacements)))
示例#3
0
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#

from __future__ import division
import logging
logger = logging.getLogger(__name__)

from dials.array_family import flex
from dials.util import log
debug_handle = log.debug_handle(logger)
info_handle = log.info_handle(logger)
import libtbx
from libtbx.utils import Sorry
from dials.algorithms.indexing.indexer import indexer_base
from dials.algorithms.indexing.known_orientation import indexer_known_orientation
from dials.algorithms.indexing.real_space_grid_search import indexer_real_space_grid_search
from dials.algorithms.indexing.fft3d import indexer_fft3d
from dials.algorithms.indexing.fft1d import indexer_fft1d
from dxtbx.model.experiment.experiment_list import Experiment, ExperimentList
from dials.algorithms.indexing.nave_parameters import nave_parameters
import math
from dials.algorithms.indexing.indexer import master_params

def calc_2D_rmsd_and_displacements(reflections):

  displacements = flex.vec2_double(reflections['xyzobs.px.value'].parts()[0], reflections['xyzobs.px.value'].parts()[1]) - \
                  flex.vec2_double(reflections['xyzcal.px'].parts()[0], reflections['xyzcal.px'].parts()[1])
  rmsd = math.sqrt(flex.mean(displacements.dot(displacements)))

  return rmsd,displacements