def exercise_phase_integral(): sg = sgtbx.space_group_info("P 21 21 21").group() i = flex.miller_index([(1,2,3), (3,0,3)]) hl = flex.hendrickson_lattman([(1,2,3,4),(-2,3,-4,-5)]) integrator = miller.phase_integrator(n_steps=10) assert integrator.n_steps() == 10 integrator = miller.phase_integrator() assert integrator.n_steps() == 360//5 assert approx_equal(integrator(sg.phase_restriction(i[0]), hl[0]), 0.78832161462+0.466993941292j) assert approx_equal(integrator(sg.phase_restriction(i[1]), hl[1]), 6.09275186883e-17+0.995054753687j) assert approx_equal(integrator( space_group=sg, miller_indices=i, hendrickson_lattman_coefficients=hl), [(0.78832161462020822+0.46699394129187444j), (6.0927518688296534e-17+0.99505475368673046j)])
def compute_phase_source(self, hl_coeffs, n_steps=72): integrator = miller.phase_integrator(n_steps=n_steps) self.phase_source_previous = self.phase_source self.phase_source = miller.array( miller_set=hl_coeffs, data=integrator(space_group=hl_coeffs.space_group(), miller_indices=hl_coeffs.indices(), hendrickson_lattman_coefficients=hl_coeffs.data())) if self.phase_source_initial is None: self.phase_source_initial = self.phase_source return self.phase_source
def compute_phase_source(self, hl_coeffs, n_steps=72): integrator = miller.phase_integrator(n_steps=n_steps) self.phase_source_previous = self.phase_source self.phase_source = miller.array( miller_set=hl_coeffs, data=integrator( space_group=hl_coeffs.space_group(), miller_indices=hl_coeffs.indices(), hendrickson_lattman_coefficients=hl_coeffs.data())) if self.phase_source_initial is None: self.phase_source_initial = self.phase_source return self.phase_source