Skip to content

Commit

Permalink
of course x should be x4search
Browse files Browse the repository at this point in the history
  • Loading branch information
vedina committed Nov 25, 2024
1 parent 34a93b9 commit 6f2c34e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rcapi/services/convertor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 6f2c34e

Please sign in to comment.