out_out_general_cif_test
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
out_out_general_cif_test [2016/11/07 18:27] – johnsoevans | out_out_general_cif_test [2022/11/03 15:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== General .cif Output ====== | ||
+ | |||
+ | The macros below come originally from Alex McLennan at Liverpool, with later input from Chris Collins and John Claridge. | ||
+ | |||
+ | <code topas> | ||
+ | macro Out_General_CIF_test(file) | ||
+ | { | ||
+ | out file | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Out_String(" | ||
+ | Out(Get(number_of_parameters), | ||
+ | if Obj_There(scrysts) { | ||
+ | Out((Get(gof)^2), | ||
+ | '' | ||
+ | xdd_sum !denominator = Abs(Sqrt(Yobs)); | ||
+ | xdd_sum !numerator = Abs(Abs(Sqrt(Yobs)) - Abs(Sqrt(Ycalc))); | ||
+ | prm Unweighted_r_factor_based_F = numerator/ denominator; | ||
+ | Out(Unweighted_r_factor_based_F, | ||
+ | Out(Get(r_wp), | ||
+ | } else { | ||
+ | Out_String(" | ||
+ | for xdds { | ||
+ | | ||
+ | } | ||
+ | | ||
+ | Out((Get(gof)^2), | ||
+ | Out(Get(r_p), | ||
+ | Out(Get(r_wp), | ||
+ | Out(Get(r_exp), | ||
+ | Out_String(" | ||
+ | for xdds { | ||
+ | for strs { | ||
+ | Out(phase_number, | ||
+ | Out(Get(sp_grp_char), | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | for xdds { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | |||
+ | if Obj_There(scrysts) { | ||
+ | | ||
+ | Out_FCFSXtal(file) | ||
+ | } else { | ||
+ | for xdds { | ||
+ | Out_CIFSTR(file) | ||
+ | } | ||
+ | Out_CIFdata(file) | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | macro Out_CIFSTR(file) { | ||
+ | out file append | ||
+ | for strs { | ||
+ | if Obj_There(scrysts) { | ||
+ | Out_String(" | ||
+ | } else { | ||
+ | Out_String(" | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Out_String(" | ||
+ | if Prm_There(Temperature) { | ||
+ | Out(Get(Temperature), | ||
+ | } else { | ||
+ | Out_String(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | Out(Get(a), | ||
+ | Out(Get(b), | ||
+ | Out(Get(c), | ||
+ | Out(Get(al), | ||
+ | Out(Get(be), | ||
+ | Out(Get(ga), | ||
+ | Out(Get(cell_volume), | ||
+ | if Obj_There(mag_sg) { | ||
+ | Out(Get(mag_sg), | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out(Get(mag_sp_xyzs_txt), | ||
+ | } else { | ||
+ | Out(Get(sp_grp_char), | ||
+ | Out_String(" | ||
+ | Out(Get(sp_xyzs_txt), | ||
+ | } | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | |||
+ | atom_out file append | ||
+ | load out_record out_fmt out_eqn | ||
+ | " %s" = Get_From_String(Get(current_atom), | ||
+ | " %3.0f\n" | ||
+ | } | ||
+ | out file append | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | out file append | ||
+ | local !density = ((1.6605402 Get(cell_mass)) / Get(cell_volume)); | ||
+ | Out(density, | ||
+ | Out(cell_formula_units_Z, | ||
+ | local !chemical_formula_weight = Get(cell_mass)/ | ||
+ | Out(chemical_formula_weight, | ||
+ | '' | ||
+ | | ||
+ | | ||
+ | | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | atom_out file append | ||
+ | load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | '' | ||
+ | if Obj_There(mag_sg) { | ||
+ | out file append | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | atom_out file append | ||
+ | load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } else { | ||
+ | } | ||
+ | |||
+ | out file append | ||
+ | Out(Get(cif_bonds_angles), | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | macro Out_CIFdata(file) | ||
+ | for xdds { | ||
+ | out file append | ||
+ | Out_String(" | ||
+ | Out(Get(xdd_path_name), | ||
+ | Out(Get(xdd_path_name), | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | for strs | ||
+ | { | ||
+ | Out(phase_number, | ||
+ | Out(phase_number, | ||
+ | Out(Get(sp_grp_char), | ||
+ | Out(Get(weight_percent), | ||
+ | } | ||
+ | if Obj_There(neutron) { | ||
+ | } else { | ||
+ | local !Mu = Get(mixture_MAC) Get(mixture_density_g_on_cm3); | ||
+ | Out(Mu, " | ||
+ | } | ||
+ | if And(Obj_There(neutron), | ||
+ | } else { | ||
+ | Out(Get(lam), | ||
+ | if Prm_There(LP_Factorval){ | ||
+ | Out(LP_Factorval, | ||
+ | } | ||
+ | } | ||
+ | if Obj_There(neutron) { | ||
+ | Out_String(" | ||
+ | } else { | ||
+ | Out_String(" | ||
+ | } | ||
+ | if Obj_There(scrysts) { | ||
+ | Out((Get(gof)^2), | ||
+ | '' | ||
+ | xdd_sum !denominator = Sqrt(Yobs); | ||
+ | xdd_sum !numerator = Abs(Sqrt(Yobs) - Sqrt(Ycalc)); | ||
+ | prm Unweighted_r_factor_based_F = numerator/ denominator; | ||
+ | Out(Unweighted_r_factor_based_F, | ||
+ | Out(Get(r_wp), | ||
+ | } else { | ||
+ | Out((Get(gof)^2), | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | Out_String(" | ||
+ | if And(Obj_There(neutron), | ||
+ | Out_String(" | ||
+ | Out(two_theta, | ||
+ | } else { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | if And(Obj_There(neutron), | ||
+ | Out_String(" | ||
+ | | ||
+ | | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | xdd_out file append | ||
+ | load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | " %11.5f" | ||
+ | " %11.5f" | ||
+ | " %11.5f" | ||
+ | " | ||
+ | " %11.5f" | ||
+ | " %11.5f\n" | ||
+ | } | ||
+ | } else { | ||
+ | Out_String(" | ||
+ | | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | Out_String(" | ||
+ | xdd_out file append | ||
+ | load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | " %11.5f" | ||
+ | " %11.5f" | ||
+ | " %11.5f" | ||
+ | " | ||
+ | " %11.5f" | ||
+ | " %11.5f\n" | ||
+ | } | ||
+ | } | ||
+ | out file append | ||
+ | | ||
+ | Out_String(" | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | for strs | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | out file append | ||
+ | Out_String(" | ||
+ | } | ||
+ | |||
+ | </ |