-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: index 3 is out of bounds for size 0 #267
Comments
On Thu, 24 Mar 2016 07:54:05 -0700
did you refine the wavelength (together with the distance) ? One should define an upper limit on the wavelength to prevent this. Do you have the test images ? Cheers Jérôme Kieffer |
Hello Jerome, I just used the calib method. so it use your default :) Yes I have the test image I can send it to you tomorrow if you want. |
On Thu, 24 Mar 2016 09:59:16 -0700
Si it is actually a bug as the wl should be fixed by default. |
to reproduce the problem here the code, I am using
|
Just for information, I obtained the same issue using directly the pyFAI-calib command line of the debian package root@diffabs6:/home/experiences/instrumentation/picca/Debian/sida/sida# rmadison pyfai mine is the jessie-backports |
In fact the error is not the same Modify parameters (or ? for help)? done |
On Fri, 25 Mar 2016 02:28:51 -0700
This issue is not the same ... Two options: downgrade fabio or upgrade pyFAI. Sorry it is too much work to maintain branches and backport bug-fixes for relaeases Cheers, Jerome |
In Debian I can not downgrad fabio :((. Is it possible to release a new pyFAI with the fix ? if not can you point me to the right commit fix in order to patch the current release. |
I fount this 4328534 right ? |
Can we close this one? |
The initial bug arose from a failing calibration and the wavelength increased ... higher wavelength -> higher 2theta and some rings hit 180° (and disappear). I did smth to limit this but cannot remember if it was completely fixed. An idea would be to take the largest ring number which has to be <180° and define the upper bound for the wavelength in the refinement. |
Hello
I am playing with the calib method, but I get this error message
ipython-input-7-32280c4943ab> in ()
----> 1 calibration.calibration(img, "CeO2", "Xpad_flat", 1.54)
/usr/lib/python2.7/dist-packages/sida/pyfai/calibration.pyc in calibration(img, calibrant_name, detector_name, wavelength)
14 calibrant.wavelength = wavelength
15 detector = get_detector(detector_name)
---> 16 calib(img, calibrant, detector)
/usr/lib/python2.7/dist-packages/pyFAI/calibration.pyc in calib(img, calibrant, detector, basename, reconstruct, dist, gaussian, interactive)
2360 c.peakPicker.gui(log=True, maximize=True, pick=True)
2361 update_fig(c.peakPicker.fig)
-> 2362 c.gui_peakPicker()
2363 c.ai.setPyFAI(**c.geoRef.getPyFAI())
2364 c.ai.wavelength = c.geoRef.wavelength
/usr/lib/python2.7/dist-packages/pyFAI/calibration.pyc in gui_peakPicker(self)
1478 update_fig(self.peakPicker.fig)
1479 # self.peakPicker.finish(self.pointfile, callback=self.set_data)
-> 1480 self.set_data(self.peakPicker.finish(self.pointfile))
1481 # input("Please press enter when you are happy with your selection" + os.linesep)
1482 # while self.data is None:
/usr/lib/python2.7/dist-packages/pyFAI/calibration.pyc in set_data(self, data)
1297 if not self.weighted:
1298 self.data = numpy.array(self.data)[:, :-1]
-> 1299 self.refine()
1300
1301 def reset_geometry(self, how="center", refine=False):
/usr/lib/python2.7/dist-packages/pyFAI/calibration.pyc in refine(self)
1517 calibrant=self.calibrant,
1518 **defaults)
-> 1519 self.geoRef.refine2(1000000, fix=self.fixed)
1520 scor = self.geoRef.chi2()
1521 pars = [getattr(self.geoRef, p) for p in self.PARAMETERS]
/usr/lib/python2.7/dist-packages/pyFAI/geometryRefinement.pyc in refine2(self, maxiter, fix)
284 bounds=bounds,
285 acc=1.0e-12,
--> 286 iprint=(logger.getEffectiveLevel() <= logging.INFO))
287
288 elif self.data.shape[-1] == 4:
/usr/lib/python2.7/dist-packages/scipy/optimize/slsqp.pyc in fmin_slsqp(func, x0, eqcons, f_eqcons, ieqcons, f_ieqcons, bounds, fprime, fprime_eqcons, fprime_ieqcons, args, iter, acc, iprint, disp, full_output, epsilon, callback)
204
205 res = _minimize_slsqp(func, x0, args, jac=fprime, bounds=bounds,
--> 206 constraints=cons, **opts)
207 if full_output:
208 return res['x'], res['fun'], res['nit'], res['status'], res['message']
/usr/lib/python2.7/dist-packages/scipy/optimize/slsqp.pyc in _minimize_slsqp(func, x0, args, jac, bounds, constraints, maxiter, ftol, iprint, disp, eps, callback, **unknown_options)
358
359 # Compute objective function
--> 360 fx = func(x)
361 # Compute the constraints
362 if cons['eq']:
/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.pyc in function_wrapper(_wrapper_args)
279 def function_wrapper(_wrapper_args):
280 ncalls[0] += 1
--> 281 return function(*(wrapper_args + args))
282
283 return ncalls, function_wrapper
/usr/lib/python2.7/dist-packages/pyFAI/geometryRefinement.pyc in residu2(self, param, d1, d2, rings)
221 #dot product is faster ...
222 # return (self.residu1(param, d1, d2, rings) ** 2).sum()
--> 223 t = self.residu1(param, d1, d2, rings)
224 return numpy.dot(t, t)
225
/usr/lib/python2.7/dist-packages/pyFAI/geometryRefinement.pyc in residu1(self, param, d1, d2, rings)
213
214 def residu1(self, param, d1, d2, rings):
--> 215 return self.tth(d1, d2, param) - self.calc_2th(rings, self.wavelength)
216
217 def residu1_wavelength(self, param, d1, d2, rings):
/usr/lib/python2.7/dist-packages/pyFAI/geometryRefinement.pyc in calc_2th(self, rings, wavelength)
210 if wavelength != self.calibrant.wavelength:
211 self.calibrant.setWavelength_change2th(wavelength)
--> 212 return numpy.array(self.calibrant.get_2th(), dtype=numpy.float64)[rings]
213
214 def residu1(self, param, d1, d2, rings):
IndexError: index 3 is out of bounds for size 0
The text was updated successfully, but these errors were encountered: