Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
out_out_general_cif_test [2016/11/04 09:08]
johnsoevans created
out_out_general_cif_test [2016/11/07 18:27]
johnsoevans
Line 2: Line 2:
  
  
-The macros below come from Alex McLennan.  He developed them during his time in Liverpool and was going to release them to the community.  ​I've lost touch with him but have put the macros below in case they'​re useful for people.  ​I haven'​t tested the macros   If anybody is in touch with Alec could they let John Evans know?+The macros below come originally ​from Alex McLennan ​at Liverpool, with later input from Chris Collins ​and John Claridge.  ​Only known issue is with difc in multibank time of flight refinements.  ​Each bank can be output separately to get round this 
  
 <code topas> <code topas>
-macro CIF_Companion(phase_numberval,​ Z) 
-{ 
-local !phase_number phase_numberval 
-local !cell_formula_units_Z Z 
-} 
- 
 macro Out_General_CIF_test(file) macro Out_General_CIF_test(file)
 { {
   out file   out file
-  if Prm_There(cell_formula_units_Z) { + ​  ​  if Prm_There(cell_formula_units_Z) { 
-  } else { +     } else { 
-  local !cell_formula_units_Z 1 +     local !cell_formula_units_Z 1 
-  +     
-  if Prm_There(phase_number) { +     if Prm_There(phase_number) { 
-  } else { +     } else { 
-  local !phase_number 1 +     local !phase_number 1 
-  }+     }
    ​ Out_String("​data_overall"​)    ​ Out_String("​data_overall"​)
    ​ Out(Abs(Get(refine_ls_shift_on_su_max)),​ "​\n_refine_ls_shift/​su_max %3.4f"​) ​          ​ Out(Abs(Get(refine_ls_shift_on_su_max)),​ "​\n_refine_ls_shift/​su_max %3.4f"​) ​      
Line 62: Line 56:
  Out_FCFSXtal(file)  Out_FCFSXtal(file)
 } else { } else {
-    ​+    ​for xdds {
       Out_CIFSTR(file)       Out_CIFSTR(file)
-for xdds {+      }
  Out_CIFdata(file)  Out_CIFdata(file)
- } 
        ​        ​
 } }
Line 77: Line 70:
  } else {  } else {
  Out_String("​\n#######​Start of powder structure loop#######"​)  Out_String("​\n#######​Start of powder structure loop#######"​)
- ​ Out(phase_number,​ "​\ndata_phase_%V"​) ​    ​ + ​ Out(phase_number,​ "​\ndata_phase_%V"​) 
- Out(phase_number, "\n_pd_block_id phase_%V") +  Out(Get(sp_grp_char), "_%s") 
- Out(Get(sp_grp_char), "_%s")+  Out_String("​\nloop_ _pd_block_diffractogram_id\n"​)  
 +  Out(Get(xdd_path_name), "%s\n")
  Out_String("​\n_cell_measurement_temperature"​)  Out_String("​\n_cell_measurement_temperature"​)
  if Prm_There(Temperature) {  if Prm_There(Temperature) {
Line 85: Line 79:
     } else {     } else {
     Out_String("​ 298.15"​)     Out_String("​ 298.15"​)
-    }      +    }    ​   ​
-      Out(phase_number,​ "​\n_pd_phase_id %V") +
- Out_String("​\n_pd_phase_mass_%"​) +
-      Out(Get(weight_percent),​ " %V"​) ​  +
       }       }
         
Line 148: Line 139:
       local !chemical_formula_weight = Get(cell_mass)/​cell_formula_units_Z;: ​ 241.84175       local !chemical_formula_weight = Get(cell_mass)/​cell_formula_units_Z;: ​ 241.84175
       Out(chemical_formula_weight,​ "​\n_chemical_formula_weight %11.5f"​)       Out(chemical_formula_weight,​ "​\n_chemical_formula_weight %11.5f"​)
-         if Prm_There(adps) {+      '  ​if Obj_There(adps) {
          ​Out_String("​\nloop_"​) ​                  ​Out_String("​\nloop_"​) ​        
          ​Out_String("​\n_atom_site_aniso_label"​)          ​Out_String("​\n_atom_site_aniso_label"​)
Line 168: Line 159:
            ​ "​ %V\n" = Get_From_String(Get(current_atom),​ u23);            ​ "​ %V\n" = Get_From_String(Get(current_atom),​ u23);
                }                }
-               }+            ' ​  }
       if Obj_There(mag_sg) {             if Obj_There(mag_sg) {     
       out file append ​     ​       out file append ​     ​
Line 189: Line 180:
       out file append       out file append
       Out(Get(cif_bonds_angles),​ "​%s"​)       Out(Get(cif_bonds_angles),​ "​%s"​)
-      if Obj_There(scrysts) { 
-      } else { 
-      Out_String("​\nloop_ _pd_block_diffractogram_id\n"​) ​   
-      for xdds { 
-      Out(Get(xdd_path_name),​ "​%s\n"​) ​ 
-      }} 
          ​Out_String("​\n#######​End of Structure loop#######"​)          ​Out_String("​\n#######​End of Structure loop#######"​)
 } }
 } }
 macro  Out_CIFdata(file) ​ { macro  Out_CIFdata(file) ​ {
 +   for xdds {
 out file append out file append
  Out_String("​\n#######​Start of powder data loop#######"​)  Out_String("​\n#######​Start of powder data loop#######"​)
Line 247: Line 233:
       Out_String("​\n_pd_calc_method Rietveld"​)       Out_String("​\n_pd_calc_method Rietveld"​)
       if And(Obj_There(neutron),​ Obj_There(pk_xo)) {       if And(Obj_There(neutron),​ Obj_There(pk_xo)) {
 +      Out_String("​\n_pd_meas_scan_method tof")
       Out(two_theta,​ "​\n_pd_meas_2theta_fixed %1.5f",​ "​(%.9g)"​)       Out(two_theta,​ "​\n_pd_meas_2theta_fixed %1.5f",​ "​(%.9g)"​)
-      } else { +      } else {
    ​ Out(Get(start_X),​ "​\n_pd_proc_2theta_range_min %11.5f"​)    ​ Out(Get(start_X),​ "​\n_pd_proc_2theta_range_min %11.5f"​)
    ​ Out(Get(finish_X),​ "​\n_pd_proc_2theta_range_max %11.5f"​)    ​ Out(Get(finish_X),​ "​\n_pd_proc_2theta_range_max %11.5f"​)
Line 290: Line 277:
   " %11.5f\n"​ = If(Get(weighting) < 1, 1, Get(weighting));​   " %11.5f\n"​ = If(Get(weighting) < 1, 1, Get(weighting));​
   }   }
-  + 
-  ​  ​  out file append +      out file append 
-  ​  ​   Out_String("​\n#######​End of data loop#######"​) +       Out_String("​\n#######​End of data loop#######"​) 
- Out_String("​\nloop_"​) + Out_String("​\nloop_"​) 
-       Out_String("​\n_refln_index_h"​) +       Out_String("​\n_refln_index_h"​) 
-       Out_String("​\n_refln_index_k"​) +       Out_String("​\n_refln_index_k"​) 
-       Out_String("​\n_refln_index_l"​) +       Out_String("​\n_refln_index_l"​) 
-       Out_String("​\n_pd_refln_phase_id"​)  +       Out_String("​\n_pd_refln_phase_id"​)  
-       Out_String("​\n_refln_d_spacing"​) +       Out_String("​\n_refln_d_spacing"​) 
-       Out_String("​\n_refln_F_squared_calc"​) +       Out_String("​\n_refln_F_squared_calc"​) 
-       Out_String("​\n_refln_F_squared_meas"​) +       Out_String("​\n_refln_F_squared_meas"​) 
-       Out_String("​\n_refln_F_squared_sigma"​) +       Out_String("​\n_refln_F_squared_sigma"​) 
-       Out_String("​\n_refln_include_status\n"​)      +       Out_String("​\n_refln_include_status\n"​)      
-       for strs  +       for strs  
-       {  +       {  
-       phase_out file append +       phase_out file append 
-      ​  ​  load out_record out_fmt out_eqn +          load out_record out_fmt out_eqn 
-      ​  ​  {     ​  ​   +          {     ​  ​   
-      ​  ​     ​"​%4.0f"​ = H; +             ​"​%4.0f"​ = H; 
-      ​  ​     ​"​%4.0f"​ = K; +             ​"​%4.0f"​ = K; 
-      ​  ​     ​"​%4.0f"​ = L; +             ​"​%4.0f"​ = L; 
-      ​  ​     ​"​%4.0f"​ = phase_number;​  +             ​"​%4.0f"​ = phase_number;​  
-      ​  ​     ​" %11.5f" ​ = D_spacing;​ +             ​" %11.5f" ​ = D_spacing;​ 
-      ​  ​     ​" %11.5f"​ = I_no_scale_pks;​ +             ​" %11.5f"​ = I_no_scale_pks;​ 
-      ​  ​     ​" %11.5f"​ = Iobs_no_scale_pks;​ +             ​" %11.5f"​ = Iobs_no_scale_pks;​ 
-      ​  ​     ​" %4.5f o\n" = Iobs_no_scale_pks_err; ​                   ​+             ​" %4.5f o\n" = Iobs_no_scale_pks_err; ​                   ​
          }          }
       }                        }                 
Line 321: Line 308:
       Out_String("​\n#######​End of HKL loop#######"​)       Out_String("​\n#######​End of HKL loop#######"​)
 } }
-macro Out_FCFSXtal(file) +
-+
-out file append +
- Out_String("​\n#######​Start of FCF loop#######"​) +
- Out(Get(lam),​ "​\n_diffrn_radiation_wavelength %1.5f"​) +
- Out_String("​\nloop_"​) +
- Out_String("​\n_refln_d_spacing"​) +
- Out_String("​\n_refln_index_h"​) +
-      Out_String("​\n_refln_index_k"​) +
-      Out_String("​\n_refln_index_l"​)            +
-      Out_String("​\n_refln_F_squared_calc"​) +
-      Out_String("​\n_refln_F_squared_meas"​) +
-      Out_String("​\n_refln_F_squared_sigma"​) ​      +
-      Out_String("​\n_refln_include_status\n"​) +
- phase_out file append load out_record out_fmt out_eqn +
-+
- "​%11.5f" ​ = D_spacing;​ +
-     "​%4.0f"​ = H; +
- "​%4.0f"​ = K; +
- "​%4.0f"​ = L; +
- ' I_no_scale_pks +
- '​  ​ = Get(scale) Mobs (A01-B11)^2 + (B01+A11)^2;​ when ignore_differences_in_Friedel_pairs is NOT defined +
- '​  ​ = Get(scale) Mobs (A01^2 + B01^2 + A11^2 + B11^2); when ignore_differences_in_Friedel_pairs IS defined +
- ' If there are no scale_pks then: +
- ' ​  ​I_no_scale_pks = I_after_scale_pks = Ycalc +
- " %11.4f"​ = I_no_scale_pks;​ +
- " %11.4f"​ = I_after_scale_pks;​ +
- "​%10.2f o" = Iobs_no_scale_pks_err;​  +
-+
- out file append +
- Out_String("​\n#######​End of FCF loop#######"​) +
-}+
 </​code>​ </​code>​

Personal Tools