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

new plot ideas #92

Open
2 of 5 tasks
Tracked by #62
sofia-calgaro opened this issue Mar 31, 2023 · 1 comment
Open
2 of 5 tasks
Tracked by #62

new plot ideas #92

sofia-calgaro opened this issue Mar 31, 2023 · 1 comment

Comments

@sofia-calgaro
Copy link
Collaborator

sofia-calgaro commented Mar 31, 2023

  • exposure plot (to be used with Felix's detectors layout)
  • plot with pulser + baseline + muon AUX rates
  • array-rate for different energy ranges, both vs time and using with Felix's detectors layout: <200, 200-600, 600-1500, 1500-1550 (to leave 42K alone), 1550-3000, >3000 keV -> useful for phy data
  • ratio between geds gain and pulser AUX gain
  • (plot accepted&rejected once QC are finalized)
@sofia-calgaro sofia-calgaro changed the title new plots new plot ideas Mar 31, 2023
@sofia-calgaro sofia-calgaro pinned this issue Apr 4, 2023
@sofia-calgaro sofia-calgaro mentioned this issue May 9, 2023
45 tasks
@sofia-calgaro
Copy link
Collaborator Author

sofia-calgaro commented May 9, 2023

Slow Control Monitoring:

  • decide which parameter to include from the database
  • plot them individually (in the sense as if they were a new separate subsystem) or import them within the geds/pulser subsystems to better see potential correlations and causes/effects in a quicker way?

Params to make available

At least the ones present in the shifter page:

  • Ge diodes: current / voltage
  • Cryostat: pressure (PT118, PT114, PT115), vacuum (PT202, PT205, PT208)
  • H2O loop: LT01, RHOT01, RHOT02, PT05
  • Cleanroom: RREit, RRNTe, RRSTe, ZULT_RR
  • Racks Power: CleanRoom-DaqLeft/CleanRoom-DaqRight (Temp-1.Temp, Temp-2.Temp)

Load and flag params

I guess a new module responsible for retrieving the correct data is needed. Quite some flags are needed to arrive to the correct dataset needed for plotting a given SC parameter. Some examples:

# --------------- How to get the temperature 1 or 2 from the Left or Right DAQ
# 1. Connect to  SC database
from legendmeta import LegendSlowControlDB
scdb = LegendSlowControlDB()
scdb.connect(password="...")

# 2. Set some flags
is_in_time = (...) # put here the time interval of interest specified in the config file
is_temperature = (rack_snap["name"] == "Temp") 
is_DaqLeft = (rack_snap["rack"] == "CleanRoom-DaqLeft")
is_DaqRight = (rack_snap["rack"] == "CleanRoom-DaqRight")
is_Temp_1 = (rack_snap["sensor"] == "Temp-1")
is_Temp_2 = (rack_snap["sensor"] == "Temp-2")

# 2. Flag the data
rack_snap = scdb.dataframe("rack_snap")
rack_snap = rack_snap.sort_values(by="tstamp") # need it! Timestamps are NOT in ascending order by default 
temp_1L = rack_snap[(is_in_time & is_temperature & is_DaqLeft & is_Temp_1)]["value"]
temp_1R = rack_snap[(is_in_time & is_temperature & is_DaqRight & is_Temp_1)]["value"]
temp_2L = rack_snap[(is_in_time & is_temperature & is_DaqLeft & is_Temp_2)]["value"]
temp_2R = rack_snap[(is_in_time & is_temperature & is_DaqRight & is_Temp_2)]["value"]

Maybe an external json file saved under settings/ can help to build the flags we want? Like

{
  "SC_DB_params": {
      "PT118": {
          "table": "cryostat_snap",
          "flags": [is_Pressure, is_PT18]
       },
      "CleanRoom-DaqLeft-Temp1.Temp": {
          "table": "rack_snap",
          "flags": [is_temperature, is_DaqLeft, is_Temp_1]
       },
  },
  "expressions":{
          "is_Pressure": {
                      "column": "group", // column in which to apply the 'df[column] == "sth" condition'
                      "entry": "Pressure" // = sth 
           },
          "is_PT118": {
                      "column": "name",
                      "entry": "PT118"
           },
          "is_temperature ": {
                      "column": "name",
                      "entry": "Temp"
           },
          "is_DaqLeft ": {
                      "column": "rack",
                      "entry": "CleanRoom-DaqLeft"
           },
          "is_Temp_1": {
                      "column": "sensor",
                      "entry": "Temp-1"
           }
          }
  }
}

And then, in a module,

flags_info = ... load here the dict from json file (it knows which parameters are available and which flags to apply for each of them)...
param_to_plot = "PT118" # actually retrieved from config json file
df_param = load_and_apply_flags(param_to_plot , flags_info) # -> returns a dataframe for the table of interest (NOTE: usually the loading part is super heavy and slow down everything - can we load just a bunch of data, considering atp we already have a time interval we can retrieve from the config json file?) -> build the final dataframe with ONLY the parameter of interest (throw away sensors/names/.../columns that are not needed)

Like, if we want to plot "PT118" pressure values from the cryostat, we must be able to do something equivalent to the following:

is_Pressure = (cryostat_snap["group"] == "Pressure")
is_PT118 = (cryostat_snap["name"] == "PT118")
flag = (is_Pressure & is_PT118)
cryostat_snap = scdb.dataframe("cryostat_snap")
cryostat_snap = cryostat_snap.sort_values(by='tstamp') # sort bt tstamps (not by default)
values_PT188 = cryostat_snap_small[flag]["value"]
times_PT188 = cryostat_snap_small[flag]["tstamp"]

Units

Can be retrieved from the corresponding _info dataframe:

cryostat_info = scdb.dataframe("cryostat_info")
unit = ... read value inside column="unit"...

Limits

Can be retrieved from the corresponding _info dataframe:

cryostat_info = scdb.dataframe("cryostat_info")
low_lim = ... read value inside column="ltol"...
upper_lim = ... read value inside column="utol"...

NOTE: keep in mind this feature would work only for those who have access to LNGS machines (pswd on internal pages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant