Changeset 5462
- Timestamp:
- Jan 2, 2023 5:14:08 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r5461 r5462 863 863 864 864 865 # these routines are not currently in use, but there are probably good866 # places in the graphics to disable the zoom/pan to release the mouse bind867 #868 # use as Page.canvas.toolbar.reset_zoompan()869 #870 865 def get_zoompan(self): 871 """Return "Z OOM" if Zoom is active, , "PAN" if Pan is active,866 """Return "Zoom" if Zoom is active, "Pan" if Pan is active, 872 867 or None if neither 873 868 """ 874 869 return self.GetActive() 875 870 876 def reset_zoompan(self): 877 '''Turns off Zoom or Pan mode, if on. Ignored if neither is set 878 ''' 879 if self._active == 'ZOOM': 880 self._active = None 881 if self._idPress is not None: 882 self._idPress = self.canvas.mpl_disconnect(self._idPress) 883 self.mode = '' 884 885 if self._idRelease is not None: 886 self._idRelease = self.canvas.mpl_disconnect(self._idRelease) 887 self.mode = '' 888 self.canvas.widgetlock.release(self) 889 if hasattr(self,'_NTB2_ZOOM'): 890 self.ToggleTool(self._NTB2_ZOOM, False) 891 elif hasattr(self,'wx_ids'): 892 self.ToggleTool(self.wx_ids['Zoom'], False) 893 else: 894 print('Unable to reset Zoom button, please report this with matplotlib version') 895 elif self._active == 'PAN': 896 self._active = None 897 if self._idPress is not None: 898 self._idPress = self.canvas.mpl_disconnect(self._idPress) 899 self.mode = '' 900 901 if self._idRelease is not None: 902 self._idRelease = self.canvas.mpl_disconnect(self._idRelease) 903 self.mode = '' 904 self.canvas.widgetlock.release(self) 905 if hasattr(self,'_NTB2_PAN'): 906 self.ToggleTool(self._NTB2_PAN, False) 907 elif hasattr(self,'wx_ids'): 908 self.ToggleTool(self.wx_ids['Pan'], False) 909 else: 910 print('Unable to reset Pan button, please report this with matplotlib version') 871 # this routine is not currently in use, and needs to be updated 872 # to match internals of lib/python3.x/site-packages/matplotlib/backend_bases.py 873 # but there are probably good places in the graphics to disable the 874 # zoom/pan and release the mouse bind 875 # 876 # def reset_zoompan(self): 877 # '''Turns off Zoom or Pan mode, if on. Ignored if neither is set. 878 # call as Page.toolbar.reset_zoompan() 879 # ''' 880 # if self._active == 'ZOOM': 881 # self._active = None 882 # if self._idPress is not None: 883 # self._idPress = self.canvas.mpl_disconnect(self._idPress) 884 # self.mode = '' 885 886 # if self._idRelease is not None: 887 # self._idRelease = self.canvas.mpl_disconnect(self._idRelease) 888 # self.mode = '' 889 # self.canvas.widgetlock.release(self) 890 # if hasattr(self,'_NTB2_ZOOM'): 891 # self.ToggleTool(self._NTB2_ZOOM, False) 892 # elif hasattr(self,'wx_ids'): 893 # self.ToggleTool(self.wx_ids['Zoom'], False) 894 # else: 895 # print('Unable to reset Zoom button, please report this with matplotlib version') 896 # elif self._active == 'PAN': 897 # self._active = None 898 # if self._idPress is not None: 899 # self._idPress = self.canvas.mpl_disconnect(self._idPress) 900 # self.mode = '' 901 902 # if self._idRelease is not None: 903 # self._idRelease = self.canvas.mpl_disconnect(self._idRelease) 904 # self.mode = '' 905 # self.canvas.widgetlock.release(self) 906 # if hasattr(self,'_NTB2_PAN'): 907 # self.ToggleTool(self._NTB2_PAN, False) 908 # elif hasattr(self,'wx_ids'): 909 # self.ToggleTool(self.wx_ids['Pan'], False) 910 # else: 911 # print('Unable to reset Pan button, please report this with matplotlib version') 911 912 912 913 def SetCursor(page): … … 2388 2389 dsp = G2lat.Pos2dsp(Parms,xpos) 2389 2390 q = 2.*np.pi/dsp 2391 statLine = "" 2390 2392 if G2frame.Contour: #PWDR only 2391 2393 try: 2392 2394 if 'T' in Parms['Type'][0]: 2393 G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d=%9.5f Q=%9.5f pattern ID =%5d, %s'%(xpos,dsp,q,int(ypos+.5),PlotList[int(ypos+.5)][-1]),1)2395 statLine = 'TOF =%9.3f d=%9.5f Q=%9.5f pattern ID =%5d, %s'%(xpos,dsp,q,int(ypos+.5),PlotList[int(ypos+.5)][-1]) 2394 2396 else: 2395 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q= %9.5f pattern ID =%5d, %s'%(xpos,dsp,q,int(ypos+.5),PlotList[int(ypos+.5)][-1]),1)2397 statLine = '2-theta =%9.3f d=%9.5f Q= %9.5f pattern ID =%5d, %s'%(xpos,dsp,q,int(ypos+.5),PlotList[int(ypos+.5)][-1]) 2396 2398 except IndexError: 2397 2399 pass … … 2399 2401 if 'T' in Parms['Type'][0]: 2400 2402 if Page.plotStyle['sqrtPlot']: 2401 G2frame.G2plotNB.status.SetStatusText('TOF = %9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)2403 statLine = 'TOF = %9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos) 2402 2404 else: 2403 G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d=%9.5f Q=%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1)2405 statLine = 'TOF =%9.3f d=%9.5f Q=%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos) 2404 2406 elif 'E' in Parms['Type'][0]: 2405 G2frame.G2plotNB.status.SetStatusText('Energy =%9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)2407 statLine = 'Energy =%9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos) 2406 2408 else: 2407 2409 if 'PWDR' in plottype: 2410 ytmp = ypos 2408 2411 if Page.plotStyle['sqrtPlot']: 2409 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1) 2410 else: 2411 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q=%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1) 2412 ytmp = ypos**2 2413 statLine = '2-theta=%.3f d=%.5f Q=%.4f Intensity=%.2f'%(xpos,dsp,q,ypos) 2412 2414 elif plottype == 'SASD': 2413 G2frame.G2plotNB.status.SetStatusText('q =%12.5g Intensity =%12.5g d =%9.1f'%(q,ypos,dsp),1)2415 statLine = 'q =%12.5g Intensity =%12.5g d =%9.1f'%(q,ypos,dsp) 2414 2416 elif plottype == 'REFD': 2415 G2frame.G2plotNB.status.SetStatusText('q =%12.5g Reflectivity =%12.5g d =%9.1f'%(q,ypos,dsp),1) 2417 statLine = 'q =%12.5g Reflectivity =%12.5g d =%9.1f'%(q,ypos,dsp) 2418 zoomstat = Page.toolbar.get_zoompan() 2419 if zoomstat: 2420 statLine = "[" + zoomstat + "] " + statLine 2421 G2frame.G2plotNB.status.SetStatusText(statLine,1) 2416 2422 s = '' 2417 2423 if G2frame.PickId: -
trunk/NIST_profile/profile_functions_class.py
r3571 r5462 85 85 86 86 ft_factors.sort() 87 ft_factors=numpy.array(ft_factors, numpy.int)87 ft_factors=numpy.array(ft_factors, int) 88 88 89 89 ## @brief used for debugging moments from FP_profile.axial_helper(). … … 215 215 216 216 ## a real-format scratch buffer 217 self._rb1=b(numpy.zeros(nn, numpy.float))217 self._rb1=b(numpy.zeros(nn,float)) 218 218 ## a real-format scratch buffer 219 self._rb2=b(numpy.zeros(nn, numpy.float))219 self._rb2=b(numpy.zeros(nn,float)) 220 220 ## a real-format scratch buffer 221 self._rb3=b(numpy.zeros(nn, numpy.float))221 self._rb3=b(numpy.zeros(nn,float)) 222 222 ## a complex-format scratch buffer 223 223 self._cb1=b(numpy.zeros(nn,numpy.complex)) 224 224 ## a scratch buffer used by the axial helper 225 self._f0buf=b(numpy.zeros(self.oversampling*twotheta_output_points, numpy.float))225 self._f0buf=b(numpy.zeros(self.oversampling*twotheta_output_points, float)) 226 226 ## a scratch buffer used for axial divergence 227 self._epsb2=b(numpy.zeros(self.oversampling*twotheta_output_points, numpy.float))227 self._epsb2=b(numpy.zeros(self.oversampling*twotheta_output_points, float)) 228 228 ## the I2+ buffer 229 self._I2p=b(numpy.zeros(self.oversampling*twotheta_output_points, numpy.float))229 self._I2p=b(numpy.zeros(self.oversampling*twotheta_output_points, float)) 230 230 ## the I2- buffer 231 self._I2m=b(numpy.zeros(self.oversampling*twotheta_output_points, numpy.float))231 self._I2m=b(numpy.zeros(self.oversampling*twotheta_output_points, float)) 232 232 ## another buffer used for axial divergence 233 self._axial=b(numpy.zeros(self.oversampling*twotheta_output_points, numpy.float))233 self._axial=b(numpy.zeros(self.oversampling*twotheta_output_points, float)) 234 234 ## the largest frequency in Fourier space 235 235 omega_max=self.n_omega_points*2*math.pi/window_fullwidth … … 308 308 # cached copy is implicitly updated, so thsat the next time this is called with the same 309 309 # parameters, it will return the previous array. 310 def get_conv(self, name, key, format= numpy.float):310 def get_conv(self, name, key, format=float): 311 311 #either get an old buffer associated with key, with valid convolution kernel, 312 312 #or create a new, empty buffer. If we already have too many buffers, swap one out. … … 811 811 if width is None: 812 812 return #no convolver 813 flag, conv = self.get_conv(name, width, numpy.float)813 flag, conv = self.get_conv(name, width, float) 814 814 if flag: return conv #already up to date 815 815 rb1=self._rb1 … … 1048 1048 kwargs.update(self.param_dicts["conv_global"]) 1049 1049 1050 flag, conv = self.get_conv(me, kwargs, numpy.float)1050 flag, conv = self.get_conv(me, kwargs, float) 1051 1051 if flag: return conv #already up to date 1052 1052 … … 1091 1091 if not self.output_gaussian_smoother_bins_sigma: return # no smoothing 1092 1092 flag, buf=self.get_conv(me, self.output_gaussian_smoother_bins_sigma, 1093 format= numpy.float)1093 format=float) 1094 1094 if flag: return buf #already computed 1095 1095 buf[:]=self.omega_vals
Note: See TracChangeset
for help on using the changeset viewer.