From e63ee75286ff8c6d2a44b4819c37461c1192ec37 Mon Sep 17 00:00:00 2001 From: brycebolin Date: Thu, 11 Oct 2018 15:27:54 -0700 Subject: [PATCH] Update pydis.py fixed some compatibility issues with integers in arrays that were being used to slice arrays ztot should be zi on line 533 --- pydis/pydis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pydis/pydis.py b/pydis/pydis.py index 0356827..83ab95d 100644 --- a/pydis/pydis.py +++ b/pydis/pydis.py @@ -517,8 +517,9 @@ def __onclick__(self,click): (ydata<=popt_tot[2] + popt_tot[3]*bigbox))] yi = np.arange(img.shape[Waxis])[ydata2] + # define the X-bin edges - xbins = np.linspace(0, img.shape[Saxis], nsteps) + xbins = np.linspace(0, img.shape[Saxis], nsteps).astype('int') ybins = np.zeros_like(xbins) for i in range(0,len(xbins)-1): @@ -529,7 +530,7 @@ def __onclick__(self,click): zi = img_sm[xbins[i]:xbins[i+1], ydata2].sum(axis=Saxis) pguess = [np.nanmax(zi), np.nanmedian(zi), yi[np.nanargmax(zi)], 2.] - popt,pcov = curve_fit(_gaus, yi[np.isfinite(ztot)], zi[np.isfinite(ztot)], p0=pguess) + popt,pcov = curve_fit(_gaus, yi[np.isfinite(zi)], zi[np.isfinite(zi)], p0=pguess) # if gaussian fits off chip, then use chip-integrated answer if (popt[2] <= min(ydata)+25) or (popt[2] >= max(ydata)-25):