pyFAI 2023.2 breaks the CalibrateMulti task
Traceback: https://gitlab.esrf.fr/workflow/ewoksapps/ewoksxrpd/-/jobs/577307
Summary of the code in CalibrateMulti
calibrant = pyFAI.calibrant.get_calibrant("...")
setup = pyFAI.goniometer.GoniometerRefinement(
initial_guess,
pos_function=lambda x: x,
trans_function=trans_function,
detector=detector,
wavelength=wavelength0,
)
for i, (image, xi) in enumerate(zip(self.inputs.images, self.inputs.positions)):
label = f"position{i}"
setup.new_geometry(label, image=image, metadata=xi, calibrant=calibrant)
for setup_single_dist in setup.single_geometries.values():
setup_single_dist.extract_cp() <<< FAILS with IndexError
Code in pyfai that fails
def extract_cp(self, max_rings=None, pts_per_deg=1.0, Imin=0):
tth = numpy.array([i for i in self.calibrant.get_2th() if i is not None]) <<< "Cannot calculate 2theta angle without knowing wavelength"
...
tth_max[-1] = delta[-1] <<< IndexError
This commit causes the error:
class SingleGeometry(object):
"""This class represents a single geometry of a detector position on a
goniometer arm
"""
def __init__(self, ...):
...
dict_geo["wavelength"] = self.calibrant.wavelength <<< THIS CHANGED, commenting it makes everything work again
Providing the wavelength to GoniometerRefinement
used to be enough. Now it also has to be provided to the calibrant object? @jerome.kieffer Can you comment?
Edited by Wout De Nolf