Skip to content
Snippets Groups Projects
Commit cbcd24e1 authored by Peter Lünenschloß's avatar Peter Lünenschloß Committed by David Schäfer
Browse files

Poly fit fix

parent eaaba441
No related branches found
No related tags found
5 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!547Poly fit fix
......@@ -24,6 +24,7 @@ This changelog starts with version 2.0.0. Basically all parts of the system, inc
- fixed failing translation of `dfilter`-defaults
- fixed unbound recursion error when interpolating with order-independent methods in `interpolateIndex`
- fixed not working min_periods condition if `window=None` in `assignZScore`
- fixed Exception occuring when fitting polynomials via `polyfit` to harmonized data, containing all-NaN gaps wider than the polynomial fitting window size.
## [2.1.0](https://git.ufz.de/rdm-software/saqc/-/tags/v2.0.1) - 2022-06-14
[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.0.1...v2.1.0)
......
......@@ -558,6 +558,8 @@ def polyRoller(in_slice, miss_marker, val_range, center_index, poly_deg):
miss_mask = in_slice == miss_marker
x_data = val_range[~miss_mask]
y_data = in_slice[~miss_mask]
if len(x_data) == 0:
return np.nan
fitted = poly.polyfit(x=x_data, y=y_data, deg=poly_deg)
return poly.polyval(center_index, fitted)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment