Hi John,
This still didn't quite work for me at first. However I then modified the macro like this:
macro Out_CIF_mag(file) {
out file
Out_String("data_topas_output")
Out(Get(sp_grp_char), "\n\n_space_group_magn.number_BNS %s")
Out(Get(a), "\n_cell_length_a %V")
Out(Get(b), "\n_cell_length_b %V")
Out(Get(c), "\n_cell_length_c %V")
Out(Get(al), "\n_cell_angle_alpha %V")
Out(Get(be), "\n_cell_angle_beta %V")
Out(Get(ga), "\n_cell_angle_gamma %V")
Out_String("\n\nloop_")
Out_String("\n_magnetic_space_group_symop_id")
Out_String("\n_magnetic_space_group_symop_operation_xyz")
Out(Get(mag_sp_xyzs_txt_with_id), "%s")
Out_String("\n\nloop_")
Out_String("\n_atom_site_label")
Out_String("\n_atom_site_type_symbol")
Out_String("\n_atom_site_fract_x")
Out_String("\n_atom_site_fract_y")
Out_String("\n_atom_site_fract_z")
Out_String("\n_atom_site_occupancy")
Out_String("\n_atom_site_B_iso_or_equiv")
atom_out file append
load out_record out_fmt out_eqn
{
"\n%s" = Get_From_String(Get(current_atom), site);
" %s" = Get_From_String(Get(current_atom), atom);
" %V" = Get_From_String(Get(current_atom), x);
" %V" = Get_From_String(Get(current_atom), y);
" %V" = Get_From_String(Get(current_atom), z);
" %V" = Get_From_String(Get(current_atom), occ);
" %V" = Get_From_String(Get(current_atom), beq);
}
out file append
Out_String("\n\nloop_")
Out_String("\n_atom_site_moment.label")
Out_String("\n_atom_site_moment.crystalaxis_x")
Out_String("\n_atom_site_moment.crystalaxis_y")
Out_String("\n_atom_site_moment.crystalaxis_z")
atom_out file append
load out_record out_fmt out_eqn
{
"\n%s" = Get_From_String(Get(current_atom), site);
"%11.5f" = Get(a) Get_From_String(Get(current_atom), mlx);
"%11.5f" = Get(b) Get_From_String(Get(current_atom), mly);
"%11.5f" = Get(c) Get_From_String(Get(current_atom), mlz);
}
}
At that point, the fix suggested by Glen works.
The problem line is this one: Get(mag_sp_xyzs_txt_with_id)
If I could do some string manipulation I could fix this. I.e. in Python i would do string.replace("mx,my,mz,",",") and that would work. Do you know how to do string manipulation in Topas? Alternatively maybe there's another term like mag_sp_xyzs_txt_with_id which does not include the mx,my,mz but I have no idea how I would find it.