Changeset 4067
 Timestamp:
 Jul 18, 2019 8:40:48 AM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIplot.py
r4066 r4067 3015 3015 NoffY = offsetY*(NmaxN) 3016 3016 if Pattern[1] is None: continue # skip over uncomputed simulations 3017 xye = np.array(ma.getdata(Pattern[1])) # strips mask 3017 xye = np.array(ma.getdata(Pattern[1])) # strips mask = X,Yo,W,Yc,Yb,Yd 3018 3018 xye0 = Pattern[1][0] # keeps mask 3019 #bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)3020 3019 if PickId: 3021 3020 ifpicked = Pattern[2] == G2frame.GPXtree.GetItemText(PatternId) … … 3024 3023 # recompute mask from excluded regions, in case they have changed 3025 3024 excls = limits[2:] 3026 # xye0 = ma.masked_outside(xye0,limits[0],limits[1],copy=False)3027 3025 for excl in excls: 3028 3026 xye0 = ma.masked_inside(xye[0],excl[0],excl[1],copy=False) #excluded region mask 3029 # Pattern[1][0] = ma.array(Pattern[1][0],mask=ma.getmask(xye0)) #save the excluded region masking3030 3027 if not G2frame.Contour: 3031 3028 xye0 = ma.masked_outside(xye[0],limits[1][0],limits[1][1],copy=False) #now mask for limits … … 3089 3086 multArray = ma.getdata(multArray) 3090 3087 if 'PWDR' in plottype: 3091 YI = copy.copy(xye[1]) 3088 YI = copy.copy(xye[1]) #yo 3092 3089 if G2frame.SubBack: 3093 YI = xye[ 5]3090 YI = xye[4] #background 3094 3091 if Page.plotStyle['sqrtPlot']: 3095 3092 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error … … 3097 3094 np.seterr(invalid=olderr['invalid']) 3098 3095 elif Page.plotStyle.get('WgtDiagnostic',False): 3099 Y = xye[1]*xye[2] 3096 Y = xye[1]*xye[2] #Yobs*wt 3100 3097 elif 'PWDR' in plottype and G2frame.SinglePlot and not \ 3101 3098 (Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour): … … 3105 3102 elif plottype in ['SASD','REFD']: 3106 3103 if plottype == 'SASD': 3107 B = xye[5] 3104 B = xye[5] #Yo  Yc 3108 3105 else: 3109 3106 B = np.zeros_like(xye[5]) … … 3159 3156 Ifin = np.searchsorted(X,limits[1][1]) 3160 3157 if ifpicked: 3158 ZI = copy.copy(xye[3]) #Yc 3161 3159 if Page.plotStyle['sqrtPlot']: 3162 3160 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 3163 ZI = copy.copy(xye[3])3164 if G2frame.SubBack:3165 ZI = xye[5]3166 3161 Z = np.where(ZI>=0.,np.sqrt(ZI),np.sqrt(ZI)) 3167 3162 np.seterr(invalid=olderr['invalid']) … … 3169 3164 if 'PWDR' in plottype and G2frame.SinglePlot and not ( 3170 3165 Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour): 3171 Z = xye[3]*multArray+NoffY*Ymax/100.03166 Z = ZI*multArray+NoffY*Ymax/100.0 #yc 3172 3167 else: 3173 Z = xye[3]+NoffY*Ymax/100.03168 Z = ZI+NoffY*Ymax/100.0 #yc 3174 3169 if 'PWDR' in plottype: 3175 3170 if Page.plotStyle['sqrtPlot']: 3176 3171 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 3177 W = np.where(xye[4]>=0.,np.sqrt(xye[4]),np.sqrt(xye[4])) 3172 W = np.where(xye[4]>=0.,np.sqrt(xye[4]),np.sqrt(xye[4])) #yb 3178 3173 np.seterr(invalid=olderr['invalid']) 3179 3174 D = np.where(xye[5],(YZ),0.)Page.plotStyle['delOffset'] … … 3182 3177 elif G2frame.SinglePlot and not ( 3183 3178 Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour): 3184 W = xye[4]*multArray+NoffY*Ymax/100.0 3185 D = multArray*xye[5]Page.plotStyle['delOffset'] # powder background3179 W = xye[4]*multArray+NoffY*Ymax/100.0 #yb 3180 D = multArray*xye[5]Page.plotStyle['delOffset'] #YoYc 3186 3181 else: 3187 W = xye[4]+NoffY*Ymax/100.0 3188 D = xye[5]Page.plotStyle['delOffset'] # powder background3182 W = xye[4]+NoffY*Ymax/100.0 #yb 3183 D = xye[5]Page.plotStyle['delOffset'] #YoYc 3189 3184 elif plottype in ['SASD','REFD']: 3190 3185 if Page.plotStyle['sqPlot']: 3191 W = xye[4]*X**4 3192 Z = xye[3]*X**4 3193 B = B*X**4 3186 W = xye[4]*X**4 #Yb 3187 Z = xye[3]*X**4 #Yc 3188 B = B*X**4 #(yoYc)*x**4 3194 3189 else: 3195 W = xye[4] 3190 W = xye[4] #Yb 3196 3191 if G2frame.SubBack: 3197 3192 YB = YB … … 3246 3241 if G2frame.SubBack: 3247 3242 if 'PWDR' in plottype: 3248 ObsLine = Plot.plot(Xum,Y W,colors[0]+pP,picker=False,clip_on=Clip_on,label='_obs') #IoIb3243 ObsLine = Plot.plot(Xum,Y,colors[0]+pP,picker=False,clip_on=Clip_on,label='_obs') #IoIb 3249 3244 CalcLine = Plot.plot(X,ZW,colors[1],picker=False,label='_calc') #IcIb 3250 3245 else: … … 3306 3301 if Page.plotStyle['logPlot'] and 'PWDR' in plottype: 3307 3302 Plot.set_ylim(bottom=np.min(np.trim_zeros(Y))/2.,top=np.max(Y)*2.) 3308 # if not G2frame.SinglePlot and not G2frame.Contour:3309 # axcb = mpl.colorbar.ColorbarBase(N)3310 # axcb.set_label('PDF number')3311 3303 if timeDebug: 3312 3304 print('plot fill time: %.3f'%(time.time()time0))
Note: See TracChangeset
for help on using the changeset viewer.