Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added FC_bsln and puls_aux #38

Merged
merged 4 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/legend_data_monitor/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def make_subsystem_plots(
data_analysis.data.iloc[0]["cc4_id"] is None
or data_analysis.data.iloc[0]["cc4_channel"] is None
):
if subsystem.type in ["spms", "pulser"]:
if subsystem.type in ["spms", "pulser", "pulser_aux", "bsln"]:
utils.logger.error(
"\033[91mPlotting per CC4 is not available for %s. Try again!\033[0m",
subsystem.type,
Expand Down Expand Up @@ -115,9 +115,7 @@ def make_subsystem_plots(
plot_info = {
"title": plot_title,
"subsystem": subsystem.type,
"locname": {"geds": "string", "spms": "fiber", "pulser": "puls"}[
subsystem.type
],
"locname": {"geds": "string", "spms": "fiber", "pulser": "puls", "pulser_aux": "puls", "FC_bsln": "bsln"}[subsystem.type],
"unit": utils.PLOT_INFO[plot_settings["parameters"]]["unit"],
"plot_style": plot_settings["plot_style"],
}
Expand Down Expand Up @@ -154,7 +152,7 @@ def make_subsystem_plots(
# time window might be needed fort he vs time function
plot_info["time_window"] = plot_settings["time_window"]
# threshold values are needed for status map; might be needed for plotting limits on canvas too
if subsystem.type != "pulser":
if subsystem.type not in ["pulser", "pulser_aux", "FC_bsln"]:
plot_info["limits"] = (
utils.PLOT_INFO[plot_settings["parameters"]]["limits"][subsystem.type][
"variation"
Expand Down Expand Up @@ -201,9 +199,9 @@ def make_subsystem_plots(
# -------------------------------------------------------------------------

if "status" in plot_settings and plot_settings["status"]:
if subsystem.type == "pulser":
if subsystem.type in ["pulser", "pulser_aux", "FC_bsln"]:
utils.logger.debug(
"Thresholds are not enabled for pulser! Use you own eyes to do checks there"
f"Thresholds are not enabled for {subsystem.type}! Use you own eyes to do checks there"
)
else:
_ = status_plot.status_plot(
Expand Down Expand Up @@ -325,7 +323,7 @@ def plot_per_ch(data_analysis: DataFrame, plot_info: dict, pdf: PdfPages):
ax_idx += 1

# -------------------------------------------------------------------------------
if plot_info["subsystem"] == "pulser":
if plot_info["subsystem"] in ["pulser", "pulser_aux", "FC_bsln"]:
y_title = 1.05
axes[0].set_title("")
else:
Expand All @@ -339,9 +337,9 @@ def plot_per_ch(data_analysis: DataFrame, plot_info: dict, pdf: PdfPages):


def plot_per_cc4(data_analysis: DataFrame, plot_info: dict, pdf: PdfPages):
if plot_info["subsystem"] == "pulser":
if plot_info["subsystem"] in ["pulser", "pulser_aux", "FC_bsln"]:
utils.logger.error(
"\033[91mPlotting per CC4 is not available for the pulser channel.\nTry again with a different plot structure!\033[0m"
"\033[91mPlotting per CC4 is not available for %s channel.\nTry again with a different plot structure!\033[0m", plot_info["subsystem"]
)
exit()
# --- choose plot function based on user requested style e.g. vs time or histogram
Expand Down Expand Up @@ -419,7 +417,7 @@ def plot_per_cc4(data_analysis: DataFrame, plot_info: dict, pdf: PdfPages):
ax_idx += 1

# -------------------------------------------------------------------------------
y_title = 1.05 if plot_info["subsystem"] == "pulser" else 1.01
y_title = 1.05 if plot_info["subsystem"] in ["pulser", "pulser_aux", "FC_bsln"] else 1.01
fig.suptitle(f"{plot_info['subsystem']} - {plot_info['title']}", y=y_title)
save_pdf(plt, pdf)

Expand Down Expand Up @@ -506,7 +504,7 @@ def plot_per_string(data_analysis: DataFrame, plot_info: dict, pdf: PdfPages):
ax_idx += 1

# -------------------------------------------------------------------------------
y_title = 1.05 if plot_info["subsystem"] == "pulser" else 1.01
y_title = 1.05 if plot_info["subsystem"] in ["pulser", "pulser_aux", "FC_bsln"] else 1.01
fig.suptitle(f"{plot_info['subsystem']} - {plot_info['title']}", y=y_title)

save_pdf(plt, pdf)
Expand Down
45 changes: 18 additions & 27 deletions src/legend_data_monitor/settings/par-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"A_max": {
"label": "Max. Current Pulse",
"unit": "a.u.",
"unit": "ADC/sample",
"facecol": [0.96, 0.73, 1.0],
"limits": {
"spms": {
Expand All @@ -91,7 +91,7 @@
},
"QDrift": {
"label": "QDrift",
"unit": "a.u.",
"unit": "ADC",
"facecol": [0.56, 0.74, 0.56],
"limits": {
"spms": {
Expand All @@ -106,7 +106,7 @@
},
"cuspEftp": {
"label": "cuspEftp",
"unit": "a.u.",
"unit": "ADC",
"facecol": [0.86, 0.86, 0.86],
"limits": {
"spms": {
Expand All @@ -121,7 +121,7 @@
},
"cuspEmax": {
"label": "cuspEmax",
"unit": "a.u.",
"unit": "ADC",
"facecol": [0.86, 0.86, 0.86],
"limits": {
"spms": {
Expand Down Expand Up @@ -166,7 +166,7 @@
},
"dt_eff": {
"label": "dt_eff",
"unit": "a.u.",
"unit": "ns",
"facecol": "peachpuff",
"limits": {
"spms": {
Expand All @@ -181,7 +181,7 @@
},
"pz_mean": {
"label": "pz_mean",
"unit": "a.u.",
"unit": "ADC",
"facecol": "paleturquoise",
"limits": {
"spms": {
Expand All @@ -196,7 +196,7 @@
},
"pz_slope": {
"label": "pz_slope",
"unit": "a.u.",
"unit": "ADC",
"facecol": "paleturquoise",
"limits": {
"spms": {
Expand All @@ -211,7 +211,7 @@
},
"pz_std": {
"label": "pz_std",
"unit": "a.u.",
"unit": "ADC",
"facecol": "paleturquoise",
"limits": {
"spms": {
Expand Down Expand Up @@ -376,7 +376,7 @@
},
"tp_aoe_max": {
"label": "tp_aoe_max",
"unit": "a.u.",
"unit": "ns",
"facecol": "plum",
"limits": {
"spms": {
Expand Down Expand Up @@ -406,7 +406,7 @@
},
"tp_max": {
"label": "tp_max",
"unit": "a.u.",
"unit": "ns",
"facecol": "palegreen",
"limits": {
"spms": {
Expand All @@ -421,7 +421,7 @@
},
"tp_min": {
"label": "tp_max",
"unit": "a.u.",
"unit": "ns",
"facecol": "palegreen",
"limits": {
"spms": {
Expand All @@ -436,7 +436,7 @@
},
"trapEftp": {
"label": "trapEftp",
"unit": "a.u.",
"unit": "ADC",
"facecol": "palegoldenrod",
"limits": {
"spms": {
Expand All @@ -451,7 +451,7 @@
},
"trapEmax": {
"label": "trapEmax",
"unit": "a.u.",
"unit": "ADC",
"facecol": "palegoldenrod",
"limits": {
"spms": {
Expand Down Expand Up @@ -481,7 +481,7 @@
},
"trapTmax": {
"label": "trapTmax",
"unit": "a.u.",
"unit": "ADC",
"facecol": "palegoldenrod",
"limits": {
"spms": {
Expand Down Expand Up @@ -526,7 +526,7 @@
},
"wf_min": {
"label": "wf_min",
"unit": "a.u.",
"unit": "ADC",
"facecol": "pink",
"limits": {
"spms": {
Expand All @@ -541,7 +541,7 @@
},
"zacEftp": {
"label": "zacEftp",
"unit": "a.u.",
"unit": "ADC",
"facecol": "aquamarine",
"limits": {
"spms": {
Expand All @@ -556,7 +556,7 @@
},
"zacEmax": {
"label": "zacEmax",
"unit": "a.u.",
"unit": "ADC",
"facecol": "aquamarine",
"limits": {
"spms": {
Expand Down Expand Up @@ -593,18 +593,9 @@
"geds": [null, 0.0]
}
},
"lc": {
"label": "LC",
"unit": "?",
"facecol": [0.94, 0.87, 0.9],
"limits": {
"spms": [null, 0.0],
"geds": [null, 0.0]
}
},
"gain": {
"label": "Uncalibrated Gain",
"unit": "a.u.",
"unit": "ADC",
"facecol": [0.68, 0.87, 0.68],
"limits": {
"spms": {
Expand Down
59 changes: 58 additions & 1 deletion src/legend_data_monitor/settings/parameter-tiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,64 @@
"baseline": "dsp",
"wf_max": "dsp",
"timestamp": "dsp",
"tp_min": "dsp",
"tp_max": "dsp",
"wf_min": "dsp",
"t_sat_lo": "dsp",
"t_sat_hi": "dsp",
"t_discharge": "dsp",
"bl_mean": "dsp",
"bl_std": "dsp",
"bl_slope": "dsp",
"bl_intercept": "dsp",
"pz_slope": "dsp",
"pz_std": "dsp",
"pz_mean": "dsp",
"trapTmax": "dsp",
"trapSmax": "dsp",
"trapEmax": "dsp",
"trapEftp": "dsp",
"cuspEmax": "dsp",
"zacEmax": "dsp",
"zacEftp": "dsp",
"cuspEftp": "dsp",
"tp_0_est": "dsp",
"tp_0_atrap": "dsp",
"tp_01": "dsp",
"tp_10": "dsp",
"tp_20": "dsp",
"tp_50": "dsp",
"tp_80": "dsp",
"tp_90": "dsp",
"tp_95": "dsp",
"tp_99": "dsp",
"tp_100": "dsp",
"A_max": "dsp",
"tp_aoe_max": "dsp",
"QDrift": "dsp",
"dt_eff": "dsp",
"lq80": "dsp",
"dt_eff_invert": "dsp",
"trapTmax_invert": "dsp",
"trapTftp_invert": "dsp",
"tp_0_invert": "dsp",
"tp_100_invert": "dsp",
"tp_99_invert": "dsp",
"tp_90_invert": "dsp",
"tp_80_invert": "dsp",
"tp_50_invert": "dsp",
"tp_20_invert": "dsp",
"tp_10_invert": "dsp",
"cuspEmax_ctc_cal": "hit",
"zacEmax_ctc_cal": "hit",
"trapEmax_ctc_cal": "hit",
"trapTmax_cal": "hit",
"AoE_Corrected": "hit",
"zacEmax_ctc_cal": "hit"
"AoE_Classifier": "hit",
"AoE_Low_Cut": "hit",
"AoE_Double_Sided_Cut": "hit",
"is_valid_cal": "hit",
"is_valid_0vbb": "hit",
"is_negative": "hit",
"is_saturated": "hit"
}
Loading