project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
AdvancedPhotonSource_GSAS-II
public
public
0
0
dumpTree.Show
def Show(arg): return argfor key in self.OverallParms:print (''+key+Show(self.OverallParms[key]))print ('Phases')for key1 in self.Phases:print (''+key1+Show(self.Phases[key1]))print ('Histogram')for key1 in self.Histograms:print (''+key1+Show(self.Histograms[key1]))for key2 in self.Histograms[key1]:print (''+key2+Show(...
5
11
1
113
0
2,229
2,239
2,229
null
[]
None
null
0
0
0
null
0
null
The function (dumpTree.Show) defined within the public class called public.The function start at line 2229 and ends at 2239. It contains 11 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
defaultSaveFile
def defaultSaveFile(self):return os.path.abspath(os.path.splitext(self.G2frame.GSASprojectfile )[0]+self.extension)
1
4
1
32
0
2,241
2,244
2,241
null
[]
None
null
0
0
0
null
0
null
The function (defaultSaveFile) defined within the public class called public.The function start at line 2241 and ends at 2244. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
askSaveFile
def askSaveFile(self):'''Ask the user to supply a file name:returns: a file name (str) or None if Cancel is pressed'''from . import GSASIIctrlGUI as G2G#pth = G2G.GetExportPath(self.G2frame)if self.G2frame.GSASprojectfile:defnam = os.path.splitext(os.path.split(self.G2frame.GSASprojectfile)[1])[0]+self.extensionelse:de...
2
9
1
78
0
2,246
2,260
2,246
null
[]
None
null
0
0
0
null
0
null
The function (askSaveFile) defined within the public class called public.The function start at line 2246 and ends at 2260. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
askSaveDirectory
def askSaveDirectory(self):'''Ask the user to supply a directory name. Path name is used as thestarting point for the next export path search.:returns: a directory name (str) or None if Cancel is pressedTODO: Can this be replaced with G2G.askSaveDirectory?'''import wxfrom . import GSASIIctrlGUI as G2Gpth = G2G.GetExpor...
3
17
1
88
0
2,262
2,285
2,262
null
[]
None
null
0
0
0
null
0
null
The function (askSaveDirectory) defined within the public class called public.The function start at line 2262 and ends at 2285. It contains 17 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
OpenFile
def OpenFile(self,fil=None,mode='w',delayOpen=False):'''Open the output file:param str fil: The name of the file to open. If None (default)the name defaults to self.dirname + self.filename.If an extension is supplied, it is not overridded,but if not, the default extension is used.:param str mode:The mode can 'w' to wri...
5
17
4
126
0
2,288
2,315
2,288
null
[]
None
null
0
0
0
null
0
null
The function (OpenFile) defined within the public class called public.The function start at line 2288 and ends at 2315. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [2288.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
openDelayed
def openDelayed(self,mode='w'):self.DelayOpen = Falseself.fp = open(self.fullpath,mode)return self.fp
1
4
2
30
0
2,317
2,320
2,317
null
[]
None
null
0
0
0
null
0
null
The function (openDelayed) defined within the public class called public.The function start at line 2317 and ends at 2320. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2317.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Write
def Write(self,line):'''write a line of output, attaching a line-end character:param str line: the text to be written.'''if self.fp is None:raise Exception('Attempt to Write without use of OpenFile')self.fp.write(line+'\n')
2
4
2
30
0
2,322
2,329
2,322
null
[]
None
null
0
0
0
null
0
null
The function (Write) defined within the public class called public.The function start at line 2322 and ends at 2329. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2322.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CloseFile
def CloseFile(self,fp=None):'''Close a file opened in OpenFile:param file fp: the file object to be closed. If None (default)file object self.fp is closed.'''if self.fp is None and self.DelayOpen:if GSASIIpath.GetConfigValue('debug'):print('Delayed open: close before uncreated file')returnif self.fp is None:if GSASIIpa...
9
16
2
97
0
2,331
2,351
2,331
null
[]
None
null
0
0
0
null
0
null
The function (CloseFile) defined within the public class called public.The function start at line 2331 and ends at 2351. It contains 16 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [2331.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetSeqRef
def SetSeqRef(self,data,hist):'''Set the exporter to retrieve results from a sequential refinementrather than the main tree'''self.SeqRefdata = dataself.SeqRefhist = histdata_name = data[hist]for i,val in zip(data_name['varyList'],data_name['sig']):self.sigDict[i] = valself.sigDict[striphist(i)] = valfor i in data_name...
6
17
3
179
0
2,353
2,373
2,353
null
[]
None
null
0
0
0
null
0
null
The function (SetSeqRef) defined within the public class called public.The function start at line 2353 and ends at 2373. It contains 17 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [2353.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetCell
def GetCell(self,phasenam,unique=False):"""Gets the unit cell parameters and their s.u.'s for a selected phase:param str phasenam: the name for the selected phase:param bool unique: when True, only directly refined parameters(a in cubic, a & alpha in rhombohedral cells) are assignedpositive s.u. values. Used as True fo...
4
14
3
159
0
2,377
2,400
2,377
null
[]
None
null
0
0
0
null
0
null
The function (GetCell) defined within the public class called public.The function start at line 2377 and ends at 2400. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [2377.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetSeqCell
def GetSeqCell(self,phasenam,data_name):"""Gets the unit cell parameters and their s.u.'s for a selected phaseand histogram in a sequential fit:param str phasenam: the name for the selected phase:param dict data_name: the sequential refinement parameters for the selected histogram:returns: `cellList,cellSig` where each...
9
25
3
296
0
2,402
2,435
2,402
null
[]
None
null
0
0
0
null
0
null
The function (GetSeqCell) defined within the public class called public.The function start at line 2402 and ends at 2435. It contains 25 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [2402.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetAtoms
def GetAtoms(self,phasenam):"""Gets the atoms associated with a phase. Can be used with standardor macromolecular phases:param str phasenam: the name for the selected phase:returns: a list of items for eac atom where each item is a list containing:label, typ, mult, xyz, and td, where* label and typ are the atom label a...
6
38
2
463
0
2,437
2,491
2,437
null
[]
None
null
0
0
0
null
0
null
The function (GetAtoms) defined within the public class called public.The function start at line 2437 and ends at 2491. It contains 38 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [2437.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetCu2Wave
def SetCu2Wave():'''Set the parameters to the two-line Cu K alpha 1+2 spectrum'''parmDict['wave'] = {i:v for i,v in enumerate((1.5405925, 1.5443873))}parmDict['int'] = {i:v for i,v in enumerate((0.653817, 0.346183))}parmDict['lwidth'] = {i:v for i,v in enumerate((0.501844,0.626579))}
4
4
0
86
0
91
96
91
null
[]
None
null
0
0
0
null
0
null
The function (SetCu2Wave) defined within the public class called public.The function start at line 91 and ends at 96. It contains 4 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetCu6wave
def SetCu6wave():'''Set the emission parameters to the NIST six-line Cu K alpha spectrum'''# values from Marcus Mendenhall from atan_windowed_FP_profile.pyparmDict['wave'] = {i:v for i,v in enumerate((1.5405925, 1.5443873, 1.5446782, 1.5410769, 1.53471, 1.53382, ))}parmDict['int'] = {i:v for i,v in enumerate((0.5838435...
4
4
0
137
0
98
104
98
null
[]
None
null
0
0
0
null
0
null
The function (SetCu6wave) defined within the public class called public.The function start at line 98 and ends at 104. It contains 4 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SetMonoWave
def SetMonoWave():'''Eliminates the short-wavelength line from the six-line Cu Kalpha spectrum when incident beam mono; resets it to 6 if no mono'''if IBmono and len(parmDict['wave']) == 6:for key in 'wave','int','lwidth':if 5 in parmDict[key]: del parmDict[key][5]if 4 in parmDict[key]: del parmDict[key][4]if (not IBmo...
8
7
0
78
0
106
115
106
null
[]
None
null
0
0
0
null
0
null
The function (SetMonoWave) defined within the public class called public.The function start at line 106 and ends at 115. It contains 7 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
writeNIST
def writeNIST(filename):'''Write the NIST FPA terms into a JSON-like file that can be reloadedin _onReadFPA'''if not filename: returnfp = open(filename,'w')fp.write('# parameters to be used in the NIST XRD Fundamental Parameters program\n')fp.write('{\n')for key in sorted(NISTparms):fp.write(" '"+key+"' : "+str(NISTpar...
4
11
1
86
1
117
131
117
null
['fp']
None
null
0
0
0
null
0
null
The function (writeNIST) defined within the public class called public.The function start at line 117 and ends at 131. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FillParmSizer
def FillParmSizer():'''Create a list of input items for the parameter section of theinput window, sets default values when not set and displays themin the scrolledpanel prmPnl.'''prmSizer = prmPnl.GetSizer()prmSizer.Clear(True)if IBmono:itemList = [i for i in BraggBrentanoParms if not i[0].startswith('tube-tails')]else...
9
43
0
418
7
137
183
137
null
['txt', 'ctrl', 'text', 'prmSizer', 'itemList', 'txtSizer', 'FPdlg']
None
null
0
0
0
null
0
null
The function (FillParmSizer) defined within the public class called public.The function start at line 137 and ends at 183. It contains 43 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onOK
def _onOK(event):XferFPAsettings(parmDict)SetButtonStatus(done=True) # done=True triggers the simulationFPdlg.Destroy()
1
4
1
20
0
196
199
196
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onOK) defined within the public class called public.The function start at line 196 and ends at 199. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onClose
def _onClose(event):SetButtonStatus()FPdlg.Destroy()
1
3
1
13
0
200
202
200
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onClose) defined within the public class called public.The function start at line 200 and ends at 202. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onAddWave
def _onAddWave(event):newkey = max(parmDict['wave'].keys())+1for key,defVal in zip(('wave','int','lwidth'),(0.0, 1.0, 0.1),):parmDict[key][newkey] = defValwx.CallAfter(MakeTopasFPASizer,G2frame,FPdlg,SetButtonStatus)
2
8
1
72
0
203
210
203
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onAddWave) defined within the public class called public.The function start at line 203 and ends at 210. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onRemWave
def _onRemWave(event):lastkey = max(parmDict['wave'].keys())for key in ('wave','int','lwidth'):if lastkey in parmDict[key]:del parmDict[key][lastkey]wx.CallAfter(MakeTopasFPASizer,G2frame,FPdlg,SetButtonStatus)
3
6
1
57
0
211
216
211
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onRemWave) defined within the public class called public.The function start at line 211 and ends at 216. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onSetCu6wave
def _onSetCu6wave(event):SetCu6wave()SetMonoWave()wx.CallAfter(MakeTopasFPASizer,G2frame,FPdlg,SetButtonStatus)
1
4
1
23
0
217
220
217
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onSetCu6wave) defined within the public class called public.The function start at line 217 and ends at 220. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onSetCu2Wave
def _onSetCu2Wave(event):SetCu2Wave()wx.CallAfter(MakeTopasFPASizer,G2frame,FPdlg,SetButtonStatus)
1
3
1
20
0
221
223
221
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onSetCu2Wave) defined within the public class called public.The function start at line 221 and ends at 223. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onSetDetBtn
def _onSetDetBtn(event):global DetModeif detBtn1.GetValue():DetMode = 'BBpoint'wx.CallAfter(FillParmSizer)else:DetMode = 'BBPSD'wx.CallAfter(FillParmSizer)
2
8
1
34
0
224
231
224
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onSetDetBtn) defined within the public class called public.The function start at line 224 and ends at 231. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onSetMonoBtn
def _onSetMonoBtn(event):global IBmonoIBmono = not monoBtn1.GetValue()SetMonoWave()#wx.CallAfter(FillParmSizer)wx.CallAfter(MakeTopasFPASizer,G2frame,FPdlg,SetButtonStatus)
1
5
1
30
0
232
237
232
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onSetMonoBtn) defined within the public class called public.The function start at line 232 and ends at 237. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer.PlotTopasFPA
def PlotTopasFPA(event):XferFPAsettings(parmDict)ttArr = np.arange(max(0.5,simParms['plotpos']-simParms['calcwid']),simParms['plotpos']+simParms['calcwid'],simParms['step'])intArr = np.zeros_like(ttArr)NISTpk = setupFPAcalc()try:center_bin_idx,peakObj = doFPAcalc(NISTpk,ttArr,simParms['plotpos'],simParms['calcwid'],sim...
5
34
1
269
0
238
272
238
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer.PlotTopasFPA) defined within the public class called public.The function start at line 238 and ends at 272. It contains 34 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer._onSaveFPA
def _onSaveFPA(event):XferFPAsettings(parmDict)filename = G2G.askSaveFile(G2frame,'','.NISTfpa', 'dict of NIST FPA values',FPdlg)writeNIST(filename)
1
5
1
29
0
273
277
273
null
[]
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer._onSaveFPA) defined within the public class called public.The function start at line 273 and ends at 277. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeTopasFPASizer
def MakeTopasFPASizer(G2frame,FPdlg,SetButtonStatus):'''Create a GUI with parameters for the NIST XRD Fundamental Parameters Code.Parameter input is modeled after Topas input parameters.:param wx.Frame G2frame: main GSAS-II window:param wx.Window FPdlg: Frame or Dialog where GUI will appear:param SetButtonStatus: a cal...
8
116
3
1,272
28
185
388
185
null
['offset', 'ctrl', 'text', 'pkPts', 'msg', 'intArr', 'pkMax', 'monoBtn2', 'monoBtn1', 'DetMode', 'filename', 'prmPnl', 'IBmono', 'lastkey', 'MainSizer', 'startInd', 'btn', 'prmSizer', 'btnsizer', 'newkey', 'detBtn1', 'waveSizer', 'saveBtn', 'OKbtn', 'ttArr', 'detBtn2', 'NISTpk', 'Cbtn']
None
null
0
0
0
null
0
null
The function (MakeTopasFPASizer) defined within the public class called public.The function start at line 185 and ends at 388. It contains 116 lines of code and it has a cyclomatic complexity of 8. It takes 3 parameters, represented as [185.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
XferFPAsettings
def XferFPAsettings(InpParms):'''convert Topas-type parameters to SI units for NIST and place in a dict sortedaccording to use in each convoluter:param dict InpParms: a dict with Topas-like parameters, as set in:func:`MakeTopasFPASizer`:returns: a nested dict with global parameters and those for each convolution'''# cl...
20
67
1
707
9
390
473
390
null
['source_gauss_widths_m', 'source_wavelengths_m', 'PSDdetector_length_mm', 'source_lor_widths_m', 'la', 'source_intensities', 'max_wavelength', 'keys', 'norm']
None
null
0
0
0
null
0
null
The function (XferFPAsettings) defined within the public class called public.The function start at line 390 and ends at 473. It contains 67 lines of code and it has a cyclomatic complexity of 20. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
setupFPAcalc
def setupFPAcalc():'''Create a peak profile object using the NIST XRD FundamentalParameters Code.:returns: a profile object that can provide information oneach convolution or compute the composite peak shape.'''if IBmono:p=FP.FP_windowed(anglemode="twotheta",output_gaussian_smoother_bins_sigma=1.0,oversampling=NISTparm...
4
16
0
105
1
475
498
475
null
['p']
None
null
0
0
0
null
0
null
The function (setupFPAcalc) defined within the public class called public.The function start at line 475 and ends at 498. It contains 16 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
doFPAcalc
def doFPAcalc(NISTpk,ttArr,twotheta,calcwid,step):'''Compute a single peak using a NIST profile object:param object NISTpk: a peak profile computational object from theNIST XRD Fundamental Parameters Code, typically established froma call to :func:`SetupFPAcalc`:param np.Array ttArr: an evenly-spaced grid of two-theta ...
1
8
5
68
1
500
518
500
null
['center_bin_idx']
None
null
0
0
0
null
0
null
The function (doFPAcalc) defined within the public class called public.The function start at line 500 and ends at 518. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [500.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer._onOK
def _onOK(event):msg = ''if simParms['minTT']-simParms['calcwid']/1.5 < 0.1:msg += 'First peak minus half the calc width is too low'if simParms['maxTT']+simParms['calcwid']/1.5 > 175:if msg: msg += '\n'msg += 'Last peak plus half the calc width is too high'if simParms['npeaks'] < 8:if msg: msg += '\n'msg += 'At least 8...
19
62
1
533
0
529
595
529
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer._onOK) defined within the public class called public.The function start at line 529 and ends at 595. It contains 62 lines of code and it has a cyclomatic complexity of 19. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer.FitFPApeaks
def FitFPApeaks(ttArr, intArr, peaklist, maxPtsHM):'''Perform a peak fit to the FP simulated pattern'''pgbar = wx.ProgressDialog('FPA Simulation','Starting FPA simulation',100,parent=G2frame,style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE #|wx.PD_CAN_ABORT)pgbar.Raise()wx.BeginBusyCursor()# pick out one or two most intense ...
10
84
4
852
0
597
692
597
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer.FitFPApeaks) defined within the public class called public.The function start at line 597 and ends at 692. It contains 84 lines of code and it has a cyclomatic complexity of 10. It takes 4 parameters, represented as [597.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer._onClose
def _onClose(event):dlg.Destroy()
1
2
1
10
0
695
696
695
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer._onClose) defined within the public class called public.The function start at line 695 and ends at 696. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer.SetButtonStatus
def SetButtonStatus(done=False):OKbtn.Enable(bool(NISTparms))#saveBtn.Enable(bool(NISTparms))if done: _onOK(None)
2
3
1
23
0
697
700
697
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer.SetButtonStatus) defined within the public class called public.The function start at line 697 and ends at 700. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer._onSetFPA
def _onSetFPA(event):# Create a non-modal dialog for Topas-style FP input.FPdlg = wx.Dialog(dlg,wx.ID_ANY,'FPA parameters',style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)MakeTopasFPASizer(G2frame,FPdlg,SetButtonStatus)FPdlg.CenterOnParent()FPdlg.Raise()FPdlg.Show()
1
7
1
52
0
701
708
701
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer._onSetFPA) defined within the public class called public.The function start at line 701 and ends at 708. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer._onSaveFPA
def _onSaveFPA(event):filename = G2G.askSaveFile(G2frame,'','.NISTfpa', 'dict of NIST FPA values',dlg)writeNIST(filename)
1
4
1
25
0
709
712
709
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer._onSaveFPA) defined within the public class called public.The function start at line 709 and ends at 712. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer._onReadFPA
def _onReadFPA(event):filename = G2G.GetImportFile(G2frame,message='Read file with dict of values for NIST Fundamental Parameters',parent=dlg,wildcard='dict of NIST FPA values|*.NISTfpa')if not filename: returnif not filename[0]: returntry:txt = open(filename[0],'r').read()NISTparms.clear()d = eval(txt)NISTparms.update...
4
17
1
98
0
714
731
714
null
[]
None
null
0
0
0
null
0
null
The function (MakeSimSizer._onReadFPA) defined within the public class called public.The function start at line 714 and ends at 731. It contains 17 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeSimSizer
def MakeSimSizer(G2frame, dlg):'''Create a GUI to get simulation with parameters for FundamentalParameters fitting.:param wx.Window dlg: Frame or Dialog where GUI will appear:returns: a sizer with the GUI controls'''def _onOK(event):msg = ''if simParms['minTT']-simParms['calcwid']/1.5 < 0.1:msg += 'First peak minus hal...
4
73
2
704
43
520
802
520
null
['pgbar', 'Lam2', 'File', 'minPtsHM', 'offset', 'topSizer', 'bxye', 'i', 'ctrl', 'text', 'pkPts', 'msg', 'intArr', 'peakSpacing', 'pkMax', 'd', 'limits', 'bkg', 'controldat', 'txt', 'peakData', 'fldlg', 'maxPtsHM', 'ints', 'area', 'filename', 'readBtn', 'MainSizer', 'startInd', 'pth', 'btn', 'prmSizer', 'btnsizer', 'FP...
None
null
0
0
0
null
0
null
The function (MakeSimSizer) defined within the public class called public.The function start at line 520 and ends at 802. It contains 73 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [520.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetFPAInput
def GetFPAInput(G2frame):dlg = wx.Dialog(G2frame,wx.ID_ANY,'FPA input',style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)MakeSimSizer(G2frame,dlg)dlg.CenterOnParent()dlg.Show()return
1
7
1
46
1
804
810
804
null
['dlg']
None
null
0
0
0
null
0
null
The function (GetFPAInput) defined within the public class called public.The function start at line 804 and ends at 810. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
peneCorr
def peneCorr(tth,dep,dist):''' Compute empirical position correction due to detector absorption:param float/array tth: angle between detector normal & scattered ray vector:param float dep: coefficient:param float dist: sample to detector surface in mm:returns: float/array distance: correction for penetration'''return d...
1
2
3
29
0
47
54
47
null
[]
None
null
0
0
0
null
0
null
The function (peneCorr) defined within the public class called public.The function start at line 47 and ends at 54. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [47.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthP.costth
def costth(xyz,d0):''' compute cos of angle between vectors; xyz not normalized, d0 normalized'''u = xyz/nl.norm(xyz,axis=-1)[:,:,nxs]return np.dot(u,d0)
1
3
2
39
0
64
67
64
null
[]
None
null
0
0
0
null
0
null
The function (GetTthP.costth) defined within the public class called public.The function start at line 64 and ends at 67. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [64.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthP
def GetTthP(x,y,parmDict):''' Compute angle between detector normal & sample scattering ray vector:param float/array x: detector x-position in mm:param float/array y: detector y-position in mm:param dict parmDict: dictionary of detector orientation parameters in fitting routinenames are: det-X, det-Y, tilt, dist & phi:...
1
15
3
166
12
56
81
56
null
['dxyz0', 'dist', 'ctth0', 'd001', 'R', 'dx', 'u', 'MN', 'tilt', 'r001', 'T', 'dy']
None
null
0
0
0
null
0
null
The function (GetTthP) defined within the public class called public.The function start at line 56 and ends at 81. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [56.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
SamAbs
def SamAbs(data,tax,tay,muT):'Compute sample absorption correction for images'if 'Cylind' in data['SampleShape']:muR = muT*(1.+npsind(tay)**2/2.)/(npcosd(tax))#adjust for additional thickness off sample normaltabs = G2pwd.Absorb(data['SampleShape'],muR,tay)elif 'Fixed' in data['SampleShape']:#assumes flat plate sample ...
3
10
4
92
2
83
92
83
null
['muR', 'tabs']
None
null
0
0
0
null
0
null
The function (SamAbs) defined within the public class called public.The function start at line 83 and ends at 92. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [83.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makeMat
def makeMat(Angle,Axis):'''Make rotation matrix from Angle and Axis:param float Angle: in degrees:param int Axis: 0 for rotation about x, 1 for about y, etc.'''cs = npcosd(Angle)ss = npsind(Angle)M = np.array(([1.,0.,0.],[0.,cs,-ss],[0.,ss,cs]),dtype=np.float32)return np.roll(np.roll(M,Axis,axis=0),Axis,axis=1)
1
5
2
88
3
94
103
94
null
['M', 'ss', 'cs']
None
null
0
0
0
null
0
null
The function (makeMat) defined within the public class called public.The function start at line 94 and ends at 103. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [94.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitEllipse.ellipse_center
def ellipse_center(p):''' gives ellipse center coordinates'''b,c,d,f,a = p[1]/2., p[2], p[3]/2., p[4]/2., p[0]num = b*b-a*cx0=(c*d-b*f)/numy0=(a*f-b*d)/numreturn np.array([x0,y0])
1
6
1
95
0
107
114
107
null
[]
None
null
0
0
0
null
0
null
The function (FitEllipse.ellipse_center) defined within the public class called public.The function start at line 107 and ends at 114. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitEllipse.ellipse_angle_of_rotation
def ellipse_angle_of_rotation( p ):''' gives rotation of ellipse major axis from x-axisrange will be -90 to 90 deg'''b,c,a = p[1]/2., p[2], p[0]return 0.5*npatand(2*b/(a-c))
1
3
1
46
0
116
121
116
null
[]
None
null
0
0
0
null
0
null
The function (FitEllipse.ellipse_angle_of_rotation) defined within the public class called public.The function start at line 116 and ends at 121. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitEllipse.ellipse_axis_length
def ellipse_axis_length( p ):''' gives ellipse radii in [minor,major] order'''b,c,d,f,g,a = p[1]/2., p[2], p[3]/2., p[4]/2, p[5], p[0]up = 2*(a*f*f+c*d*d+g*b*b-2*b*d*f-a*c*g)down1=(b*b-a*c)*( (c-a)*np.sqrt(1+4*b*b/((a-c)*(a-c)))-(c+a))down2=(b*b-a*c)*( (a-c)*np.sqrt(1+4*b*b/((a-c)*(a-c)))-(c+a))res1=np.sqrt(up/down1)re...
1
8
1
231
0
123
132
123
null
[]
None
null
0
0
0
null
0
null
The function (FitEllipse.ellipse_axis_length) defined within the public class called public.The function start at line 123 and ends at 132. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitEllipse
def FitEllipse(xy):def ellipse_center(p):''' gives ellipse center coordinates'''b,c,d,f,a = p[1]/2., p[2], p[3]/2., p[4]/2., p[0]num = b*b-a*cx0=(c*d-b*f)/numy0=(a*f-b*d)/numreturn np.array([x0,y0])def ellipse_angle_of_rotation( p ):''' gives rotation of ellipse major axis from x-axisrange will be -90 to 90 deg'''b,c,a...
2
22
1
238
19
105
151
105
null
['cent', 'res1', 'n', 'down2', 'phi', 'C', 'D', 'x0', 'num', 'res2', 'a', 'x', 'down1', 'xy', 'S', 'y0', 'y', 'radii', 'up']
None
null
0
0
0
null
0
null
The function (FitEllipse) defined within the public class called public.The function start at line 105 and ends at 151. It contains 22 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitDetector.CalibPrint
def CalibPrint(ValSig,chisq,Npts):print ('Image Parameters: chi**2: %12.3g, Np: %d'%(chisq,Npts))ptlbls = 'names :'ptstr ='values:'sigstr = 'esds:'for name,value,sig in ValSig:ptlbls += "%s" % (name.rjust(12))if name == 'phi':ptstr += Fmt[name] % (value%360.)else:ptstr += Fmt[name] % (value)if sig:sigstr += Fmt[name] %...
4
18
3
111
0
165
182
165
null
[]
None
null
0
0
0
null
0
null
The function (FitDetector.CalibPrint) defined within the public class called public.The function start at line 165 and ends at 182. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [165.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitDetector.ellipseCalcD
def ellipseCalcD(B,xyd,varyList,parmDict):x,y,dsp = xydvaryDict = dict(zip(varyList,B))parms = {}for parm in parmDict:if parm in varyList:parms[parm] = varyDict[parm]else:parms[parm] = parmDict[parm]phi = parms['phi']-90. #get rotation of major axis from tilt axisdtth = GetTthP(x,y,parmDict)#sample-detector ray wrt det...
3
36
4
463
0
184
220
184
null
[]
None
null
0
0
0
null
0
null
The function (FitDetector.ellipseCalcD) defined within the public class called public.The function start at line 184 and ends at 220. It contains 36 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [184.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitDetector
def FitDetector(rings,varyList,parmDict,Print=True,covar=False):'''Fit detector calibration parameters:param np.array rings: vector of ring positions:param list varyList: calibration parameters to be refined:param dict parmDict: all calibration parameters:param bool Print: set to True (default) to print the results:par...
7
30
5
302
41
153
248
153
null
['dtth', 'fmt', 'P', 'cosb', 'dxy', 'names', 'p0', 'zdis', 'sigList', 'vminus', 'tanb', 'd', 'fminus', 'R1', 'R', 'ptstr', 'Rcalc', 'phi0', 'fplus', 'phi', 'M', 'Robs', 'ptlbls', 'parms', 'Q', 'vals', 'R0', 'tbm', 'vplus', 'result', 'chisq', 'ValSig', 'varyDict', 'tbp', 'rsqplus', 'sig', 'stth', 'rsqminus', 'tth', 'sig...
None
null
0
0
0
null
0
null
The function (FitDetector) defined within the public class called public.The function start at line 153 and ends at 248. It contains 30 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [153.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitMultiDist.CalibPrint
def CalibPrint(parmDict,sigDict,chisq,Npts):ptlbls = 'names :'ptstr ='values:'sigstr = 'esds:'for d in sorted(set([i[5:] for i in parmDict.keys() if 'det-X' in i]),key=lambda x:int(x)):fmt = '%12.3f'for key in 'det-X','det-Y','delta':name = key+dif name not in parmDict: continueptlbls += "%12s" % nameptstr += fmt % (pa...
15
55
4
320
0
262
317
262
null
[]
None
null
0
0
0
null
0
null
The function (FitMultiDist.CalibPrint) defined within the public class called public.The function start at line 262 and ends at 317. It contains 55 lines of code and it has a cyclomatic complexity of 15. It takes 4 parameters, represented as [262.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitMultiDist.ellipseCalcD
def ellipseCalcD(B,xyd,varyList,parmDict):x,y,dist,dsp = xydvaryDict = dict(zip(varyList,B))parms = {}for parm in parmDict:if parm in varyList:parms[parm] = varyDict[parm]else:parms[parm] = parmDict[parm]# create arrays with detector center valuesdetX = np.array([parms['det-X'+str(int(d))] for d in dist])detY = np.arra...
7
41
4
538
0
319
361
319
null
[]
None
null
0
0
0
null
0
null
The function (FitMultiDist.ellipseCalcD) defined within the public class called public.The function start at line 319 and ends at 361. It contains 41 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [319.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitMultiDist
def FitMultiDist(rings,varyList,parmDict,Print=True,covar=False):'''Fit detector calibration parameters with multi-distance data:param np.array rings: vector of ring positions (x,y,dist,d-space):param list varyList: calibration parameters to be refined:param dict parmDict: calibration parameters:param bool Print: set t...
6
19
5
228
42
250
378
250
null
['dtth', 'fmt', 'P', 'cosb', 'names', 'dxy', 'p0', 'zdis', 'vminus', 'tanb', 'deltaDist', 'd', 'fminus', 'R1', 'R', 'ptstr', 'Rcalc', 'phi0', 'detY', 'fplus', 'phi', 'detX', 'Robs', 'ptlbls', 'parms', 'Q', 'vals', 'name', 'tbm', 'R0', 'vplus', 'result', 'chisq', 'sigDict', 'varyDict', 'tbp', 'rsqplus', 'sig', 'stth', '...
None
null
0
0
0
null
0
null
The function (FitMultiDist) defined within the public class called public.The function start at line 250 and ends at 378. It contains 19 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [250.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImageLocalMax
def ImageLocalMax(image,w,Xpix,Ypix):'Needs a doc string'w2 = w*2sizey,sizex = image.shapexpix = int(Xpix)#get reference corner of pixel chosenypix = int(Ypix)if not w:ZMax = np.sum(image[ypix-2:ypix+2,xpix-2:xpix+2])return xpix,ypix,ZMax,0.0001if (w2 < xpix < sizex-w2) and (w2 < ypix < sizey-w2) and image[ypix,xpix]:Z...
5
19
4
211
7
380
398
380
null
['Zmax', 'xpix', 'ypix', 'w2', 'ZMin', 'Zmin', 'ZMax']
None
null
0
0
0
null
0
null
The function (ImageLocalMax) defined within the public class called public.The function start at line 380 and ends at 398. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [380.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makeRing.ellipseC
def ellipseC():'compute estimate of ellipse circumference'if radii[0] <= 0:#hyperbolaif debug: theta = npacosd(1./np.sqrt(1.+(radii[0]/radii[1])**2))print ('hyperbola:',theta)return 720.apb = radii[1]+radii[0]amb = radii[1]-radii[0]return np.pi*apb*(1+3*(amb/apb)**2/(10+np.sqrt(4-3*(amb/apb)**2)))
3
10
0
117
0
402
411
402
null
[]
None
null
0
0
0
null
0
null
The function (makeRing.ellipseC) defined within the public class called public.The function start at line 402 and ends at 411. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
makeRing
def makeRing(dsp,ellipse,pix,reject,scalex,scaley,image,mul=1):'Needs a doc string'def ellipseC():'compute estimate of ellipse circumference'if radii[0] <= 0:#hyperbolaif debug: theta = npacosd(1./np.sqrt(1.+(radii[0]/radii[1])**2))print ('hyperbola:',theta)return 720.apb = radii[1]+radii[0]amb = radii[1]-radii[0]retur...
9
34
8
301
13
400
442
400
null
['Y', 'ring', 'apb', 'azm', 'a', 'x', 'sphi', 'y', 'amb', 'C', 'theta', 'cphi', 'X']
None
null
0
0
0
null
0
null
The function (makeRing) defined within the public class called public.The function start at line 400 and ends at 442. It contains 34 lines of code and it has a cyclomatic complexity of 9. It takes 8 parameters, represented as [400.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetEllipse2
def GetEllipse2(tth,dxy,dist,cent,tilt,phi):'''uses Dandelin spheres to find ellipse or hyperbola parameters from detector geometryon outputradii[0] (b-minor axis) set < 0. for hyperbola'''radii = [0,0,0]stth = sind(tth)cosb = cosd(tilt)tanb = tand(tilt)tbm = tand((tth-tilt)/2.)tbp = tand((tth+tilt)/2.)sinb = sind(tilt...
3
32
6
421
18
444
482
444
null
['fminus', 'elcent', 'tanb', 'cosb', 'sinb', 'v', 'tbp', 'eps', 'zdis', 'stth', 'vminus', 'f', 'tbm', 'fplus', 'delt', 'vplus', 'radii', 'd']
None
null
0
0
0
null
0
null
The function (GetEllipse2) defined within the public class called public.The function start at line 444 and ends at 482. It contains 32 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [444.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetEllipse
def GetEllipse(dsp,data):'''uses Dandelin spheres to find ellipse or hyperbola parameters from detector geometryas given in image controls dictionary (data) and a d-spacing (dsp)'''cent = data['center']tilt = data['tilt']phi = data['rotation']dep = data.get('DetDepth',0.0)tth = 2.0*asind(data['wavelength']/(2.*dsp))dis...
1
9
2
89
7
484
495
484
null
['dist', 'dxy', 'tilt', 'cent', 'phi', 'tth', 'dep']
None
null
0
0
0
null
0
null
The function (GetEllipse) defined within the public class called public.The function start at line 484 and ends at 495. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [484.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
LinePlaneCollision
def LinePlaneCollision(planeNormal, planePoint, rayDirection, rayPoint, epsilon=1e-6): ndotu = planeNormal.dot(rayDirection) if ndotu < epsilon: return None w = rayPoint - planePoint si = -planeNormal.dot(w) / ndotu Psi = w + si * rayDirection + planePoint return Psi
2
8
5
59
4
497
505
497
null
['si', 'ndotu', 'Psi', 'w']
None
null
0
0
0
null
0
null
The function (LinePlaneCollision) defined within the public class called public.The function start at line 497 and ends at 505. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [497.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDetSamAngle.costth
def costth(xyz,d0):''' compute cos of angle between vectors; xyz not normalized, d0 normalized'''u = xyz/nl.norm(xyz,axis=-1)[:,:,nxs]return np.dot(u,d0)
1
3
2
39
0
508
511
508
null
[]
None
null
0
0
0
null
0
null
The function (GetDetSamAngle.costth) defined within the public class called public.The function start at line 508 and ends at 511. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [508.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDetSamAngle
def GetDetSamAngle(x,y,data):def costth(xyz,d0):''' compute cos of angle between vectors; xyz not normalized, d0 normalized'''u = xyz/nl.norm(xyz,axis=-1)[:,:,nxs]return np.dot(u,d0)#zero detector 2-theta: tested with tilted images - perfect integrationsdx = x-data['center'][0]dy = y-data['center'][1]tilt = data['tilt'...
1
15
3
165
12
507
525
507
null
['dxyz0', 'dist', 'ctth0', 'd001', 'R', 'dx', 'u', 'MN', 'tilt', 'r001', 'T', 'dy']
None
null
0
0
0
null
0
null
The function (GetDetSamAngle) defined within the public class called public.The function start at line 507 and ends at 525. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [507.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDetectorXY
def GetDetectorXY(dsp,azm,data):'''Get detector x,y position from d-spacing (dsp), azimuth (azm,deg)& image controls dictionary (data) - new version'''dist = data['distance']/npcosd(data['tilt'])#sample-beam intersection point on detector planecent = data['center']phi = data['rotation']T = makeMat(data['tilt'],0) #rota...
2
20
3
265
13
527
549
527
null
['dist', 'R', 'iMN', 'dorig', 'xyz', 'MN', 'dxyzN', 'cent', 'T', 'vect', 'phi', 'dxyzO', 'tth']
None
null
0
0
0
null
0
null
The function (GetDetectorXY) defined within the public class called public.The function start at line 527 and ends at 549. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [527.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzmDsp2
def GetTthAzmDsp2(x,y,data): #expensive'''Computes a 2theta, etc. from a detector position and calibration constants - checkedOK for ellipses & hyperbola.Use only for detector 2-theta = 0:returns: np.array(tth,azm,dsp) where tth is 2theta, azm is the azimutal angle, and dsp is the d-space - not used in integration'''wa...
1
21
3
284
17
551
578
551
null
['dist', 'Z', 'DY', 'dx', 'dxy', 'dsp', 'azmthoff', 'tilt', 'cent', 'azm', 'wave', 'phi', 'DX', 'dy', 'tth', 'dep', 'X']
None
null
0
0
0
null
0
null
The function (GetTthAzmDsp2) defined within the public class called public.The function start at line 551 and ends at 578. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [551.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzmDsp.costth
def costth(xyz):u = xyz/nl.norm(xyz,axis=-1)[:,:,nxs]return np.dot(u,np.array([0.,0.,1.]))
1
3
1
50
0
589
591
589
null
[]
None
null
0
0
0
null
0
null
The function (GetTthAzmDsp.costth) defined within the public class called public.The function start at line 589 and ends at 591. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzmDsp
def GetTthAzmDsp(x,y,data): #expensive'''Computes a 2theta, etc. from a detector position and calibration constants - checkedOK for ellipses & hyperbola.Use for detector 2-theta != 0.:returns: np.array(tth,azm,dsp) where tth is 2theta, azm is the azimutal angle,and dsp is the d-space - only used for non-zero detector 2...
3
27
3
284
19
580
619
580
null
['dxyz0', 'dist', 'MN', 'wave', 'dy', 'R', 'u', 'ctth', 'dzp', 'dsp', 'tilt', 'azm', 'dxyz', 'ctth0', 'tth0', 'dx', 'T', 'tthMat', 'tth']
None
null
0
0
0
null
0
null
The function (GetTthAzmDsp) defined within the public class called public.The function start at line 580 and ends at 619. It contains 27 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [580.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTth
def GetTth(x,y,data):'Give 2-theta value for detector x,y position; calibration info in data'if data['det2theta']:return GetTthAzmDsp(x,y,data)[0]else:return GetTthAzmDsp2(x,y,data)[0]
2
6
3
42
0
621
626
621
null
[]
None
null
0
0
0
null
0
null
The function (GetTth) defined within the public class called public.The function start at line 621 and ends at 626. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [621.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzm
def GetTthAzm(x,y,data):'Give 2-theta, azimuth values for detector x,y position; calibration info in data'if data['det2theta']:return GetTthAzmDsp(x,y,data)[0:2]else:return GetTthAzmDsp2(x,y,data)[0:2]
2
6
3
46
0
628
633
628
null
[]
None
null
0
0
0
null
0
null
The function (GetTthAzm) defined within the public class called public.The function start at line 628 and ends at 633. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [628.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetDsp
def GetDsp(x,y,data):'Give d-spacing value for detector x,y position; calibration info in data'if data['det2theta']:return GetTthAzmDsp(x,y,data)[2]else:return GetTthAzmDsp2(x,y,data)[2]
2
6
3
42
0
635
640
635
null
[]
None
null
0
0
0
null
0
null
The function (GetDsp) defined within the public class called public.The function start at line 635 and ends at 640. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [635.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetAzm
def GetAzm(x,y,data):'Give azimuth value for detector x,y position; calibration info in data'if data['det2theta']:return GetTthAzmDsp(x,y,data)[1]else:return GetTthAzmDsp2(x,y,data)[1]
2
6
3
42
0
642
647
642
null
[]
None
null
0
0
0
null
0
null
The function (GetAzm) defined within the public class called public.The function start at line 642 and ends at 647. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [642.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzmG.costth
def costth(xyz,d0):''' compute cos of angle between vectors; xyz not normalized, d0 normalized'''u = xyz/nl.norm(xyz,axis=-1)[:,:,nxs]return np.dot(u,d0)
1
3
2
39
0
656
659
656
null
[]
None
null
0
0
0
null
0
null
The function (GetTthAzmG.costth) defined within the public class called public.The function start at line 656 and ends at 659. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [656.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetTthAzmG
def GetTthAzmG(x,y,data):'''Give 2-theta, azimuth & geometric corr. values for detector x,y position; calibration info in data - only used in integration for detector 2-theta != 0. checked OK for ellipses & hyperbola This is the slow step in image integration '''def costth(xyz,d0):''' compute cos of angle between vecto...
3
28
3
320
20
650
688
650
null
['dxyz0', 'dist', 'MN', 'dy', 'd001', 'R', 'u', 'ctth', 'dzp', 'tilt', 'r001', 'azm', 'dxyz', 'ctth0', 'tth0', 'dx', 'T', 'G', 'tthMat', 'tth']
None
null
0
0
0
null
0
null
The function (GetTthAzmG) defined within the public class called public.The function start at line 650 and ends at 688. It contains 28 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [650.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
meanAzm
def meanAzm(a,b):AZM = lambda a,b: npacosd(0.5*(npsind(2.*b)-npsind(2.*a))/(np.pi*(b-a)/180.))/2.azm = AZM(a,b)return azm
1
4
2
66
2
690
693
690
null
['azm', 'AZM']
None
null
0
0
0
null
0
null
The function (meanAzm) defined within the public class called public.The function start at line 690 and ends at 693. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [690.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImageCompress
def ImageCompress(image,scale):''' Reduces size of image by selecting every n'th pointparam: image array: original imageparam: scale int: intervsl between selected pointsreturns: array: reduced size image'''if scale == 1:return imageelse:return image[::scale,::scale]
2
5
2
26
0
695
704
695
null
[]
None
null
0
0
0
null
0
null
The function (ImageCompress) defined within the public class called public.The function start at line 695 and ends at 704. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [695.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
checkEllipse
def checkEllipse(Zsum,distSum,xSum,ySum,dist,x,y):'Needs a doc string'avg = np.array([distSum/Zsum,xSum/Zsum,ySum/Zsum])curr = np.array([dist,x,y])return abs(avg-curr)/avg < .02
1
5
7
64
2
706
710
706
null
['curr', 'avg']
None
null
0
0
0
null
0
null
The function (checkEllipse) defined within the public class called public.The function start at line 706 and ends at 710. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [706.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
GetLineScan
def GetLineScan(image,data):Nx,Ny = data['size']pixelSize = data['pixelSize']scalex = 1000./pixelSize[0] #microns --> 1/mmscaley = 1000./pixelSize[1]wave = data['wavelength']numChans = data['outChannels']LUtth = np.array(data['IOtth'],dtype=float)azm = data['linescan'][1]-data['azmthOff']Tx = np.array([tth for tth in n...
3
26
2
329
15
712
737
712
null
['Tx', 'Ty', 'Xpix', 'xpix', 'LUtth', 'dsp', 'ypix', 'scalex', 'numChans', 'azm', 'wave', 'xy', 'pixelSize', 'Ypix', 'scaley']
None
null
0
0
0
null
0
null
The function (GetLineScan) defined within the public class called public.The function start at line 712 and ends at 737. It contains 26 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [712.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
EdgeFinder
def EdgeFinder(image,data):'''this makes list of all x,y where I>edgeMin suitable for an ellipse search?Not currently used but might be useful in future?'''import numpy.ma as maNx,Ny = data['size']pixelSize = data['pixelSize']edgemin = data['edgemin']scalex = pixelSize[0]/1000.scaley = pixelSize[1]/1000.tay,tax = np.mg...
1
14
2
168
7
739
755
739
null
['edgemin', 'tax', 'tay', 'scalex', 'pixelSize', 'tam', 'scaley']
None
null
0
0
0
null
0
null
The function (EdgeFinder) defined within the public class called public.The function start at line 739 and ends at 755. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [739.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CalcRings
def CalcRings(G2frame,ImageZ,data,masks):''' '''pixelSize = data['pixelSize']scalex = 1000./pixelSize[0]scaley = 1000./pixelSize[1]data['rings'] = []data['ellipses'] = []if not data['calibrant']:G2fil.G2Print ('warning: no calibration material selected')returnskip = data['calibskip']dmin = data['calibdmin']if data['cal...
14
47
4
443
16
757
804
757
null
['absent', 'Ring', 'hkl', 'calibrant', 'dmin', 'frame', 'tam', 'dsp', 'scalex', 'ellipse', 'skip', 'HKL', 'pixelSize', 'SGData', 'A', 'scaley']
None
null
0
0
0
null
0
null
The function (CalcRings) defined within the public class called public.The function start at line 757 and ends at 804. It contains 47 lines of code and it has a cyclomatic complexity of 14. It takes 4 parameters, represented as [757.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImageRecalibrate
def ImageRecalibrate(G2frame,ImageZ,data,masks,getRingsOnly=False):'''Called to repeat the calibration on an image, usually called aftercalibration is done initially to improve the fit, but alsocan be used after reading approximate calibration parameters,if they are close enough that the first ring can be found.:param ...
26
95
5
885
25
806
913
806
null
['absent', 'rings', 'N', 'HKL', 'pixelSize', 'hkl', 'ellipse', 'SGData', 'Ring', 'parmDict', 'dmin', 'varyList', 'frame', 'Found', 'dsp', 'scalex', 'skip', 'hyperbola', 'cutoff', 'tam', 'A', 'calibrant', 'pixLimit', 'time0', 'scaley']
None
null
0
0
0
null
0
null
The function (ImageRecalibrate) defined within the public class called public.The function start at line 806 and ends at 913. It contains 95 lines of code and it has a cyclomatic complexity of 26. It takes 5 parameters, represented as [806.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImageCalibrate
def ImageCalibrate(G2frame,data):'''Called to perform an initial image calibration after points have beenselected for the inner ring.Called only from ``OnImRelease`` (mouse release) in:func:`GSASIIplot.PlotImage`, thus expected to be used from GUIonly (not scripted)'''from . import GSASIIplot as G2pltG2fil.G2Print ('Im...
35
187
2
2,027
50
915
1,127
915
null
['dist', 'fmt', 'rings', 'tiltp', 'centm', 'i2', 'N', 'HKL', 'wave', 'pixelSize', 'ring', 'fail', 'Ringp', 'hkl', 'ellipsep', 'tiltm', 'ellipse', 'chip', 'SGData', 'Ring', 'ttth', 'ctth', 'zdisp', 'parmDict', 'dmin', 'varyList', 'chim', 'dsp', 'fullSize', 'scalex', 'tilt', 'skip', 'Ringm', 'outE', 'phim', 'cutoff', 'A'...
None
null
0
0
0
null
0
null
The function (ImageCalibrate) defined within the public class called public.The function start at line 915 and ends at 1127. It contains 187 lines of code and it has a cyclomatic complexity of 35. It takes 2 parameters, represented as [915.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Make2ThetaAzimuthMap
def Make2ThetaAzimuthMap(data,iLim,jLim): #most expensive part of integration!'''Makes a set of matrices that provide the 2-theta, azimuth and geometriccorrection values for each pixel in an image taking into account thedetector orientation. Can be used for the entire image or a rectangularsection of an image (determin...
1
14
3
255
8
1,129
1,159
1,129
null
['nJ', 'TA', 'scaley', 'tax', 'nI', 'scalex', 'pixelSize', 'tay']
None
null
0
0
0
null
0
null
The function (Make2ThetaAzimuthMap) defined within the public class called public.The function start at line 1129 and ends at 1159. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [1129.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
polymask
def polymask(data,Poly,Spots=[]):''' Applies spot(point), polygon& frame masks via calls to matplotlib routines; should be called only once each during image processing. A separate call is used for a frame.Individual masked blocks are then pulled from the output array.:param dict data: GSAS-II image data object (descri...
6
36
3
372
13
1,161
1,207
1,161
null
['rad', 'Zimg', 'inmask', 'px', 'py', 'scalex', 'figure', 'outmask', 'ax0', 'pixelSize', 'canvas', 'psp', 'scaley']
None
null
0
0
0
null
0
null
The function (polymask) defined within the public class called public.The function start at line 1161 and ends at 1207. It contains 36 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [1161.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeMaskMap
def MakeMaskMap(data,masks,iLim,jLim):'''Makes a mask array from masking parameters that are not determined by image calibration parameters or the image intensities. Thus this uses mask Frames, Polygons, Points, and Lines settings (but not Thresholds, Rings orArcs). Used on a rectangular section of an image (must be 10...
11
31
4
421
10
1,209
1,252
1,209
null
['nJ', 'frame', 'tax', 'nI', 'poly', 'tay', 'scalex', 'pixelSize', 'tam', 'scaley']
None
null
0
0
0
null
0
null
The function (MakeMaskMap) defined within the public class called public.The function start at line 1209 and ends at 1252. It contains 31 lines of code and it has a cyclomatic complexity of 11. It takes 4 parameters, represented as [1209.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
Fill2ThetaAzimuthMap
def Fill2ThetaAzimuthMap(masks,TAr,tam,image,ringMask=False):'''Makes masked intensity correction arrays that depend on imageintensity, 2theta and azimuth. Masking is generated from thecombination of the following:an array previously generated by :func:`MakeMaskMap` combined withThresholds, Rings and Arcs mask input.Th...
5
20
5
263
3
1,254
1,313
1,254
null
['mask', 'Zlim', 'image']
None
null
0
0
0
null
0
null
The function (Fill2ThetaAzimuthMap) defined within the public class called public.The function start at line 1254 and ends at 1313. It contains 20 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [1254.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeUseTA
def MakeUseTA(data,blkSize=128):'''Precomputes the set of blocked arrays for 2theta-azimuth mapping fromthe controls settings of the current image for image integration.This computation is done optionally, but provides speed as the resultsfrom this can be cached to avoid recomputation for a series of imageswith the sam...
4
18
2
191
10
1,315
1,342
1,315
null
['TA', 'iBeg', 'iFin', 'nXBlks', 'TAr', 'nYBlks', 'useTA', 'useTAj', 'jBeg', 'jFin']
None
null
0
0
0
null
0
null
The function (MakeUseTA) defined within the public class called public.The function start at line 1315 and ends at 1342. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [1315.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeUseMask
def MakeUseMask(data,masks,blkSize=128):'''Precomputes a set of blocked mask arrays for the mask elementsthat do not depend on the instrument controls (see :func:`MakeMaskMap`).This computation is done optionally, but provides speed as the resultsfrom this can be cached to avoid recomputation for a series of imageswith...
3
17
3
132
10
1,344
1,370
1,344
null
['iBeg', 'iFin', 'useMaskj', 'useMask', 'nXBlks', 'nYBlks', 'mask', 'jBeg', 'jFin', 'Masks']
None
null
0
0
0
null
0
null
The function (MakeUseMask) defined within the public class called public.The function start at line 1344 and ends at 1370. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1344.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeGainMap
def MakeGainMap(image,Ix,Iy,data,mask,blkSize=128):Iy *= npcosd(Ix[:-1])**2 #undo parallaxIy /= np.array(G2pwd.Polarization(data['PolaVal'][0],Ix[:-1],0.)[0])#undo polarizationif data['Oblique'][1]:Iy *= G2pwd.Oblique(data['Oblique'][0],Ix[:-1]) #undo penetrationIyInt = scint.interp1d(Ix[:-1],Iy[0],bounds_error=False)G...
4
24
6
321
12
1,372
1,396
1,372
null
['TA', 'iBeg', 'iFin', 'GainMap', 'nXBlks', 'Ipix', 'IyInt', 'Mask', 'nYBlks', 'jBeg', 'jFin', 'tam']
None
null
0
0
0
null
0
null
The function (MakeGainMap) defined within the public class called public.The function start at line 1372 and ends at 1396. It contains 24 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [1372.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
AzimuthIntegrate
def AzimuthIntegrate(image,data,masks,ringId,blkSize=1024):''' Integrate by azimuth around the ring masked region in 0.5 deg steps'''if GSASIIpath.binaryPath:import histogram2d as h2delse:from . import histogram2d as h2dLRazm = np.array(data['LRazimuth'],dtype=np.float64)numAzms = 720ring = masks['Rings'][ringId]Dazm =...
7
43
5
586
23
1,398
1,442
1,398
null
['dtth', 'TA', 'iBeg', 'iFin', 'Block', 'numAzms', 'NST', 'nYBlks', 'Azms', 'jFin', 'ring', 'Dazm', 'nXBlks', 'TAr', 'LUtth', 'AMasks', 'muT', 'tabs', 'LRazm', 'H0', 'jBeg', 'tam', 'taz']
None
null
0
0
0
null
0
null
The function (AzimuthIntegrate) defined within the public class called public.The function start at line 1398 and ends at 1442. It contains 43 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [1398.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
ImageIntegrate
def ImageIntegrate(image,data,masks,blkSize=128,returnN=False,useTA=None,useMask=None):'''Integrate an image; called from ``OnIntegrate()`` and``OnIntegrateAll()`` inside :func:`GSASIIimgGUI.UpdateImageControls`as well as :meth:`GSASIIscriptable.G2Image.Integrate`.:param np.array image: contains the 2-D image:param np....
31
116
7
1,455
37
1,444
1,596
1,444
null
['dtth', 'times', 'h0', 'TA', 'iBeg', 'iFin', 't0', 'Block', 'tax', 'numAzms', 'NST', 'nYBlks', 'h0int', 'jFin', 'msg', 'tbeg', 'Dazm', 'nXBlks', 'TAr', 'LUtth', 'H2msk', 'muT', 'lutth', 'Masks', 'CancelPressed', 'H1', 'tabs', 'LRazm', 'H0', 'H0msk', 'jBeg', 'problemEntries', 'tam', 'taz', 'H2', 'numChans', 'tay']
None
null
0
0
0
null
0
null
The function (ImageIntegrate) defined within the public class called public.The function start at line 1444 and ends at 1596. It contains 116 lines of code and it has a cyclomatic complexity of 31. It takes 7 parameters, represented as [1444.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
MakeStrStaRing
def MakeStrStaRing(ring,Image,Controls):ellipse = GetEllipse(ring['Dset'],Controls)pixSize = Controls['pixelSize']scalex = 1000./pixSize[0]scaley = 1000./pixSize[1]Ring = np.array(makeRing(ring['Dset'],ellipse,ring['pixLimit'],ring['cutoff'],scalex,scaley,Image)[0]).T #returns x,y,dsp for each point in ringif len(Ring)...
2
20
3
229
6
1,598
1,617
1,598
null
['TA', 'scalex', 'ellipse', 'pixSize', 'Ring', 'scaley']
None
null
0
0
0
null
0
null
The function (MakeStrStaRing) defined within the public class called public.The function start at line 1598 and ends at 1617. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [1598.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitStrSta
def FitStrSta(Image,StrSta,Controls):'Needs a doc string'StaControls = copy.deepcopy(Controls)phi = StrSta['Sample phi']wave = Controls['wavelength']pixelSize = Controls['pixelSize']scalex = 1000./pixelSize[0]scaley = 1000./pixelSize[1]StaType = StrSta['Type']StaControls['distance'] += StrSta['Sample z']*cosd(phi)for r...
4
28
3
292
11
1,619
1,648
1,619
null
['StaControls', 'dset', 'StaType', 'p0', 'scalex', 'ellipse', 'ringint', 'wave', 'phi', 'pixelSize', 'scaley']
None
null
0
0
0
null
0
null
The function (FitStrSta) defined within the public class called public.The function start at line 1619 and ends at 1648. It contains 28 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [1619.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
IntStrSta
def IntStrSta(Image,StrSta,Controls):StaControls = copy.deepcopy(Controls)pixelSize = Controls['pixelSize']scalex = 1000./pixelSize[0]scaley = 1000./pixelSize[1]phi = StrSta['Sample phi']StaControls['distance'] += StrSta['Sample z']*cosd(phi)RingsAI = []for ring in StrSta['d-zero']: #get observed x,y,d points for the d...
5
27
3
371
12
1,650
1,676
1,650
null
['StaControls', 'XY', 'RingsAI', 'tabs', 'ringint', 'scalex', 'ellipse', 'phi', 'pixelSize', 'muT', 'pola', 'scaley']
None
null
0
0
0
null
0
null
The function (IntStrSta) defined within the public class called public.The function start at line 1650 and ends at 1676. It contains 27 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [1650.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
CalcStrSta
def CalcStrSta(StrSta,Controls):wave = Controls['wavelength']phi = StrSta['Sample phi']StaType = StrSta['Type']for ring in StrSta['d-zero']:Eij = ring['Emat']E = [[Eij[0],Eij[1],0],[Eij[1],Eij[2],0],[0,0,0]]th,azm = ring['ImtaObs']th0 = np.ones_like(azm)*npasind(wave/(2.*ring['Dset']))V = -np.sum(np.sum(E*calcFij(90.,p...
5
23
2
315
9
1,678
1,701
1,678
null
['th0', 'dmax', 'dmin', 'StaType', 'V', 'E', 'wave', 'phi', 'Eij']
None
null
0
0
0
null
0
null
The function (CalcStrSta) defined within the public class called public.The function start at line 1678 and ends at 1701. It contains 23 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [1678.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
calcFij
def calcFij(omg,phi,azm,th):'''Uses parameters as defined by Bob He & Kingsley Smith, Adv. in X-Ray Anal. 41, 501 (1997):param omg: his omega = sample omega rotation; 0 when incident beam || sample surface,90 when perp. to sample surface:param phi: his phi = sample phi rotation; usually = 0, axis rotates with omg.:para...
1
11
4
159
6
1,703
1,721
1,703
null
['e', 'a', 'Fij', 'c', 'b', 'd']
None
null
0
0
0
null
0
null
The function (calcFij) defined within the public class called public.The function start at line 1703 and ends at 1721. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1703.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitStrain.StrainPrint
def StrainPrint(ValSig,dset):print ('Strain tensor for Dset: %.6f'%(dset))ptlbls = 'names :'ptstr ='values:'sigstr = 'esds:'for name,fmt,value,sig in ValSig:ptlbls += "%s" % (name.rjust(12))ptstr += fmt % (value)if sig:sigstr += fmt % (sig)else:sigstr += 12*' 'print (ptlbls)print (ptstr)print (sigstr)
3
15
2
83
0
1,725
1,739
1,725
null
[]
None
null
0
0
0
null
0
null
The function (FitStrain.StrainPrint) defined within the public class called public.The function start at line 1725 and ends at 1739. It contains 15 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1725.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitStrain.strainCalc
def strainCalc(p,xyd,dset,wave,phi,StaType):E = np.array([[p[0],p[1],0],[p[1],p[2],0],[0,0,0]])dspo,azm,dsp = xydth = npasind(wave/(2.0*dspo))V = -np.sum(np.sum(E*calcFij(90.,phi,azm,th).T/1.e6,axis=2),axis=1)if StaType == 'True':dspc = dset*np.exp(V)else:dspc = dset*(V+1.)return dspo-dspc
2
10
6
151
0
1,741
1,750
1,741
null
[]
None
null
0
0
0
null
0
null
The function (FitStrain.strainCalc) defined within the public class called public.The function start at line 1741 and ends at 1750. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [1741.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitStrain
def FitStrain(rings,p0,dset,wave,phi,StaType):'Fits external strain tensor from distortion of Bragg rings in images'def StrainPrint(ValSig,dset):print ('Strain tensor for Dset: %.6f'%(dset))ptlbls = 'names :'ptstr ='values:'sigstr = 'esds:'for name,fmt,value,sig in ValSig:ptlbls += "%s" % (name.rjust(12))ptstr += fmt %...
1
15
6
156
16
1,723
1,762
1,723
null
['chisq', 'fmt', 'covM', 'ValSig', 'dspc', 'ptlbls', 'vals', 'covMatrix', 'ptstr', 'names', 'sig', 'V', 'th', 'E', 'result', 'sigstr']
None
null
0
0
0
null
0
null
The function (FitStrain) defined within the public class called public.The function start at line 1723 and ends at 1762. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [1723.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitImageSpots.calcMean
def calcMean(nxy,pixSize,img):gdx,gdy = np.mgrid[0:nxy,0:nxy]gdx = ma.array((gdx-nxy//2)*pixSize[0]/1000.,mask=~ma.getmaskarray(ImBox))gdy = ma.array((gdy-nxy//2)*pixSize[1]/1000.,mask=~ma.getmaskarray(ImBox))posx = ma.sum(gdx)/ma.count(gdx)posy = ma.sum(gdy)/ma.count(gdy)return posx,posy
1
7
3
81
0
1,767
1,773
1,767
null
[]
None
null
0
0
0
null
0
null
The function (FitImageSpots.calcMean) defined within the public class called public.The function start at line 1767 and ends at 1773. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [1767.0] and does not return any value..
AdvancedPhotonSource_GSAS-II
public
public
0
0
FitImageSpots.calcPeak
def calcPeak(values,nxy,pixSize,img):back,mag,px,py,sig = valuespeak = np.zeros([nxy,nxy])+backnor = 1./(2.*np.pi*sig**2)gdx,gdy = np.mgrid[0:nxy,0:nxy]gdx = (gdx-nxy//2)*pixSize[0]/1000.gdy = (gdy-nxy//2)*pixSize[1]/1000.arg = (gdx-px)**2+(gdy-py)**2peak += mag*nor*np.exp(-arg/(2.*sig**2))return ma.compressed(img-peak...
1
10
4
143
0
1,775
1,784
1,775
null
[]
None
null
0
0
0
null
0
null
The function (FitImageSpots.calcPeak) defined within the public class called public.The function start at line 1775 and ends at 1784. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1775.0] and does not return any value..