Changeset 71 for trunk/testinp


Ignore:
Timestamp:
May 28, 2010 6:15:43 PM (12 years ago)
Author:
toby
Message:

Update orthogonalization routine w/unit-tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testinp/gencelltests.py

    r70 r71  
    66
    77fp = sys.stdout
    8 fp.write("# output from uctbx computed on platform %s on %s\n" %
     8fp.write("# output from uctbx (cctbx) computed on platform %s on %s\n" %
    99         (sys.platform, datetime.date.today()) )
    10 fp.write("import numpy as np\n")
     10fp.write("#import numpy as np\n")
    1111fp.write("array = np.array\n\n")
    1212fp.write("CellTestData = [\n")
     
    4040fp.write("]\n")
    4141
     42fp.write("CoordTestData = [\n")
     43for cell in [
     44    (4,4,4,90,90,90),
     45    (4.1,5.2,6.3,100,80,130),
     46    (3.5,3.5,6,90,90,120),
     47    ]:
     48    fp.write("# cell, ((frac, ortho),...)\n")
     49    fp.write("  ((%s,%s,%s,%s,%s,%s,), [\n" % cell)
     50    for frac in [
     51        (0.1,0.,0.),
     52        (0.,0.1,0.),
     53        (0.,0.,0.1),
     54        (0.1,0.2,0.3),
     55        (0.2,0.3,0.1),
     56        (0.3,0.2,0.1),
     57        (0.5,0.5,0.5),
     58        ]:
     59        fp.write(" (%s,%s),\n" % (frac, uc.unit_cell(cell).orthogonalize(frac)))
     60    fp.write("]),\n")
     61fp.write("]\n")
     62   
     63sys.exit()
Note: See TracChangeset for help on using the changeset viewer.