Changeset 2130
- Timestamp:
- Jan 21, 2016 1:56:45 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIpwdGUI.py
r2124 r2130 3240 3240 # G2frame.refTable[phaseName].SetCellBackgroundColour(r,7+im,wx.WHITE) 3241 3241 else: #PWDR 3242 if float(G2frame.refTable[phaseName].GetCellValue(r,12+im+it)) < 0.: 3243 G2frame.refTable[phaseName].SetCellBackgroundColour(r,12+im+it,wx.RED) 3242 if float(G2frame.refTable[phaseName].GetCellValue(r,12+im+itof)) < 0.: 3243 G2frame.refTable[phaseName].SetCellBackgroundColour(r,12+im+itof,wx.RED) 3244 if float(G2frame.refTable[phaseName].GetCellValue(r,3+im)) < 0: 3245 G2frame.refTable[phaseName].SetCellBackgroundColour(r,8+im,wx.RED) 3246 3244 3247 3245 3248 G2frame.RefList = phaseName … … 3248 3251 Status.SetStatusText('abs(DF)/sig > 10 red; > 3 yellow; twin < 0 (user rejected) red; twin=0 (sp. gp. absent) red') 3249 3252 else: 3250 Status.SetStatusText('Prfo < 0. in red ')3251 it = 03253 Status.SetStatusText('Prfo < 0. in red; if excluded Fosq in red & mul < 0') 3254 itof = 0 3252 3255 if HKLF: 3253 3256 im = data[1].get('Super',0) 3254 3257 else: 3255 3258 if 'T' in data[phaseName].get('Type',''): 3256 it = 33259 itof = 3 3257 3260 im = data[phaseName].get('Super',0) 3258 3261 # has this table already been displayed? … … 3263 3266 G2frame.refTable[phaseName].SetMargins(0,0) 3264 3267 G2frame.refTable[phaseName].AutoSizeColumns(False) 3265 setBackgroundColors(im,it )3268 setBackgroundColors(im,itof) 3266 3269 # raise the tab (needed for 1st use and from OnSelectPhase) 3267 3270 for PageNum in range(G2frame.dataDisplay.GetPageCount()): -
trunk/GSASIIstrMath.py
r2123 r2130 3102 3102 kRatio = parmDict[hfx+'I(L2)/I(L1)'] 3103 3103 x,y,w,yc,yb,yd = Histogram['Data'] 3104 xMask = ma.getmaskarray(x) 3104 3105 xB = np.searchsorted(x,Limits[0]) 3105 3106 xF = np.searchsorted(x,Limits[1]) … … 3124 3125 sumdFsq = 0.0 3125 3126 sumInt = 0.0 3127 nExcl = 0 3126 3128 for refl in refDict['RefList']: 3127 3129 if 'C' in calcControls[hfx+'histType']: … … 3132 3134 iFin2 = iFin 3133 3135 if not iBeg+iFin: #peak below low limit - skip peak 3136 continue 3137 if ma.all(xMask[iBeg:iFin]): #peak entirely masked - skip peak 3138 refl[3+im] *= -1 3139 nExcl += 1 3134 3140 continue 3135 3141 elif not iBeg-iFin: #peak above high limit - done … … 3153 3159 iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin)) 3154 3160 iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF)) 3161 if not iBeg+iFin: #peak below low limit - skip peak 3162 continue 3163 if ma.all(xMask[iBeg:iFin]): #peak entirely masked - skip peak 3164 refl[3+im] *= -1 3165 nExcl += 1 3166 continue 3167 elif not iBeg-iFin: #peak above high limit - done 3168 break 3155 3169 if iBeg < iFin: 3156 3170 yp[iBeg:iFin] = refl[11+im]*refl[9+im]*G2pwd.getEpsVoigt(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im],ma.getdata(x[iBeg:iFin])) #>90% of time spent here … … 3170 3184 Histogram['Residuals'][phfx+'Rf^2'] = 100. 3171 3185 Histogram['Residuals'][phfx+'sumInt'] = sumInt 3172 Histogram['Residuals'][phfx+'Nref'] = len(refDict['RefList']) 3186 Histogram['Residuals'][phfx+'Nref'] = len(refDict['RefList'])-nExcl 3173 3187 Histogram['Residuals']['hId'] = hId 3174 3188 elif 'HKLF' in histogram[:4]: … … 3376 3390 bakType = calcControls[hfx+'bakType'] 3377 3391 dMdv = np.zeros(shape=(len(varylist),len(x))) 3392 dMdv = ma.array(dMdv,mask=np.outer(np.ones(len(varylist)),ma.getmaskarray(x))) #x is a MaskedArray! 3378 3393 dMdb,dMddb,dMdpk = G2pwd.getBackgroundDerv(hfx,parmDict,bakType,calcControls[hfx+'histType'],x) 3379 3394 if hfx+'Back;0' in varylist: # for now assume that Back;x vars to not appear in constraints 3380 bBpos = varylist.index(hfx+'Back;0')3381 dMdv[bBpos:bBpos+len(dMdb)] = dMdb3395 bBpos = varylist.index(hfx+'Back;0') 3396 dMdv[bBpos:bBpos+len(dMdb)] += dMdb 3382 3397 names = [hfx+'DebyeA',hfx+'DebyeR',hfx+'DebyeU'] 3383 3398 for name in varylist: … … 3386 3401 parm = name[:int(name.rindex(';'))] 3387 3402 ip = names.index(parm) 3388 dMdv[varylist.index(name)] = dMddb[3*id+ip]3403 dMdv[varylist.index(name)] += dMddb[3*id+ip] 3389 3404 names = [hfx+'BkPkpos',hfx+'BkPkint',hfx+'BkPksig',hfx+'BkPkgam'] 3390 3405 for name in varylist: … … 3394 3409 if parm in names: 3395 3410 ip = names.index(parm) 3396 dMdv[varylist.index(name)] = dMdpk[4*id+ip]3411 dMdv[varylist.index(name)] += dMdpk[4*id+ip] 3397 3412 cw = np.diff(x) 3398 3413 cw = np.append(cw,cw[-1])
Note: See TracChangeset
for help on using the changeset viewer.