From 94d66af956f59321d44957a1832b2fada03064db Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Mon, 24 Oct 2022 12:18:19 +0200 Subject: [PATCH] remove unused import and refactor docstring --- ...gfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb | 6 +----- src/cal_tools/jungfraulib.py | 11 +++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb index e9e48e605..49b57db8c 100644 --- a/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_dark_analysis_all_gains_burst_mode_NBC.ipynb @@ -89,11 +89,7 @@ "from XFELDetAna.plotting.histogram import histPlot\n", "from cal_tools import jungfraulib, step_timing\n", "from cal_tools.ana_tools import save_dict_to_hdf5\n", - "from cal_tools.enums import (\n", - " BadPixels,\n", - " JungfrauGainMode,\n", - " JungfrauSettings,\n", - " )\n", + "from cal_tools.enums import BadPixels, JungfrauGainMode\n", "from cal_tools.tools import (\n", " get_dir_creation_date,\n", " get_pdu_from_db,\n", diff --git a/src/cal_tools/jungfraulib.py b/src/cal_tools/jungfraulib.py index 7f2923372..363d43831 100644 --- a/src/cal_tools/jungfraulib.py +++ b/src/cal_tools/jungfraulib.py @@ -85,6 +85,8 @@ class JungfrauCtrl(): def get_gain_setting(self) -> int: """Get run gain settings to identify if run is in High CDS or Low CDS. + - `1` if run_settings = highgain0. + - `0` if run_settings = gain0 or None. """ if self.run_settings == JungfrauSettings.HIGH_GAIN_0: return 1 @@ -92,12 +94,9 @@ class JungfrauCtrl(): return 0 def get_gain_mode(self) -> int: - """From Jungfrau SW V5 gain_mode is deducted from - /RUN/..../gainMode. - With different enums: dynamic, fixg1, fixg2, - forceswitchg1, forceswitchg2. which are used to decide - if the value is 0 or 1. - Gain Mode is fixed (1) if the enum is fixg1 or fixg2. + """Get gain mode value. Fixed `1` or Adaptive `1`. + - `0` if run_mode = dynamic, forceswitchg1, forceswitchg2, or None. + - `1` if run_mode = fixg1 or fixg2. """ if self.run_mode in [ JungfrauGainMode.FIX_GAIN_1.value, -- GitLab