Skip to content

Commit 50e9f7d

Browse files
committed
fix for usage of frame masks in new polymask - needs to be list of frame(s)
1 parent eb224e6 commit 50e9f7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

GSASII/GSASIIimage.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ def EdgeFinder(image,data):
699699
return zip(tax,tay)
700700

701701
def CalcRings(G2frame,ImageZ,data,masks):
702+
''' Not used anywhere?'''
702703
pixelSize = data['pixelSize']
703704
scalex = 1000./pixelSize[0]
704705
scaley = 1000./pixelSize[1]
@@ -733,7 +734,7 @@ def CalcRings(G2frame,ImageZ,data,masks):
733734
frame = masks['Frames']
734735
tam = ma.make_mask_none(ImageZ.shape)
735736
if frame:
736-
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(data,frame)-255)))
737+
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(data,[frame,])-255)))
737738
for iH,H in enumerate(HKL):
738739
if debug: print (H)
739740
dsp = H[3]
@@ -806,7 +807,7 @@ def ImageRecalibrate(G2frame,ImageZ,data,masks,getRingsOnly=False):
806807
frame = masks['Frames']
807808
tam = ma.make_mask_none(ImageZ.shape)
808809
if frame:
809-
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(data,frame)-255)))
810+
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(data,[frame,])-255)))
810811
for iH,H in enumerate(HKL):
811812
if debug: print (H)
812813
dsp = H[3]
@@ -1810,7 +1811,7 @@ def FastAutoPixelMask(Image, Masks, Controls, numChans, dlg=None):
18101811
frame = Masks['Frames']
18111812
tam = ma.make_mask_none(Image.shape)
18121813
if frame:
1813-
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(Controls,frame)-255)))
1814+
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(Controls,[frame,])-255)))
18141815
ttmin = float(Masks['SpotMask'].get('SearchMin',0.0))
18151816
ttmax = float(Masks['SpotMask'].get('SearchMax',180.0))
18161817
esdMul = float(Masks['SpotMask']['esdMul'])
@@ -1877,7 +1878,7 @@ def MAD(args,**kwargs):
18771878
frame = Masks['Frames']
18781879
tam = ma.make_mask_none(Image.shape)
18791880
if frame:
1880-
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(Controls,frame)-255)))
1881+
tam = ma.mask_or(tam,ma.make_mask(np.abs(polymask(Controls,[frame,])-255)))
18811882
LUtth = np.array(Controls['IOtth'])
18821883
dtth = (LUtth[1]-LUtth[0])/numChans
18831884
esdMul = Masks['SpotMask']['esdMul']

0 commit comments

Comments
 (0)