From 9e82d8f20223ebfcf1267972c4bc7910e15a545d Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Wed, 22 Apr 2020 16:44:20 +0200 Subject: [PATCH] Revert "Make input parameters explicit" This reverts commit 56d33c6165bbf56f8ad889cffe43e4f4fd1a7240. --- pyzebra/xtal.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pyzebra/xtal.py b/pyzebra/xtal.py index 6030ee3..e6c73ea 100644 --- a/pyzebra/xtal.py +++ b/pyzebra/xtal.py @@ -340,25 +340,23 @@ def ang2hkl(wave, ddist, gammad, om, ch, ph, nud, ub, x, y): return hkl -def gauss(x, A, mu, sigma): +def gauss(x, *p): """Defines Gaussian function Args: - A - amplitude - mu - position of the center - sigma - width + A - amplitude, mu - position of the center, sigma - width Returns: Gaussian function """ + A, mu, sigma = p return A*np.exp(-(x-mu)**2/(2.*sigma**2)) -def box_int(file,i0,j0,iN,jN,fr0,frN): +def box_int(file,box): """Calculates center of the peak in the NB-geometry angles and Intensity of the peak Args: - file name - box coordinates - i0,j0,iN,jN,fr0,frN + file name, box size [x_min:x_max, y_min:y_max, frame_min:frame_max] Returns: gamma, omPeak, nu polar angles, Int and data for 3 fit plots @@ -371,7 +369,14 @@ def box_int(file,i0,j0,iN,jN,fr0,frN): nuC=dat["tlt_angle"][0] ddist=dat["ddist"] -# defining ranges +# defining indices + i0=box[0] + iN=box[2] + j0=box[1] + jN=box[3] + fr0=box[4] + frN=box[5] + iX=iN-i0 jY=jN-j0 nF=frN-fr0