Ejemplo n.º 1
0
def ensure_correct_element_symbol():
    from cctbx.eltbx import tiny_pse
    for e in xray_scattering.it1992_iterator():
        l = e.label()
        e, c = xray_scattering.get_element_and_charge_symbols(
            scattering_type=l, exact=False)
        assert tiny_pse.table(l).symbol() == e
        assert tiny_pse.table(l.lower()).symbol() == e
        assert tiny_pse.table(l.upper()).symbol() == e
Ejemplo n.º 2
0
def ensure_correct_element_symbol():
  from cctbx.eltbx import tiny_pse
  for e in xray_scattering.it1992_iterator():
    l = e.label()
    e, c = xray_scattering.get_element_and_charge_symbols(
      scattering_type=l, exact=False)
    assert tiny_pse.table(l).symbol() == e
    assert tiny_pse.table(l.lower()).symbol() == e
    assert tiny_pse.table(l.upper()).symbol() == e
Ejemplo n.º 3
0
def exercise_it1992():
    e = xray_scattering.it1992("c1")
    assert e.table() == "IT1992"
    assert e.label() == "C"
    g = e.fetch()
    assert g.n_terms() == 4
    assert g.n_parameters() == 9
    assert approx_equal(g.array_of_a(), (2.31000, 1.02000, 1.58860, 0.865000))
    assert approx_equal(g.array_of_b(), (20.8439, 10.2075, 0.568700, 51.6512))
    assert approx_equal(g.c(), 0.215600)
    assert approx_equal(g.at_stol_sq(0), 5.99919997156)
    assert approx_equal(g.at_stol_sq(1. / 9), 2.26575563201)
    assert approx_equal(g.at_stol(1. / 9), 4.93537567523)
    assert approx_equal(g.at_d_star_sq(1. / 9), 4.04815863088)
    e = xray_scattering.it1992("yb2+", True)
    assert e.label() == "Yb2+"
    g = e.fetch()
    assert approx_equal(g.array_of_a()[0], 28.1209)
    assert approx_equal(g.array_of_b()[3], 20.3900)
    assert approx_equal(g.c(), 3.70983)
    e = xray_scattering.it1992("  yB3+")
    assert e.label() == "Yb3+"
    g = e.fetch()
    assert approx_equal(g.array_of_a()[0], 27.8917)
    n = 0
    for e in xray_scattering.it1992_iterator():
        n += 1
        if (n == 213):
            assert e.label() == "Cf"
        else:
            assert e.label() != "Cf"
        d = xray_scattering.it1992(e.label(), True)
        assert d.label() == e.label()
    assert n == 213
    i = xray_scattering.it1992_iterator()
    j = iter(i)
    assert i is j
Ejemplo n.º 4
0
def exercise_it1992():
  e = xray_scattering.it1992("c1")
  assert e.table() == "IT1992"
  assert e.label() == "C"
  g = e.fetch()
  assert g.n_terms() == 4
  assert g.n_parameters() == 9
  assert approx_equal(g.array_of_a(), (2.31000, 1.02000, 1.58860, 0.865000))
  assert approx_equal(g.array_of_b(), (20.8439, 10.2075, 0.568700, 51.6512))
  assert approx_equal(g.c(), 0.215600)
  assert approx_equal(g.at_stol_sq(0), 5.99919997156)
  assert approx_equal(g.at_stol_sq(1./9), 2.26575563201)
  assert approx_equal(g.at_stol(1./9), 4.93537567523)
  assert approx_equal(g.at_d_star_sq(1./9), 4.04815863088)
  e = xray_scattering.it1992("yb2+", True)
  assert e.label() == "Yb2+"
  g = e.fetch()
  assert approx_equal(g.array_of_a()[0], 28.1209)
  assert approx_equal(g.array_of_b()[3], 20.3900)
  assert approx_equal(g.c(), 3.70983)
  e = xray_scattering.it1992("  yB3+")
  assert e.label() == "Yb3+"
  g = e.fetch()
  assert approx_equal(g.array_of_a()[0], 27.8917)
  n = 0
  for e in xray_scattering.it1992_iterator():
    n += 1
    if (n == 213):
      assert e.label() == "Cf"
    else:
      assert e.label() != "Cf"
    d = xray_scattering.it1992(e.label(), True)
    assert d.label() == e.label()
  assert n == 213
  i = xray_scattering.it1992_iterator()
  j = iter(i)
  assert i is j
Ejemplo n.º 5
0
def ensure_common_symbols():
  lbl_it = []
  for e in xray_scattering.it1992_iterator(): lbl_it.append(e.label())
  lbl_it.sort()
  lbl_wk = []
  for e in xray_scattering.wk1995_iterator(): lbl_wk.append(e.label())
  lbl_wk.sort()
  assert lbl_wk == lbl_it
  lbl_ng = []
  for i_entry in xrange(xray_scattering.n_gaussian_table_size()):
    lbl_ng.append(xray_scattering.n_gaussian_table_entry(i_entry, 6).label())
  lbl_ng.sort()
  assert lbl_ng == lbl_it
  #
  for label in xray_scattering.standard_labels_list():
    it = xray_scattering.it1992(label, True).fetch()
    wk = xray_scattering.wk1995(label, True).fetch()
    ng = xray_scattering.n_gaussian_table_entry(label, 0, 0).gaussian()
    assert approx_equal(wk.at_stol(0)/it.at_stol(0), 1, 5.e-3)
Ejemplo n.º 6
0
def ensure_common_symbols():
    lbl_it = []
    for e in xray_scattering.it1992_iterator():
        lbl_it.append(e.label())
    lbl_it.sort()
    lbl_wk = []
    for e in xray_scattering.wk1995_iterator():
        lbl_wk.append(e.label())
    lbl_wk.sort()
    assert lbl_wk == lbl_it
    lbl_ng = []
    for i_entry in range(xray_scattering.n_gaussian_table_size()):
        lbl_ng.append(
            xray_scattering.n_gaussian_table_entry(i_entry, 6).label())
    lbl_ng.sort()
    assert lbl_ng == lbl_it
    #
    for label in xray_scattering.standard_labels_list():
        it = xray_scattering.it1992(label, True).fetch()
        wk = xray_scattering.wk1995(label, True).fetch()
        ng = xray_scattering.n_gaussian_table_entry(label, 0, 0).gaussian()
        assert approx_equal(wk.at_stol(0) / it.at_stol(0), 1, 5.e-3)