From 6f2c34e30bb5e604f0cefabd959954aa459d5308 Mon Sep 17 00:00:00 2001 From: vedina Date: Mon, 25 Nov 2024 21:38:49 +0200 Subject: [PATCH] of course x should be x4search --- src/rcapi/services/convertor_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rcapi/services/convertor_service.py b/src/rcapi/services/convertor_service.py index 02660dd..23c35cc 100644 --- a/src/rcapi/services/convertor_service.py +++ b/src/rcapi/services/convertor_service.py @@ -93,14 +93,14 @@ def knnquery(domain, dataset="raw"): output = BytesIO() FigureCanvas(fig).print_png(output) base64_bytes = base64.b64encode(output.getvalue()) - result_json["imageLink"] = "data:image/png;base64,{}".format(str(base64_bytes,'utf-8')) + result_json["imageLink"] = "data:image/png;base64,{}".format(str(base64_bytes, 'utf-8')) except Exception as err: print(err) return result_json except Exception as err: raise err - - + + def plot_spectrum(x, y, title=None, xlabel=None, ylabel=None, thumbnail=True, figsize=None, plot_kwargs=None): if figsize is None: figsize = (6, 4) @@ -130,7 +130,7 @@ def resample_spline(spe: rc2.spectrum.Spectrum, x4search: npt.NDArray): xmin, xmax = spe.x.min(), spe.x.max() within_range = (x4search >= xmin) & (x4search <= xmax) spe_spline[within_range] = spline(x4search[within_range]) - return rc2.spectrum.Spectrum(x=spe.x, y=spe_spline) + return rc2.spectrum.Spectrum(x=x4search, y=spe_spline) def preprocess_spectrum(spe: rc2.spectrum.Spectrum, x4search: npt.NDArray, baseline=False):