Changeset 2043
- Timestamp:
- Nov 11, 2015 10:19:17 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2034 r2043 1077 1077 DataType = Iparm['INS HTYPE '].strip()[:3] # take 1st 3 chars 1078 1078 # override inst values with values read from data file 1079 Bank = rd.powderentry[2] #should be used in multibank iparm files 1079 1080 if rd.instdict.get('type'): 1080 1081 DataType = rd.instdict.get('type') -
trunk/GSASIImath.py
r2041 r2043 1041 1041 Xmod = np.swapaxes(Xmod,1,2) 1042 1042 D = twopi*H[:,3][:,nxs]*glTau[nxs,:] #m*e*tau; ops X 32 1043 HdotX = twopi*np.inner(HP,Xmod) +D[:,nxs,:]#ops x atoms X 321043 HdotX = twopi*np.inner(HP,Xmod) #ops x atoms X 32 1044 1044 HdotXD = HdotX+D[:,nxs,:] 1045 HdotXA = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs] #ops x atoms x waves x 32 x xyz1046 HdotXB = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]1045 HdotXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs] #ops x atoms x waves x 32 x xyz 1046 HdotXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs] 1047 1047 if Af.shape[1]: 1048 1048 tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau #Fwaves x 32 … … 1079 1079 dHdXA = HP[:,nxs,nxs,nxs,:]*np.swapaxes(StauX,-1,-2)[nxs,:,:,:,:] #ops x atoms x waves x 32 x xyz 1080 1080 dHdXB = HP[:,nxs,nxs,nxs,:]*np.swapaxes(CtauX,-1,-2)[nxs,:,:,:,:] #ditto 1081 dGdMxCa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(- twopi*dHdXA*np.sin(twopi*HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)1082 dGdMxCb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(- twopi*dHdXB*np.sin(twopi*HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)1081 dGdMxCa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(-dHdXA*np.sin(HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2) 1082 dGdMxCb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(-dHdXB*np.sin(HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2) 1083 1083 dGdMxC = np.concatenate((dGdMxCa,dGdMxCb),axis=-1) 1084 1084 # ops x atoms x waves x xyz - real part 1085 dGdMxSa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*( twopi*dHdXA*np.cos(twopi*HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)1086 dGdMxSb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*( twopi*dHdXB*np.cos(twopi*HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)1085 dGdMxSa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.cos(HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2) 1086 dGdMxSb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.cos(HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2) 1087 1087 dGdMxS = np.concatenate((dGdMxSa,dGdMxSb),axis=-1) 1088 1088 # ops x atoms x waves x xyz - imaginary part -
trunk/GSASIIplot.py
r2040 r2043 1042 1042 global Ymax 1043 1043 plottype = plotType 1044 if not G2frame.PatternId: 1045 return 1044 1046 #patch 1045 1047 data = G2frame.PatternTree.GetItemPyData(G2frame.PatternId) … … 3116 3118 Title += ' map for atom '+atom[0]+ \ 3117 3119 ' at %.4f %.4f %.4f'%(atxyz[0],atxyz[1],atxyz[2]) 3118 ix = -np.array(np.rint(rhoSize[:3]*atxyz) ,dtype='i')3120 ix = -np.array(np.rint(rhoSize[:3]*atxyz)+1,dtype='i') 3119 3121 ix += (rhoSize[:3]/2) 3120 3122 ix = ix%rhoSize[:3] … … 3122 3124 ix = rhoSize[:3]/2 3123 3125 ib = 4 3126 hdx = [0,0,0] #this needs to be something for an offset correction on atom positions 3124 3127 if Ax == 'x': 3128 Doff = (hdx[0]+Off)*.005 3125 3129 slab = np.sum(np.sum(rho[:,ix[1]-ib:ix[1]+ib,ix[2]-ib:ix[2]+ib,:],axis=2),axis=1) 3126 3130 Plot.plot(tau,wave[0]) 3127 3131 elif Ax == 'y': 3132 Doff = (hdx[1]+Off)*.005 3128 3133 slab = np.sum(np.sum(rho[ix[0]-ib:ix[0]+ib,:,ix[2]-ib:ix[2]+ib,:],axis=2),axis=0) 3129 3134 Plot.plot(tau,wave[1]) 3130 3135 elif Ax == 'z': 3136 Doff = (hdx[2]+Off)*.005 3131 3137 slab = np.sum(np.sum(rho[ix[0]-ib:ix[0]+ib,ix[1]-ib:ix[1]+ib,:,:],axis=1),axis=0) 3132 3138 Plot.plot(tau,wave[2]) … … 3137 3143 acolor = mpl.cm.get_cmap('RdYlGn') 3138 3144 if 'delt' in MapType: 3139 Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+ Off*.005,.5+Off*.005),cmap=acolor)3145 Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Doff,.5+Doff),cmap=acolor) 3140 3146 else: 3141 Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+ Off*.005,.5+Off*.005))3147 Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Doff,.5+Doff)) 3142 3148 Page.canvas.draw() 3143 3149 -
trunk/imports/G2img_1TIF.py
r2042 r2043 21 21 import GSASIIIO as G2IO 22 22 import GSASIIpath 23 import numpy as np 23 24 GSASIIpath.SetVersionNumber("$Revision: $") 24 25 class TIF_ReaderClass(G2IO.ImportImage): … … 197 198 print 'Read CHESS-detector tiff file: ',filename 198 199 image = np.array(ar.array('L',File.read(4*Npix)),dtype=np.int32) 199 200 elif 270 in IFD: 201 File.seek(IFD[270][2][0]) 202 S = File.read(IFD[273][2][0]-IFD[270][2][0]) 203 if 'ImageJ' in S: 204 tifType = 'ImageJ' 205 dataType = 0 206 pixy = [200,200]*IFD[277][2][0] 207 File.seek(IFD[273][2][0]) 208 if not imageOnly: 209 print 'Read ImageJ tiff file: ',filename 210 image = ar.array('H',File.read(2*Npix)) 211 if '>' in byteOrd: 212 image.byteswap() 213 image = np.array(np.asarray(image,dtype='H'),dtype=np.int32) 200 214 elif 262 in IFD and IFD[262][2][0] > 4: 201 215 tifType = 'DND' … … 250 264 print 'Read 11-ID-C tiff file: ',filename 251 265 image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 252 elif IFD[273][2][0] == 168:253 tifType = 'ImageJ'254 dataType = 0255 pixy = [200,200]256 File.seek(IFD[273][2][0])257 if not imageOnly:258 print 'Read ImageJ tiff file: ',filename259 image = ar.array('H',File.read(2*Npix))260 if '>' in byteOrd:261 image.byteswap()262 image = np.array(np.asarray(image,dtype='H'),dtype=np.int32)263 266 264 267 elif sizexy == [4096,4096]:
Note: See TracChangeset
for help on using the changeset viewer.