[cctbxbb] Generate atom data from cctbx

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Jan 16 07:28:57 PST 2006


Hi James,

--- Jen-Chang Chen <d91521001 at ntu.edu.tw> wrote:

> I'd like to apply cctbx as a generator of the crystallographic data. 
> Based on  the ICSD database, I can obtain a crystal structure of a mineral.
> Would it be possible to print out all atom positions in a unit cell or a 
> supercell using cctbx?

The Cr2O3 example is included in the cctbx/cctbx/examples directory:

http://phenix-online.org/cctbx_sources/cctbx/cctbx/examples/cr2o3_primitive_cell.py

Simply add this line to print out all atom positions in a unit cell:

    icsd_structure.expand_to_p1().show_summary().show_scatterers()

For the supercell you have to figure out the change-of-basis matrix, then use
the .change_basis() method of the xray.structure object. E.g. to double the
length of the c-axis, add this at the end of the example script:

  from cctbx import sgtbx
  cb_op = sgtbx.change_of_basis_op("x,y,z*0.5")
  super_structure = icsd_structure.change_basis(cb_op=cb_op)
  super_structure.show_summary().show_scatterers()
  print

Cheers,
        Ralf


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the cctbxbb mailing list