EasyScience / EasyDiffractionApp

Diffraction data analysis application
https://easydiffraction.org
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Incorrect background interpolation for Co2SiO4 example #188

Closed rozyczko closed 2 years ago

rozyczko commented 2 years ago

Load Co2SiO4 project. The table lists all the background points correctly but the chart is not updated.

Traceback (most recent call last):
  File "D:\projects\easyScience\easyDiffractionApp\easyDiffractionApp\Logic\Background.py", line 115, in updateChartBackground
    self._background_as_obj.y_sorted_points)
  File "D:\projects\easyScience\easyDiffractionApp\easyDiffractionApp\Logic\Plotting1d.py", line 219, in setBackgroundData
    self._setBackgroundDataArrays(self._measured_xarray, interp_func(self._measured_xarray))
  File "C:\Anaconda\envs\easy\lib\site-packages\scipy\interpolate\polyint.py", line 78, in __call__
    y = self._evaluate(x)
  File "C:\Anaconda\envs\easy\lib\site-packages\scipy\interpolate\interpolate.py", line 684, in _evaluate
    below_bounds, above_bounds = self._check_bounds(x_new)
  File "C:\Anaconda\envs\easy\lib\site-packages\scipy\interpolate\interpolate.py", line 716, in _check_bounds
    raise ValueError("A value in x_new is above the interpolation "
ValueError: A value in x_new is above the interpolation range.

This happens on loading one of the pre-made example projects, hence critical status.

rozyczko commented 2 years ago

Fixed by modifying the scipy call