Chapters:
|
MuSR /
TapasStart< description of cctbx_source | Index | Muzen: a FORTRAN 77 & c analysis program (historical) > For the moment just instructionsDipolar sum conversions: {$ {\mathbf B}_{dip}= \frac {\mu_0}{4 \pi} \frac{3({\mathbf\mu}_e\cdot \hat r)\hat r-{\mathbf \mu}_e}{r^3} $} With electron moment {$\mu_e$} in Bohr magnetons and {$r$} in Å the conversion factor in front of the last fraction to get the field in Tesla is {$ \frac {\mu_0}{4 \pi} \mu_B 10^{30} = 0.9274 $} How to read in plain CIF data
e.g. the YBCO6-jmol.cif file generated from the Bilbao server
from PyCifRW import CifFile cf=CifFile.ReadCif("/home/roberto.derenzi/ipython/YBCO6-jmol-orig.cif") print cf # prints it all text=cf.dictionary.items() # get the header, which is an array containing a tuple (!?!) ntext=text[0] # this is the tuple, mad eof two items, the first is a # string: 'generated_by_bilbao_crystallographic_server' word=ntext[0] # this is the string alone cif_global = cf[word] # this is the cif records # the rule is to copy everything afted "data_" in the first line # obtained from cf.dictionay.keys() as ['generated_by_bilbao_crystallographic_server'] # not clear how to feed it back from cctbx import uctbx, sgtbx, crystal
for param in [ "_cell_length_a","_cell_length_b","_cell_length_c", "_cell_angle_alpha","_cell_angle_beta","_cell_angle_gamma"]]) space_group_info = sgtbx.space_group_info( symbol=cif_global["_symmetry_space_group_name_H-M"]) crystal_symmetry = crystal.symmetry( unit_cell=unit_cell, space_group_info=space_group_info) crystal_symmetry.show_summary() from cctbx import xray structure = xray.structure(crystal_symmetry=crystal_symmetry) for label,x,y,z in zip(cif_global["_atom_site_label"], cif_global["_atom_site_fract_x"], cif_global["_atom_site_fract_y"], cif_global["_atom_site_fract_z"]): scatterer = xray.scatterer( label=label, site=[float(s) for s in [x,y,z]]) structure.add_scatterer(scatterer) structure.show_summary() structure.show_scatterers() This produces an output with certain structural information < description of cctbx_source | Index | Muzen: a FORTRAN 77 & c analysis program (historical) > |