@@ -238,7 +238,7 @@ def OnPolaCalib(event):
238238 if 'det2theta' not in data :
239239 data ['det2theta' ] = 0.0
240240 if 'Gain map' not in data :
241- data ['Gain map' ] = ''
241+ data ['Gain map' ] = ' '
242242#end patch
243243 tthSizer = wx .BoxSizer (wx .HORIZONTAL )
244244 tthSizer .Add (wx .StaticText (G2frame .dataWindow ,label = ' Detector 2-theta: ' ),0 ,WACV )
@@ -263,7 +263,7 @@ def UpdateImageControls(G2frame,data,masks,useTA=None,useMask=None,IntegrateOnly
263263 if 'Flat Bkg' not in data :
264264 data ['Flat Bkg' ] = 0.0
265265 if 'Gain map' not in data :
266- data ['Gain map' ] = ''
266+ data ['Gain map' ] = ' '
267267 if 'GonioAngles' not in data :
268268 data ['GonioAngles' ] = [0. ,0. ,0. ]
269269 if 'DetDepth' not in data :
@@ -424,9 +424,10 @@ def OnMultiGainMap(event):
424424 #end of diagnostic block
425425 finally :
426426 dlg .Destroy ()
427- GMsum /= pixels
427+ GMsum = np . where ( pixels > 0 , GMsum / pixels , 0 )
428428 # GMsum = np.where(GMsum > 2000,0,GMsum)
429429 # GMsum = np.where(GMsum < 500,0,GMsum)
430+ GMsum = np .array (GMsum ,dtype = np .int32 )
430431 outname = 'GainMap'
431432 dlg = wx .FileDialog (G2frame , 'Choose gain map filename' , pth ,outname ,
432433 'G2img files (*.G2img)|*.G2img' ,wx .FD_SAVE | wx .FD_OVERWRITE_PROMPT )
@@ -621,8 +622,8 @@ def ResetThresholds():
621622 Imax = np .max (G2frame .ImageZ )
622623 data ['range' ] = [(0 ,Imax ),[Imin ,Imax ]]
623624 masks ['Thresholds' ] = [(0 ,Imax ),[Imin ,Imax ]]
624- G2frame .slideSizer .GetChildren ()[1 ].Window .SetValue (Imax ) #tricky
625- G2frame .slideSizer .GetChildren ()[4 ].Window .SetValue (Imin ) #tricky
625+ G2frame .slideSizer .GetChildren ()[1 ].Window .ChangeValue (Imax ) #tricky
626+ G2frame .slideSizer .GetChildren ()[4 ].Window .ChangeValue (Imin ) #tricky
626627
627628 def OnIntegrate (event ,useTA = None ,useMask = None ):
628629 '''Integrate image in response to a menu event or from the AutoIntegrate
@@ -748,7 +749,7 @@ def OnCopySelected(event):
748749 'tilt' ,'rotation' ,'azmthOff' ,'fullIntegrate' ,'LRazimuth' ,'setdist' ,
749750 'IOtth' ,'outChannels' ,'outAzimuths' ,'invert_x' ,'invert_y' ,'DetDepth' ,
750751 'calibskip' ,'pixLimit' ,'cutoff' ,'calibdmin' ,'Flat Bkg' ,'varyList' ,'orientation' ,
751- 'binType' ,'SampleShape' ,'PolaVal' ,'SampleAbs' ,'dark image' ,'background image' ]
752+ 'binType' ,'SampleShape' ,'PolaVal' ,'SampleAbs' ,'dark image' ,'background image' , 'Gain map' ]
752753 keyList .sort (key = lambda s : s .lower ())
753754 keyText = [i + ' = ' + str (data [i ]) for i in keyList ]
754755 # sort both lists together, ordered by keyText
0 commit comments