Skip to content

Commit

Permalink
Merge pull request #2802 from jtkrogel/nx_fix_qmca_numpy
Browse files Browse the repository at this point in the history
Nexus: fix module overwrite bug in qmca
  • Loading branch information
ye-luo authored Nov 24, 2020
2 parents 7b5a20c + 9986669 commit 3346eb1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions nexus/bin/qmca
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,12 @@ QMCA examples:
adata = obj()
ns=0
for series in serieslist:
np = 0
npf = 0
for prefix in sorted(data.keys()):
pdata = data[prefix]
w = weights[np]
w = weights[npf]
d = pdata[series]
if np==0:
if npf==0:
avg = d.copy()
di = d.info
avg.info.set(
Expand All @@ -1235,7 +1235,7 @@ QMCA examples:
avg.zero()
#end if
avg.accumulate(d,w)
np+=1
npf+=1
#end for
avg.normalize()
file_list.append(avg.info.filepath)
Expand Down Expand Up @@ -1277,12 +1277,12 @@ QMCA examples:
#end if
#end if
for series in serieslist:
np = 0
npf = 0
for prefix in sorted(prefixes):
pdata = data[prefix]
w = weights[np]
w = weights[npf]
d = pdata[series]
if np==0:
if npf==0:
avg = d.copy()
di = d.info
avg.info.set(
Expand All @@ -1294,7 +1294,7 @@ QMCA examples:
avg.zero()
#end if
avg.accumulate(d,w)
np+=1
npf+=1
#end for
avg.normalize()
file_list.append(avg.info.filepath)
Expand Down Expand Up @@ -1433,11 +1433,11 @@ QMCA examples:
for quantity in quantities:
for mode in range(len(modes)):
if modes[mode]:
np = 0
npf = 0
for prefix in prefix_list:
first_prefix = np==0
last_prefix = np==len(self.data)-1
np+=1
first_prefix = npf==0
last_prefix = npf==len(self.data)-1
npf+=1
if first_prefix or not opt.overlay:
fig = plt.figure()
ax = fig.add_subplot(111)
Expand Down

0 comments on commit 3346eb1

Please sign in to comment.