Skip to content

Commit e967a6e

Browse files
committed
Address #192 where plot values are np.array not MaskedArray, but don't understand why it is happening
1 parent 4d22ade commit e967a6e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

GSASII/GSASIIpwdplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,13 +2429,13 @@ def onPartialConfig(event):
24292429
for i,item in enumerate(tbl):
24302430
if type(item) is dict: continue
24312431
if i in selectedPeaks:
2432-
Ni = N+1
2432+
#Ni = N+1
24332433
plotVline(Page,Plot,Lines,Parms,item[0],'yellow',False,'-')
24342434
Lines[-1].set_lw(Lines[-1].get_lw()+1)
24352435
plotVline(Page,Plot,Lines,Parms,item[0],color,True)
24362436
Lines[-1].set_lw(Lines[-1].get_lw()+1)
24372437
else:
2438-
Ni = N
2438+
#Ni = N
24392439
plotVline(Page,Plot,Lines,Parms,item[0],color,True)
24402440
except:
24412441
pass
@@ -3609,7 +3609,7 @@ def CopyRietveld2csv(Pattern,Plot,Page,filename):
36093609
DZ = (Pattern[1][1]-Pattern[1][3])*np.sqrt(wtFactor*Pattern[1][2])
36103610
valueList.append(DZ)
36113611

3612-
if sum(Pattern[1][0].mask): # are there are excluded points? If so, add them too
3612+
if hasattr(Pattern[1][0],'mask') and sum(Pattern[1][0].mask): # are there are excluded points? If so, add them too
36133613
lblList.append('excluded')
36143614
valueList.append(1*Pattern[1][0].mask)
36153615
lblList.append('Axis-limits')

tests/test_image.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ def test_image():
5656
x = plist[0].getdata('x')
5757
tt1,i1 = (x[233]+x[280])/2,sum(i[233:281])
5858
#print(tt1,i1)
59-
msg = 'Test 1st peak'
60-
assert abs(tt1 - 2.2695) < 0.0002, msg+f' pos ({tt1})'
61-
assert abs(i1 - 4656.698709171848) < 0.1, msg+f' intensity ({i1})'
59+
msg = 'Confirm 1st peak'
60+
assert abs(tt1 - 2.2695) < 0.0002, msg+' pos'
61+
assert abs(i1 - 4645.6850578694975) < 0.1, msg+' intensity'
6262
tt6,i6 = (x[780]+x[850])/2,sum(i[780:851])
6363
#print(tt6,i6)
64-
msg = 'Test 6th peak'
65-
assert abs(tt6 - 3.9450) < 0.0002, msg+f' pos ({tt6})'
66-
assert abs(i6 - 26423.739680809293) < 0.1, msg+f' intensity ({i6})'
64+
msg = 'Confirm 6th peak'
65+
assert abs(tt6 - 3.9450) < 0.0002, msg+' pos'
66+
assert abs(i6 - 26236.795563010724) < 0.1, msg+' intensity'
6767
print('OK')
6868

6969
def test_CBF():

0 commit comments

Comments
 (0)