Changeset 4180
- Timestamp:
- Oct 16, 2019 3:46:52 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r4178 r4180 1073 1073 arcs = masks['Arcs'] 1074 1074 TA = np.dstack((ma.getdata(TA[1]),ma.getdata(TA[0]),ma.getdata(TA[2]),ma.getdata(TA[3]))) #azimuth, 2-theta, dist, pol 1075 tax,tay,tad,pol = np.dsplit(TA,4) #azimuth, 2-theta, dist**2/d0**2 1075 tax,tay,tad,pol = np.dsplit(TA,4) #azimuth, 2-theta, dist**2/d0**2, pol 1076 1076 for tth,thick in rings: 1077 1077 tam = ma.mask_or(tam.flatten(),ma.getmask(ma.masked_inside(tay.flatten(),max(0.01,tth-thick/2.),tth+thick/2.))) … … 1172 1172 jFin = min(jBeg+blkSize,Nx) 1173 1173 # next is most expensive step! 1174 1174 1175 t0 = time.time() 1175 1176 if useTA: … … 1177 1178 else: 1178 1179 TA = Make2ThetaAzimuthMap(data,(iBeg,iFin),(jBeg,jFin)) #2-theta & azimuth arrays & create position mask 1179 times[1] += time.time()-t0 1180 times[1] += time.time()-t0 #xy->th,azm 1181 1180 1182 t0 = time.time() 1181 1183 if useMask: … … 1183 1185 else: 1184 1186 tam = MakeMaskMap(data,Masks,(iBeg,iFin),(jBeg,jFin),tamp) 1187 times[0] += time.time()-t0 #apply masks 1188 1189 t0 = time.time() 1185 1190 Block = image[iBeg:iFin,jBeg:jFin] 1186 1191 tax,tay,taz,tad,tabs,pol = Fill2ThetaAzimuthMap(Masks,TA,tam,Block) #and apply masks 1187 # pol = TA[3].flatten() #G2pwd.Polarization(data['PolaVal'][0],tay,tax-90.)[0] #for pixel pola correction1188 times[0] += time.time()-t01189 t0 = time.time()1190 1192 tax = np.where(tax > LRazm[1],tax-360.,tax) #put azm inside limits if possible 1191 1193 tax = np.where(tax < LRazm[0],tax+360.,tax) … … 1200 1202 elif 'q' == data.get('binType','').lower(): 1201 1203 tay = 4.*np.pi*npsind(tay/2.)/data['wavelength'] 1202 times[2] += time.time()-t0 1204 times[2] += time.time()-t0 #fill map 1205 1203 1206 t0 = time.time() 1204 1207 taz = np.array((taz*tad/tabs),dtype='float32')/pol … … 1206 1209 NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz, 1207 1210 numAzms,numChans,LRazm,lutth,Dazm,dtth,NST,H0) 1208 times[3] += time.time()-t0 1211 times[3] += time.time()-t0 #binning 1209 1212 G2fil.G2Print('End integration loops') 1213 1210 1214 t0 = time.time() 1211 1215 #prepare masked arrays of bins with pixels for interpolation setup … … 1232 1236 if data['Oblique'][1]: 1233 1237 H0 /= G2pwd.Oblique(data['Oblique'][0],H2[:-1]) 1234 times[4] += time.time()-t0 1238 times[4] += time.time()-t0 #cleanup 1239 1235 1240 G2fil.G2Print ('Step times: \n apply masks %8.3fs xy->th,azm %8.3fs fill map %8.3fs \ 1236 1241 \n binning %8.3fs cleanup %8.3fs'%(times[0],times[1],times[2],times[3],times[4])) -
trunk/GSASIIimgGUI.py
r4109 r4180 150 150 ##### Image Controls 151 151 ################################################################################ 152 blkSize = 256 #256seems to be optimal; will break in polymask if >1024152 blkSize = 128 #128 seems to be optimal; will break in polymask if >1024 153 153 def UpdateImageControls(G2frame,data,masks,useTA=None,useMask=None,IntegrateOnly=False): 154 154 '''Shows and handles the controls on the "Image Controls"
Note: See TracChangeset
for help on using the changeset viewer.