Example #1
0
def shelxl_weights_a_b(fo_sq, sigmas, fc_sq, osf_sq, a, b):
  assert sigmas.size() == fo_sq.size()
  assert fc_sq.size() == fo_sq.size()
  from cctbx.xray.targets.tst_shelxl_wght_ls import calc_w
  assert sigmas.all_ge(0.01)
  return calc_w(
    wa=a, wb=b, i_obs=fo_sq, i_sig=sigmas, i_calc=fc_sq, k=osf_sq**0.5)
Example #2
0
def shelxl_weights_a_b(fo_sq, sigmas, fc_sq, osf_sq, a, b):
  assert sigmas.size() == fo_sq.size()
  assert fc_sq.size() == fo_sq.size()
  from cctbx.xray.targets.tst_shelxl_wght_ls import calc_w
  assert sigmas.all_ge(0.01)
  return calc_w(
    wa=a, wb=b, i_obs=fo_sq, i_sig=sigmas, i_calc=fc_sq, k=osf_sq**0.5)
Example #3
0
 def calc_shelxl_wght_ls(O, f_cbs, need):
   assert need in ["w", "t"]
   i_calc = flex.norm(f_cbs)
   from cctbx.xray.targets.tst_shelxl_wght_ls import calc_k, calc_w, calc_t
   k = calc_k(f_obs=O.f_obs.data(), i_calc=i_calc)
   assert O.i_obs.sigmas().all_ge(0.01)
   w = calc_w(
     wa=0.1,
     wb=0,
     i_obs=O.i_obs.data(),
     i_sig=O.i_obs.sigmas(),
     i_calc=i_calc,
     k=k)
   if (need == "w"):
     return w
   class wrapper(object):
     def __init__(W):
       W.t = calc_t(O.i_obs.data(), i_calc, k, w)
     def target_work(W):
       return W.t
   return wrapper()
Example #4
0
 def calc_shelxl_wght_ls(O, f_cbs, need):
   assert need in ["w", "t"]
   i_calc = flex.norm(f_cbs)
   from cctbx.xray.targets.tst_shelxl_wght_ls import calc_k, calc_w, calc_t
   k = calc_k(f_obs=O.f_obs.data(), i_calc=i_calc)
   assert O.i_obs.sigmas().all_ge(0.01)
   w = calc_w(
     wa=0.1,
     wb=0,
     i_obs=O.i_obs.data(),
     i_sig=O.i_obs.sigmas(),
     i_calc=i_calc,
     k=k)
   if (need == "w"):
     return w
   class wrapper(object):
     def __init__(W):
       W.t = calc_t(O.i_obs.data(), i_calc, k, w)
     def target_work(W):
       return W.t
   return wrapper()