@@ -74,7 +74,7 @@ def GetImageZ(G2frame,data,newRange=False):
7474 Npix ,imagefile ,imagetag = G2IO .GetCheckImageFile (G2frame ,G2frame .Image )
7575 if imagefile is None : return []
7676 formatName = data .get ('formatName' ,'' )
77- sumImg = np .array (G2fil .GetImageData (G2frame ,imagefile ,True ,ImageTag = imagetag ,FormatName = formatName ),dtype = ' float32' )
77+ sumImg = np .array (G2fil .GetImageData (G2frame ,imagefile ,True ,ImageTag = imagetag ,FormatName = formatName ),dtype = np . float32 )
7878 if sumImg is None :
7979 return []
8080 darkImg = False
@@ -87,9 +87,9 @@ def GetImageZ(G2frame,data,newRange=False):
8787 dformatName = Ddata .get ('formatName' ,'' )
8888 Npix ,darkfile ,imagetag = G2IO .GetCheckImageFile (G2frame ,Did )
8989# darkImage = G2fil.GetImageData(G2frame,darkfile,True,ImageTag=imagetag,FormatName=dformatName)
90- darkImage = np .array (G2fil .GetImageData (G2frame ,darkfile ,True ,ImageTag = imagetag ,FormatName = dformatName ),dtype = ' float32' )
91- if darkImg is not None :
92- sumImg += np .array (darkImage * darkScale ,dtype = ' float32' )
90+ darkImage = np .array (G2fil .GetImageData (G2frame ,darkfile ,True ,ImageTag = imagetag ,FormatName = dformatName ),dtype = np . float32 )
91+ if darkImg is not None :
92+ sumImg += np .array (darkImage * darkScale ,dtype = np . float32 )
9393 else :
9494 print ('Warning: resetting dark image (not found: {})' .format (
9595 darkImg ))
@@ -102,11 +102,11 @@ def GetImageZ(G2frame,data,newRange=False):
102102 Npix ,backfile ,imagetag = G2IO .GetCheckImageFile (G2frame ,Bid )
103103 Bdata = G2frame .GPXtree .GetItemPyData (G2gd .GetGPXtreeItemId (G2frame ,Bid ,'Image Controls' ))
104104 bformatName = Bdata .get ('formatName' ,'' )
105- backImage = np .array (G2fil .GetImageData (G2frame ,backfile ,True ,ImageTag = imagetag ,FormatName = bformatName ),dtype = ' float32' )
105+ backImage = np .array (G2fil .GetImageData (G2frame ,backfile ,True ,ImageTag = imagetag ,FormatName = bformatName ),dtype = np . float32 )
106106 if darkImg and backImage is not None :
107- backImage += np .array (darkImage * darkScale / backScale ,dtype = ' float32' )
107+ backImage += np .array (darkImage * darkScale / backScale ,dtype = np . float32 )
108108 if backImage is not None :
109- sumImg += np .array (backImage * backScale ,dtype = ' float32' )
109+ sumImg += np .array (backImage * backScale ,dtype = np . float32 )
110110 if 'Gain map' in data :
111111 gainMap = data ['Gain map' ]
112112 if gainMap :
@@ -122,7 +122,8 @@ def GetImageZ(G2frame,data,newRange=False):
122122 Imin = np .min (sumImg )
123123 if 'range' not in data or newRange :
124124 data ['range' ] = [(Imin ,Imax ),[Imin ,Imax ]]
125- return np .asarray (np .rint (sumImg ),dtype = 'int32' )
125+ #return np.asarray(np.rint(sumImg),dtype=np.int32)
126+ return np .array (np .array (np .rint (sumImg ),dtype = int ),dtype = np .int32 ) # double-cast removes warning. Why?
126127
127128def UpdateImageData (G2frame ,data ):
128129
@@ -1789,7 +1790,7 @@ def newReplot(*args,**kwargs):
17891790 def onDeleteMask (event ):
17901791 Obj = event .GetEventObject ()
17911792 typ = Obj .locationcode .split ('+' )[0 ]
1792- num = int (Obj .locationcode .split ('+' )[1 ])
1793+ num = int (Obj .locationcode .split ('+' )[1 ])- 1 #off by one?
17931794 del (data [typ ][num ])
17941795 wx .CallAfter (UpdateMasks ,G2frame ,data )
17951796 G2plt .PlotExposedImage (G2frame ,event = event )
@@ -2013,7 +2014,6 @@ def OnNewRingMask(event):
20132014
20142015 def OnNewXlineMask (event ):
20152016 'Start a new x-line mask'
2016- print ('x' )
20172017 G2frame .MaskKey = 'x'
20182018 G2plt .OnStartMask (G2frame )
20192019
@@ -2194,7 +2194,7 @@ def OnDelPixMask(event):
21942194 def OnAzimuthPlot (event ):
21952195 GkTheta = chr (0x03f4 )
21962196 Obj = event .GetEventObject ()
2197- ringId = int (Obj .locationcode .split ('+' )[1 ])
2197+ ringId = int (Obj .locationcode .split ('+' )[1 ])- 1
21982198 Controls = G2frame .GPXtree .GetItemPyData (G2gd .GetGPXtreeItemId (G2frame ,G2frame .Image ,'Image Controls' ))
21992199 image = GetImageZ (G2frame ,Controls )
22002200 RingInt = G2img .AzimuthIntegrate (image ,Controls ,data ,ringId )
0 commit comments