Changeset 1117 for trunk/exports/G2export_CIF.py
- Timestamp:
- Oct 21, 2013 1:11:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2export_CIF.py
r1115 r1117 489 489 WriteCIFitem('\n# ATOMIC COORDINATES AND DISPLACEMENT PARAMETERS') 490 490 WriteCIFitem('loop_ '+ 491 '\n \t_atom_site_label'+492 '\n \t_atom_site_type_symbol'+493 '\n \t_atom_site_fract_x'+494 '\n \t_atom_site_fract_y'+495 '\n \t_atom_site_fract_z'+496 '\n \t_atom_site_occupancy'+497 '\n \t_atom_site_adp_type'+498 '\n \t_atom_site_U_iso_or_equiv'+499 '\n \t_atom_site_symmetry_multiplicity')491 '\n _atom_site_label'+ 492 '\n _atom_site_type_symbol'+ 493 '\n _atom_site_fract_x'+ 494 '\n _atom_site_fract_y'+ 495 '\n _atom_site_fract_z'+ 496 '\n _atom_site_occupancy'+ 497 '\n _atom_site_adp_type'+ 498 '\n _atom_site_U_iso_or_equiv'+ 499 '\n _atom_site_symmetry_multiplicity') 500 500 501 501 varnames = {cx:'Ax',cx+1:'Ay',cx+2:'Az',cx+3:'Afrac', … … 554 554 if naniso == 0: return 555 555 # now loop over aniso atoms 556 WriteCIFitem('\nloop_' + '\n \t_atom_site_aniso_label' +557 '\n \t_atom_site_aniso_U_11' + '\n\t_atom_site_aniso_U_12' +558 '\n \t_atom_site_aniso_U_13' + '\n\t_atom_site_aniso_U_22' +559 '\n \t_atom_site_aniso_U_23' + '\n\t_atom_site_aniso_U_33')556 WriteCIFitem('\nloop_' + '\n _atom_site_aniso_label' + 557 '\n _atom_site_aniso_U_11' + '\n _atom_site_aniso_U_12' + 558 '\n _atom_site_aniso_U_13' + '\n _atom_site_aniso_U_22' + 559 '\n _atom_site_aniso_U_23' + '\n _atom_site_aniso_U_33') 560 560 for i,at in enumerate(Atoms): 561 561 fval = self.parmDict.get(fpfx+str(i),at[cfrac]) … … 734 734 WriteCIFitem('\n# MOLECULAR GEOMETRY') 735 735 WriteCIFitem('loop_' + 736 '\n \t_geom_bond_atom_site_label_1' +737 '\n \t_geom_bond_atom_site_label_2' +738 '\n \t_geom_bond_distance' +739 '\n \t_geom_bond_site_symmetry_1' +740 '\n \t_geom_bond_site_symmetry_2' +741 '\n \t_geom_bond_publ_flag')736 '\n _geom_bond_atom_site_label_1' + 737 '\n _geom_bond_atom_site_label_2' + 738 '\n _geom_bond_distance' + 739 '\n _geom_bond_site_symmetry_1' + 740 '\n _geom_bond_site_symmetry_2' + 741 '\n _geom_bond_publ_flag') 742 742 743 743 for i in sorted(AtomLabels.keys()): … … 760 760 # loop over interatomic angles for this phase 761 761 WriteCIFitem('\nloop_' + 762 '\n \t_geom_angle_atom_site_label_1' +763 '\n \t_geom_angle_atom_site_label_2' +764 '\n \t_geom_angle_atom_site_label_3' +765 '\n \t_geom_angle' +766 '\n \t_geom_angle_site_symmetry_1' +767 '\n \t_geom_angle_site_symmetry_2' +768 '\n \t_geom_angle_site_symmetry_3' +769 '\n \t_geom_angle_publ_flag')762 '\n _geom_angle_atom_site_label_1' + 763 '\n _geom_angle_atom_site_label_2' + 764 '\n _geom_angle_atom_site_label_3' + 765 '\n _geom_angle' + 766 '\n _geom_angle_site_symmetry_1' + 767 '\n _geom_angle_site_symmetry_2' + 768 '\n _geom_angle_site_symmetry_3' + 769 '\n _geom_angle_publ_flag') 770 770 771 771 for i in sorted(AtomLabels.keys()): … … 797 797 phasedict = self.Phases[phasenam] # pointer to current phase info 798 798 WriteCIFitem('_pd_phase_name', phasenam) 799 pfx = str(phasedict['pId'])+'::' 800 A,sigA = G2stIO.cellFill(pfx,phasedict['General']['SGData'],self.parmDict,self.sigDict) 801 cellSig = G2stIO.getCellEsd(pfx, 802 phasedict['General']['SGData'],A, 803 self.OverallParms['Covariance']) # returns 7 vals, includes sigVol 804 cellList = G2lat.A2cell(A) + (G2lat.calc_V(A),) 799 cellList,cellSig = self.GetCell(phasenam) 805 800 defsigL = 3*[-0.00001] + 3*[-0.001] + [-0.01] # significance to use when no sigma 806 801 names = ['length_a','length_b','length_c', … … 899 894 WriteCIFitem('_diffrn_radiation_type','K\\a~1,2~') 900 895 WriteCIFitem('loop_' + 901 '\n \t_diffrn_radiation_wavelength' +902 '\n \t_diffrn_radiation_wavelength_wt' +903 '\n \t_diffrn_radiation_wavelength_id')896 '\n _diffrn_radiation_wavelength' + 897 '\n _diffrn_radiation_wavelength_wt' + 898 '\n _diffrn_radiation_wavelength_id') 904 899 WriteCIFitem(' ' + PutInCol(G2mth.ValEsd(lam1,slam1),15)+ 905 900 PutInCol('1.0',15) + … … 919 914 WriteCIFitem('\n# PHASE TABLE') 920 915 WriteCIFitem('loop_' + 921 '\n \t_pd_phase_id' +922 '\n \t_pd_phase_block_id' +923 '\n \t_pd_phase_mass_%')916 '\n _pd_phase_id' + 917 '\n _pd_phase_block_id' + 918 '\n _pd_phase_mass_%') 924 919 wtFrSum = 0. 925 920 for phasenam in phasebyhistDict.get(histlbl): … … 944 939 ) 945 940 WriteCIFitem('loop_' + 946 '\n \t_gsas_proc_phase_R_F_factor' +947 '\n \t_gsas_proc_phase_R_Fsqd_factor' +948 '\n \t_gsas_proc_phase_id' +949 '\n \t_gsas_proc_phase_block_id')941 '\n _gsas_proc_phase_R_F_factor' + 942 '\n _gsas_proc_phase_R_Fsqd_factor' + 943 '\n _gsas_proc_phase_id' + 944 '\n _gsas_proc_phase_block_id') 950 945 for phasenam in phasebyhistDict.get(histlbl): 951 946 pfx = str(self.Phases[phasenam]['pId'])+':'+str(hId)+':' … … 1026 1021 WriteCIFitem('loop_') 1027 1022 if len(histblk['Reflection Lists'].keys()) > 1: 1028 WriteCIFitem(' \t_pd_refln_phase_id')1029 WriteCIFitem(' \t' + refprx + 'index_h' +1030 '\n \t' + refprx + 'index_k' +1031 '\n \t' + refprx + 'index_l' +1032 '\n \t' + refprx + 'F_squared_meas' +1033 '\n \t' + refprx + 'F_squared_calc' +1034 '\n \t' + refprx + 'phase_calc' +1035 '\n \t_pd_refln_d_spacing')1023 WriteCIFitem(' _pd_refln_phase_id') 1024 WriteCIFitem(' ' + refprx + 'index_h' + 1025 '\n ' + refprx + 'index_k' + 1026 '\n ' + refprx + 'index_l' + 1027 '\n ' + refprx + 'F_squared_meas' + 1028 '\n ' + refprx + 'F_squared_calc' + 1029 '\n ' + refprx + 'phase_calc' + 1030 '\n _pd_refln_d_spacing') 1036 1031 if Imax > 0: 1037 WriteCIFitem(' \t_gsas_i100_meas')1032 WriteCIFitem(' _gsas_i100_meas') 1038 1033 1039 1034 refcount = 0 … … 1101 1096 WriteCIFitem('_pd_meas_number_of_points', str(len(histblk['Data'][0]))) 1102 1097 WriteCIFitem('\nloop_') 1103 # WriteCIFitem(' \t_pd_proc_d_spacing') # need easy way to get this1098 # WriteCIFitem(' _pd_proc_d_spacing') # need easy way to get this 1104 1099 if not fixedstep: 1105 1100 if zero: 1106 WriteCIFitem(' \t_pd_proc_2theta_corrected')1101 WriteCIFitem(' _pd_proc_2theta_corrected') 1107 1102 else: 1108 WriteCIFitem(' \t_pd_meas_2theta_scan')1103 WriteCIFitem(' _pd_meas_2theta_scan') 1109 1104 # at least for now, always report weights. 1110 1105 #if countsdata: 1111 # WriteCIFitem(' \t_pd_meas_counts_total')1106 # WriteCIFitem(' _pd_meas_counts_total') 1112 1107 #else: 1113 WriteCIFitem(' \t_pd_meas_intensity_total')1114 WriteCIFitem(' \t_pd_calc_intensity_total')1115 WriteCIFitem(' \t_pd_proc_intensity_bkg_calc')1116 WriteCIFitem(' \t_pd_proc_ls_weight')1108 WriteCIFitem(' _pd_meas_intensity_total') 1109 WriteCIFitem(' _pd_calc_intensity_total') 1110 WriteCIFitem(' _pd_proc_intensity_bkg_calc') 1111 WriteCIFitem(' _pd_proc_ls_weight') 1117 1112 maxY = max(histblk['Data'][1].max(),histblk['Data'][3].max()) 1118 1113 if maxY < 0: maxY *= -10 # this should never happen, but... … … 1154 1149 WriteCIFitem('\n# STRUCTURE FACTOR TABLE') 1155 1150 WriteCIFitem('loop_' + 1156 '\n \t' + refprx + 'index_h' +1157 '\n \t' + refprx + 'index_k' +1158 '\n \t' + refprx + 'index_l' +1159 '\n \t' + refprx + 'F_squared_meas' +1160 '\n \t' + refprx + 'F_squared_sigma' +1161 '\n \t' + refprx + 'F_squared_calc' +1162 '\n \t' + refprx + 'phase_calc'1151 '\n ' + refprx + 'index_h' + 1152 '\n ' + refprx + 'index_k' + 1153 '\n ' + refprx + 'index_l' + 1154 '\n ' + refprx + 'F_squared_meas' + 1155 '\n ' + refprx + 'F_squared_sigma' + 1156 '\n ' + refprx + 'F_squared_calc' + 1157 '\n ' + refprx + 'phase_calc' 1163 1158 ) 1164 1159
Note: See TracChangeset
for help on using the changeset viewer.