def test_scattering_info(): miller_array = random_data(35.0, d_min=2.5) d_star_sq = miller_array.d_spacings().data() d_star_sq = 1.0 / (d_star_sq * d_star_sq) asu = { "H": 8.0 * 585.0, "C": 5.0 * 585.0, "N": 1.5 * 585.0, "O": 1.2 * 585.0 } scat_info = absolute_scaling.scattering_information(asu_contents=asu, fraction_protein=1.0, fraction_nucleic=0.0) scat_info.scat_data(d_star_sq) scat_info2 = absolute_scaling.scattering_information(n_residues=585.0) scat_info2.scat_data(d_star_sq) sigma_prot = scaling.get_sigma_prot_sq(d_star_sq, 195.0 * 3.0) # Testing for consistency for ii in range(d_star_sq.size()): assert approx_equal(scat_info.sigma_tot_sq[ii], scat_info2.sigma_tot_sq[ii], eps=1e-03) assert approx_equal(scat_info.sigma_tot_sq[ii], sigma_prot[ii], eps=0.5)
def test_scattering_info(): miller_array = random_data(35.0, d_min=2.5 ) d_star_sq = miller_array.d_spacings().data() d_star_sq = 1.0/(d_star_sq*d_star_sq) asu = {"H":8.0*585.0,"C":5.0*585.0,"N":1.5*585.0, "O":1.2*585.0} scat_info = absolute_scaling.scattering_information( asu_contents = asu, fraction_protein=1.0, fraction_nucleic=0.0) scat_info.scat_data(d_star_sq) scat_info2 = absolute_scaling.scattering_information( n_residues=585.0) scat_info2.scat_data(d_star_sq) sigma_prot = scaling.get_sigma_prot_sq(d_star_sq,195.0*3.0) # Testing for consistency for ii in range(d_star_sq.size()): assert approx_equal(scat_info.sigma_tot_sq[ii], scat_info2.sigma_tot_sq[ii], eps=1e-03) assert approx_equal(scat_info.sigma_tot_sq[ii], sigma_prot[ii], eps=0.5)
def test_sigma_prot(): z_0 = scaling.sigma_prot_sq(0.0, 1.0) z_0_theory = + 8.0*1.0*1.0 \ + 5.0*6.0*6.0 \ + 1.5*7.0*7.0 \ + 1.2*8.0*8.0 assert approx_equal(z_0, z_0_theory, eps=1e-0) d_star_sq = flex.double([0.0]) z_0_array = scaling.get_sigma_prot_sq(d_star_sq, 1.0) assert approx_equal(z_0_array[0], z_0)
def test_sigma_prot(): z_0 = scaling.sigma_prot_sq(0.0,1.0) z_0_theory = + 8.0*1.0*1.0 \ + 5.0*6.0*6.0 \ + 1.5*7.0*7.0 \ + 1.2*8.0*8.0 assert approx_equal(z_0,z_0_theory,eps=1e-0) d_star_sq = flex.double([0.0]) z_0_array = scaling.get_sigma_prot_sq(d_star_sq,1.0) assert approx_equal(z_0_array[0],z_0)