Changeset 4832 for trunk/GSASIIimage.py
- Timestamp:
- Mar 1, 2021 8:31:47 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r4830 r4832 1262 1262 return useMask 1263 1263 1264 def MakeGainMap(image,Ix,Iy 0,data,blkSize=128):1264 def MakeGainMap(image,Ix,Iy,data,blkSize=128): 1265 1265 import scipy.ndimage.filters as sdif 1266 Iy = sdif.gaussian_filter1d(Iy0,3.)1267 1266 Iy *= npcosd(Ix[:-1])**3 #undo parallax 1268 1267 Iy *= (1000./data['distance'])**2 #undo r^2 effect … … 1271 1270 Iy *= G2pwd.Oblique(data['Oblique'][0],Ix[:-1]) #undo penetration 1272 1271 IyInt = scint.interp1d(Ix[:-1],Iy[0],bounds_error=False) 1273 muT = data.get('SampleAbs',[0.0,''])[0]1274 1272 GainMap = np.zeros_like(image,dtype=float) 1275 1273 #do interpolation on all points - fills in the empty bins; leaves others the same … … 1284 1282 jFin = min(jBeg+blkSize,Nx) 1285 1283 TA = Make2ThetaAzimuthMap(data,(iBeg,iFin),(jBeg,jFin)) #2-theta & azimuth arrays & create position mask 1286 tabs = np.ones_like(TA[3])1287 if data.get('SampleAbs',[0.0,False])[1]:1288 if 'Cylind' in data['SampleShape']:1289 if 'horiz' in data['orientation']:1290 muR = muT*(1.+0.5*npsind(TA[0])*npsind(TA[1])**2) #adjust for additional thickness off sample normal1291 else: #vertical1292 muR = muT*(1.+0.5*npsind(TA[0])*npcosd(TA[1])**2)1293 tabs = G2pwd.Absorb(data['SampleShape'],muR,TA[1])1294 elif 'Fixed' in data['SampleShape']: #assumes flat plate sample normal to beam1295 tabs = G2pwd.Absorb('Fixed',muT,TA[1])1296 1284 Ipix = IyInt(TA[0]) 1297 GainMap[iBeg:iFin,jBeg:jFin] = image[iBeg:iFin,jBeg:jFin]/( tabs*Ipix*TA[3])1285 GainMap[iBeg:iFin,jBeg:jFin] = image[iBeg:iFin,jBeg:jFin]/(Ipix*TA[3]) 1298 1286 GainMap = np.nan_to_num(GainMap,1.0) 1299 1287 GainMap = sdif.gaussian_filter(GainMap,3.,order=0) … … 1356 1344 tam = MakeMaskMap(data,Masks,(iBeg,iFin),(jBeg,jFin),tamp) 1357 1345 times[0] += time.time()-t0 #apply masks 1358 1359 1346 t0 = time.time() 1360 1347 Block = image[iBeg:iFin,jBeg:jFin] #apply image spotmask here … … 1362 1349 tax = np.where(tax > LRazm[1],tax-360.,tax) #put azm inside limits if possible 1363 1350 tax = np.where(tax < LRazm[0],tax+360.,tax) 1364 if data.get('SampleAbs',[0.0, False])[1]:1351 if data.get('SampleAbs',[0.0,''])[1]: 1365 1352 if 'Cylind' in data['SampleShape']: 1366 if 'horiz' in data['orientation']: 1367 muR = muT*(1.+0.5*npsind(tax)*npsind(tay)**2) #adjust for additional thickness off sample normal 1368 else: #vertical 1369 muR = muT*(1.+0.5*npsind(tax)*npcosd(tay)**2) 1353 muR = muT*(1.+npsind(tax)**2/2.)/(npcosd(tay)) #adjust for additional thickness off sample normal 1370 1354 tabs = G2pwd.Absorb(data['SampleShape'],muR,tay) 1371 1355 elif 'Fixed' in data['SampleShape']: #assumes flat plate sample normal to beam
Note: See TracChangeset
for help on using the changeset viewer.