Interpolate kaput #103

Closed
opened 2023-07-24 08:37:20 +00:00 by saeckech · 1 comment
Member

Ich kann meine Daten nur bedingt interpolieren. Welche Fehlermeldung kommt, hängt von der Art der Interpolation ab (cubic bzw. linear). cubic liefert

24/07/2023 10:24:28 - ERROR - root : Uncaught exception:
Traceback (most recent call last):
File "/tmp/.mount_NMRevaGQn4N4/usr/src/gui_qt/main/management.py", line 766, in interpolate_data
k = self.add(interpolate(self.data[ids], new_x, xlog=xlog, ylog=ylog, kind=mode, extrapolate=True))
File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/math/interpol.py", line 17, in interpolate
f = interp1d(_x, _y, kind=kind, fill_value=fill)
File "/tmp/.mount_NMRevaGQn4N4/usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py", line 546, in init
self._spline = make_interp_spline(xx, yy, k=order,
File "/tmp/.mount_NMRevaGQn4N4/usr/lib/python3/dist-packages/scipy/interpolate/_bsplines.py", line 788, in make_interp_spline
raise ValueError("Expect x to not have duplicates")
ValueError: Expect x to not have duplicates

linear liefert

24/07/2023 10:24:05 - ERROR - root : Uncaught exception:
Traceback (most recent call last):
File "/tmp/.mount_NMRevaGQn4N4/usr/src/gui_qt/main/management.py", line 766, in interpolate_data
k = self.add(interpolate(self.data[ids], new_x, xlog=xlog, ylog=ylog, kind=mode, extrapolate=True))
File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/math/interpol.py", line 29, in interpolate
ret_val.set_data(x=new_x, y=new_y, y_err=None)
File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/data/points.py", line 495, in set_data
self._x, self._y, self._y_err, mask = self._prepare_xy(x, y, y_err)
File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/data/points.py", line 89, in _prepare_xy
raise ValueError(f'y_err ({y_err.shape}) and y ({y.shape}) have different shapes')
ValueError: y_err ((43,)) and y ((16,)) have different shapes

Wenn ich linear interpoliere und 43 Schritte mache, funktioniert es scheinbar. Glaube aber, das war anders vorgesehen.

Ich kann meine Daten nur bedingt interpolieren. Welche Fehlermeldung kommt, hängt von der Art der Interpolation ab (cubic bzw. linear). cubic liefert **24/07/2023 10:24:28 - ERROR - root : Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevaGQn4N4/usr/src/gui_qt/main/management.py", line 766, in interpolate_data k = self.add(interpolate(self.data[ids], new_x, xlog=xlog, ylog=ylog, kind=mode, extrapolate=True)) File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/math/interpol.py", line 17, in interpolate f = interp1d(_x, _y, kind=kind, fill_value=fill) File "/tmp/.mount_NMRevaGQn4N4/usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py", line 546, in __init__ self._spline = make_interp_spline(xx, yy, k=order, File "/tmp/.mount_NMRevaGQn4N4/usr/lib/python3/dist-packages/scipy/interpolate/_bsplines.py", line 788, in make_interp_spline raise ValueError("Expect x to not have duplicates") ValueError: Expect x to not have duplicates** linear liefert **24/07/2023 10:24:05 - ERROR - root : Uncaught exception: Traceback (most recent call last): File "/tmp/.mount_NMRevaGQn4N4/usr/src/gui_qt/main/management.py", line 766, in interpolate_data k = self.add(interpolate(self.data[ids], new_x, xlog=xlog, ylog=ylog, kind=mode, extrapolate=True)) File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/math/interpol.py", line 29, in interpolate ret_val.set_data(x=new_x, y=new_y, y_err=None) File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/data/points.py", line 495, in set_data self._x, self._y, self._y_err, mask = self._prepare_xy(x, y, y_err) File "/tmp/.mount_NMRevaGQn4N4/usr/src/nmreval/data/points.py", line 89, in _prepare_xy raise ValueError(f'y_err ({y_err.shape}) and y ({y.shape}) have different shapes') ValueError: y_err ((43,)) and y ((16,)) have different shapes** Wenn ich linear interpoliere und 43 Schritte mache, funktioniert es scheinbar. Glaube aber, das war anders vorgesehen.
Member

Kubische Interpolation ist vermutlich dein persönliches Problem, weil mehrere Punkte den gleiche x-Wert haben. Den Rest habe ich gefixt.

Kubische Interpolation ist vermutlich dein persönliches Problem, weil mehrere Punkte den gleiche x-Wert haben. Den Rest habe ich gefixt.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IPKM/nmreval#103
No description provided.