Skip to content
Snippets Groups Projects
Commit 0ec019cb authored by Marc-Antoine Drouin's avatar Marc-Antoine Drouin
Browse files

fix: bug with background

- background cache was saved in both ptrms_lib and ptrms_lib interface
parent 67cb4410
No related branches found
No related tags found
No related merge requests found
ptrms_lib @ 4789f4c1
Subproject commit 55d2d345381e0e290b483a734742abe069807deb
Subproject commit 4789f4c19fcc10741709922bf8555f630bc64a0a
......@@ -105,13 +105,17 @@ class ptrms_lib:
# check if required info available to run code
# ------------------------------------------------------------------------------
# background
if not self.bck_save.exists():
# if no cache background, we need to have blank in data
if not any(valve_data["meaning"] == "BLANK"):
raise RuntimeError(
"No background data and no blank data in file. Impossible to process file."
)
# if no cache background, and no blank in data
filter_blank = valve_data["meaning"] == "BLANK"
if not self.bck_save.exists() and not any(filter_blank):
err_msg = "No background data and no blank data in file. Impossible to process file." # noqa: E501
raise RuntimeError(err_msg)
# we need several points for blanks
n_blanks = filter_blank.to_numpy().astype(int).sum()
if n_blanks < 5:
print("not enough blanks. using cache background.") # noqa: T201
ptrms_data_raw = ptrms_data_raw[~filter_blank]
# processing to NCPS
# ------------------------------------------------------------------------------
......@@ -138,9 +142,6 @@ class ptrms_lib:
self.bck_save,
)
# save background
bck_data.to_csv(self.bck_save, float_format="%.3f")
# get calibration coefficients
# ---------------------------------------------------------------------------------
snorm_data = calib.get_snorm(
......
,mz_31,mz_33,mz_42,mz_45,mz_46,mz_47,mz_57,mz_58,mz_59,mz_60,mz_61,mz_63,mz_69,mz_71,mz_73,mz_75,mz_79,mz_81,mz_83,mz_85,mz_87,mz_93,mz_97,mz_99,mz_107,mz_111,mz_121,mz_137,mz_139,mz_147,mz_151
2024-10-27 07:51:42.998400,7.6538724142195615,85.57709228262395,2.8615273473538423,18.92359024792213,,15.472185099450392,4.54505711405783,,5.305653723246409,,4.466380472078328,3.6350229217922827,3.1977896748722894,2.944168743054741,5.723146722987975,3.2179723310173665,2.778793923372653,,,,,6.000334133495124,,,4.746597324858441,,3.2476780114529196,2.539520394617266,,,
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