out_mem
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| out_mem [2023/09/12 23:13] – [Application Example: Working .inp to export .mem and .prf files] iangie | out_mem [2025/09/19 15:18] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Macro to output .mem file and .prf file for MEM analysis in Dysnomia ====== | ||
| + | The macros in this page output .mem file and .prf file for [[https:// | ||
| + | The format of .mem and .prf files are based on the Dysnomia example files. | ||
| + | |||
| + | This macro calls other macros " | ||
| + | |||
| + | This macro has been tested working in TOPAS v6. | ||
| + | |||
| + | ==== The macros ==== | ||
| + | === Out_MEM === | ||
| + | This macro exports the real part and imaginary part of observed structure factors, and their errors for each reflection. | ||
| + | This macro also calls " | ||
| + | The macro parameter " | ||
| + | |||
| + | <code topas> | ||
| + | macro Out_MEM(phasename, | ||
| + | #if (Run_Number == 0) | ||
| + | out phasename## | ||
| + | Out_String("# | ||
| + | Out(Get(phase_name), | ||
| + | Out_String("# | ||
| + | Out(Get(a), | ||
| + | Out(Get(b), | ||
| + | Out(Get(c), | ||
| + | Out(Get(al), | ||
| + | Out(Get(be), | ||
| + | Out(Get(ga), | ||
| + | Out_String("# | ||
| + | Out_String("# | ||
| + | Out_String("# | ||
| + | Out_String("# | ||
| + | Out_String(" | ||
| + | Out_String("# | ||
| + | Out(sg_num(sgs), | ||
| + | Out(6(Round(Get(a)/ | ||
| + | Out(6(Round(Get(b)/ | ||
| + | Out(6(Round(Get(c)/ | ||
| + | Out_String("# | ||
| + | Out(Total_e_in_Cell, | ||
| + | Out_String(" | ||
| + | Out_String("# | ||
| + | Out_String(" | ||
| + | Out_String("# | ||
| + | phase_out phasename## | ||
| + | load out_record out_fmt out_eqn | ||
| + | { " | ||
| + | " | ||
| + | " | ||
| + | '" | ||
| + | '" | ||
| + | '" | ||
| + | '" | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | Out_PRF(phasename) | ||
| + | #else | ||
| + | out phasename## | ||
| + | Out_String(" | ||
| + | Out_String(" | ||
| + | Out_String("# | ||
| + | Out_String(" | ||
| + | Out_String("# | ||
| + | phase_out phasename## | ||
| + | load out_record out_fmt out_eqn | ||
| + | { " | ||
| + | " | ||
| + | " | ||
| + | #endif | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Out_PRF === | ||
| + | The " | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ==== Application Example: Working .inp to export .mem and .prf files ==== | ||
| + | To use this function, please save the macros " | ||
| + | |||
| + | Below example .inp file will be executed twice automatically. | ||
| + | |||
| + | The first run performs conventional Rietveld refinement and export information for the measured hkls. | ||
| + | |||
| + | The second run exports Miller indexes of unmeasured d-spacing reflections of higher spacing resolution, down to 0.7 Angstrom. | ||
| + | |||
| + | <code topas> | ||
| + | num_runs 2 | ||
| + | |||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | #if (Run_Number == 0) | ||
| + | RAW(corundum) | ||
| + | do_errors | ||
| + | | ||
| + | | ||
| + | #else | ||
| + | | ||
| + | | ||
| + | | ||
| + | prm DMIN = #include DMIN.txt; | ||
| + | start_X = 2 ArcSin(Lam /2 /DMIN) Rad; ' | ||
| + | finish_X = 2 ArcSin(Lam /2 /0.7) Rad; 'The limit 0.7 Angstrom can be adapted according to your phase | ||
| + | #endif | ||
| + | |||
| + | Radius(173) | ||
| + | LP_Factor(26.6) | ||
| + | Full_Axial_Model(12, | ||
| + | Slit_Width(0.3) | ||
| + | Divergence(1) | ||
| + | |||
| + | Absorption(@, | ||
| + | ZE(@, | ||
| + | One_on_X(@, 1000) | ||
| + | bkg @ 0 0 0 0 0 0 | ||
| + | | ||
| + | STR(R_-3_C) | ||
| + | phase_name " | ||
| + | prm Total_e_in_Cell = Al_electrons + O_electrons;: | ||
| + | Trigonal(@ | ||
| + | site Al num_posns 0 x 0 y 0 z @ 0.35228`_0.00003 occ Al 1 beq @ 0.29860`_0.00866 prm Al_electrons =Get(num_posns) * Atomic_Number(" | ||
| + | site O num_posns 0 x @ 0.30607`_0.00014 y 0 z 0.25 occ O 1 beq @ 0.16724`_0.01427 prm O_electrons =Get(num_posns) * Atomic_Number(" | ||
| + | scale scf 0.00208062929`_5.482e-06 | ||
| + | CS_L(@, 274.753078`_7.43125129) | ||
| + | Strain_L(@, | ||
| + | r_bragg | ||
| + | |||
| + | |||
| + | | ||
| + | </ | ||
| + | |||
| + | N.B.: the number of reflections " | ||
| + | |||
| + | N.B.2: According to the Dysnomia examples, it seems do not need F_imaginary part for MEM analysis, therefore the imaginary part can be set to 0 in the generated .mem file. | ||
| + | |||
| + | N.B.3: Reflections of zero Fo(R) should be avoided, otherwise Dysnomia won't work. | ||
| + | |||
| + | If any user in our open TOPAS community has suggestion or idea, or bug report on these macros, please kindly let me know and I am happy to learn from you: [[tony.wang@qut.edu.au]] | ||
| + | |||
| + | Thanks for Dr. Koichi Momma' | ||