Changeset 1012 for trunk/exports
- Timestamp:
- Jul 31, 2013 9:25:27 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2cif.py
r1010 r1012 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 #G2cif 4 ########### SVN repository information ################### 5 # $Date: 2013-07-22 20:57:37 -0500 (Mon, 22 Jul 2013) $ 6 # $Author: toby $ 7 # $Revision: 1006 $ 8 # $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/exports/G2cif.py $ 9 # $Id: G2cif.py 1006 2013-07-23 01:57:37Z toby $ 10 ########### SVN repository information ################### 1 11 '''Development code to export a GSAS-II project as a CIF 2 12 The heavy lifting is done in method export … … 8 18 import os.path 9 19 import numpy as np 20 import GSASIIpath 21 GSASIIpath.SetVersionNumber("$Revision: 1006 $") 10 22 import GSASIIIO as G2IO 11 23 #reload(G2IO) … … 19 31 import GSASIIspc as G2spg 20 32 #reload(G2spg) 33 34 DEBUG = True #True to skip printing of reflection/powder profile lists 21 35 22 36 def getCallerDocString(): # for development … … 243 257 string description. Will only be called on PWDR histograms 244 258 ''' 245 #print instparmdict[0].keys() 246 return 'TODO: Instrument profile goes here' 259 s = '' 260 inst = instparmdict[0] 261 if 'C' in inst['Type'][0]: 262 s = 'Finger-Cox-Jephcoat function parameters U, V, W, X, Y, SH/L:\n ' 263 for item in ['U','V','W','X','Y','SH/L']: 264 s += G2mth.ValEsd(inst[item][1],-.009)+', ' 265 elif 'T' in inst['Type'][0]: #to be tested after TOF Rietveld done 266 s = 'Von Dreele-Jorgenson-Windsor function parameters\n'+ \ 267 ' alpha, beta-0, beta-1, beta-q, sig-0, sig-1, sig-q, X, Y:\n ' 268 for item in ['alpha','bet-0','bet-1','bet-q','sig-0','sig-1','sig-q','X','Y']: 269 s += G2mth.ValEsd(inst[item][1],-.009)+', ' 270 return s 247 271 248 272 def FormatPhaseProfile(phasenam): … … 709 733 if not oneblock: # instrumental profile terms go here 710 734 WriteCIFitem('_pd_proc_ls_profile_function', 711 735 FormatInstProfile(histblk["Instrument Parameters"])) 712 736 713 737 #refprx = '_refln.' # mm … … 749 773 refcount += len(histblk['Reflection Lists'][phasenam]) 750 774 for ref in histblk['Reflection Lists'][phasenam]: 775 if DEBUG: 776 print 'DEBUG: skip reflection list' 777 break 751 778 if hklmin is None: 752 779 hklmin = ref[0:3] … … 832 859 histblk['Data'][3], 833 860 histblk['Data'][4]): 861 if DEBUG: 862 print 'DEBUG: skip reflection list' 863 break 834 864 if fixedstep: 835 865 s = "" … … 1164 1194 # report instrumental profile terms 1165 1195 WriteCIFitem('_pd_proc_ls_profile_function', 1166 FormatInstProfile(histblk["Instrument Parameters"])) 1167 WriteCIFitem('# Information for histogram '+str(i)+': '+ 1168 hist) 1196 FormatInstProfile(histblk["Instrument Parameters"])) 1197 WriteCIFitem('# Information for histogram '+str(i)+': '+hist) 1169 1198 WriteCIFitem('_pd_block_id',datablockidDict[hist]) 1170 1199 WritePowderTemplate() … … 1176 1205 WriteCIFitem('\ndata_'+self.CIFname+"_sx_"+str(i)) 1177 1206 #instnam = histblk["Instrument Parameters"][0]['InstrName'] 1178 WriteCIFitem('# Information for histogram '+str(i)+': '+ 1179 hist) 1207 WriteCIFitem('# Information for histogram '+str(i)+': '+hist) 1180 1208 WriteCIFitem('_pd_block_id',datablockidDict[hist]) 1181 1209 WriteSnglXtalTemplate()
Note: See TracChangeset
for help on using the changeset viewer.