Warning: Trying to access array offset on value of type null in /home/site/wwwroot/lib/plugins/move/action/rename.php on line 42
Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/Action/Export.php on line 106
Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/Action/Export.php on line 106
Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/Action/Export.php on line 106
====== Macros to output .ins and .int files =====
The macros in this page are for TOPAS v7 to export .ins (instruction) file and .int (intensity, data) file to be further processed in [[https://jp-minerals.org/rietan/|RIETAN-FP]] software and its VENUS visualization system.
I have spent some time to teach myself Japanese and gone through most part of its manuals. The Maximum Entropy Method (an algorithm to refine 3D electron cloud in unit cell) could be useful in TOPAS community.
Compare to those derived from crystal structure model (Space group, unit cell, atomic positions), structure factors derived from 3D electron cloud may fit measured patterns better, especially in organic crystals containing covalent bonds. The visualization of 3D electron cloud is also promoted by recent trend of visualizing ion transfer channels in the research field of solid electrolyte etc.
However, not like TOPAS in which a simple refinement could be set within ~20 lines of .inp file, the template .ins file for RIETAN-FP (exported by VESTA) is 1000+ lines, which I find not very user friendly.
With below 2 macros, TOPAS v7 can output the experiment data in .int format and the instruction file .ins for RIETAN-FP to process (with some Ad hoc editing). Hopefully they can bridge these two software better.
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]]
==== To use the macros ====
Copy and paste the Out_Int and Out_Ins macros at the end of this page into your local.inc, restart TOPAS to make them in effect.
The Out_Ins macro has equations built in to carry as much info from TOPAS model to RIETAN-FP .ins file.
LP_Facotr needs a name !lpf; X-ray footprint length needs a name !FPlenght, if Variable Divergence Slit is used.
So far, they work for single phase refinement only (MEM is refining single phase anyway.)
To use them, place them at the end of the "str" of interest like below:
xdd
...
LP_Factor(!lpf,26.6)
[ lpsd_th2_angular_range_degrees 4 ]
[ lpsd_equitorial_divergence_degrees 1 ]
[ lpsd_equitorial_sample_length_mm !FPlength 20 ]
[ lpsd_beam_spill_correct_intensity 1 ]
...
str
...
phase_name "any_phasename"
...
Out_Ins(same_phase_name)
Out_Int(same_phase_name)
== Ad hoc editing ==
Since it is hard to export apostrophe and comma from TOPAS (they are required by RIETAN-FP), I have used '|' mark to represent apostrophe, and '$' to represent comma ',' in the two macros at the end.
Also the ions in RIETAN-FP are written like "Al3+", rather than "Al+3".
Below chstr_batch.bat file, using the string replacing program "chstr.exe" at the bottom of [[http://www.topas-academic.net/|Alan's website]] (Thanks Alan!) can batch change them into RIETAN-FP style.
chstr %1 "|" "'"
chstr %1 "$" ","
chstr %1 "H-1" "H-"
chstr %1 "Li+1" "Li+"
chstr %1 "Be+2" "Be2+"
chstr %1 "Cval" "C.v"
chstr %1 "O-1" "O-"
chstr %1 "O-2" "O2-"
chstr %1 "F-1" "F-"
chstr %1 "Na+1" "Na+"
chstr %1 "Mg+2" "Mg2+"
chstr %1 "Al+3" "Al3+"
chstr %1 "Siva" "Si.v"
chstr %1 "Si+4" "Si4+"
chstr %1 "Cl-1" "Cl-"
chstr %1 "K+1" "K+"
chstr %1 "Ca+2" "Ca2+"
chstr %1 "Sc+3" "Sc3+"
chstr %1 "Ti+2" "Ti2+"
chstr %1 "Ti+3" "Ti3+"
chstr %1 "Ti+4" "Ti4+"
chstr %1 "V+2" "V2+"
chstr %1 "V+3" "V3+"
chstr %1 "V+5" "V5+"
chstr %1 "Cr+2" "Cr2+"
chstr %1 "Cr+3" "Cr3+"
chstr %1 "Mn+2" "Mn2+"
chstr %1 "Mn+3" "Mn3+"
chstr %1 "Mn+4" "Mn4+"
chstr %1 "Fe+2" "Fe2+"
chstr %1 "Fe+3" "Fe3+"
chstr %1 "Co+2" "Co2+"
chstr %1 "Co+3" "Co3+"
chstr %1 "Ni+2" "Ni2+"
chstr %1 "Ni+3" "Ni3+"
chstr %1 "Cu+1" "Cu+"
chstr %1 "Cu+2" "Cu2+"
chstr %1 "Zn+2" "Zn2+"
chstr %1 "Ga+3" "Ga3+"
chstr %1 "Ge+4" "Ge4+"
chstr %1 "Br-1" "Br-"
chstr %1 "Rb+1" "Rb+"
chstr %1 "Sr+2" "Sr2+"
chstr %1 "Y+3" "Y3+"
chstr %1 "Zr+4" "Zr4+"
chstr %1 "Nb+3" "Nb3+"
chstr %1 "Nb+5" "Nb5+"
chstr %1 "Mo+3" "Mo3+"
chstr %1 "Mo+5" "Mo5+"
chstr %1 "Mo+6" "Mo6+"
chstr %1 "Ru+3" "Ru3+"
chstr %1 "Ru+4" "Ru4+"
chstr %1 "Rh+3" "Rh3+"
chstr %1 "Rh+4" "Rh4+"
chstr %1 "Pd+2" "Pd2+"
chstr %1 "Pd+4" "Pd4+"
chstr %1 "Ag+1" "Ag+"
chstr %1 "Ag+2" "Ag2+"
chstr %1 "Cd+2" "Cd2+"
chstr %1 "In+3" "In3+"
chstr %1 "Sn+2" "Sn2+"
chstr %1 "Sn+4" "Sn4+"
chstr %1 "Sb+3" "Sb3+"
chstr %1 "Sb+5" "Sb5+"
chstr %1 "I-1" "I-"
chstr %1 "Cs+1" "Cs+"
chstr %1 "Ba+2" "Ba2+"
chstr %1 "La+3" "La3+"
chstr %1 "Ce+3" "Ce3+"
chstr %1 "Ce+4" "Ce4+"
chstr %1 "Pr+3" "Pr3+"
chstr %1 "Pr+4" "Pr4+"
chstr %1 "Nd+3" "Nd3+"
chstr %1 "Pm+3" "Pm3+"
chstr %1 "Sm+3" "Sm3+"
chstr %1 "Eu+2" "Eu2+"
chstr %1 "Eu+3" "Eu3+"
chstr %1 "Gd+3" "Gd3+"
chstr %1 "Tb+3" "Tb3+"
chstr %1 "Dy+3" "Dy3+"
chstr %1 "Ho+3" "Ho3+"
chstr %1 "Er+3" "Er3+"
chstr %1 "Tm+3" "Tm3+"
chstr %1 "Yb+2" "Yb2+"
chstr %1 "Yb+3" "Yb3+"
chstr %1 "Lu+3" "Lu3+"
chstr %1 "Hf+4" "Hf4+"
chstr %1 "Ta+5" "Ta5+"
chstr %1 "W+6" "W6+"
chstr %1 "Os+4" "Os4+"
chstr %1 "Ir+3" "Ir3+"
chstr %1 "Ir+4" "Ir4+"
chstr %1 "Pt+2" "Pt2+"
chstr %1 "Pt+4" "Pt4+"
chstr %1 "Au+1" "Au+"
chstr %1 "Au+3" "Au3+"
chstr %1 "Hg+1" "Hg+"
chstr %1 "Hg+2" "Hg2+"
chstr %1 "Tl+1" "Tl+"
chstr %1 "Tl+3" "Tl3+"
chstr %1 "Pb+2" "Pb2+"
chstr %1 "Pb+4" "Pb4+"
chstr %1 "Bi+3" "Bi3+"
chstr %1 "Bi+5" "Bi5+"
chstr %1 "Ra+2" "Ra2+"
chstr %1 "Ac+3" "Ac3+"
chstr %1 "Th+4" "Th4+"
chstr %1 "U+3" "U3+"
chstr %1 "U+4" "U4+"
chstr %1 "U+6" "U6+"
chstr %1 "Np+3" "Np3+"
chstr %1 "Np+4" "Np4+"
chstr %1 "Np+6" "Np6+"
chstr %1 "Pu+3" "Pu3+"
chstr %1 "Pu+4" "Pu4+"
chstr %1 "Pu+6" "Pu6+"
Put the "chstr.exe" and above "chstr_batch.bat" in your working folder and use window prompt CMD to run C:\Working_folder\chstr_batch same_phase_name.ins
The final touch before the .ins file can be processed by RIETAN-FP is changing the space group number after "VNS1 =" and H-M mark after "HKLM1 =" from TOPAS style to RIETAN-FP style, so far I couldn't find a simple way to replace them automatically, as TOPAS allows very free input of space group marks.
==== The macros ====
=== Out_Int ===
macro Out_Int(phasename) {
xdd_sum NumData =1;:0
out phasename##.int append load out_record out_fmt out_eqn
{"GENERAL\n%5.0f\n" = NumData;
}
xdd_out phasename##.int append load out_record out_fmt out_eqn
{
"%6.3f " = X;
"%11.4f\n" = Yobs;
}
}
=== Out_Ins ===
https://drive.google.com/file/d/1Vj6ipNRB4HD-eSXx_Kuq-9lAYfurkFV1/view?usp=sharing