From 3757effe0138d5d6aa5e61b249dd5551513cea71 Mon Sep 17 00:00:00 2001 From: dachengx Date: Fri, 15 Nov 2024 14:28:31 -0600 Subject: [PATCH] Update documentation --- docs/source/cmt.rst | 2 +- docs/source/index.rst | 7 --- .../reference/straxen.legacy.plugins_1t.rst | 53 ------------------- docs/source/reference/straxen.legacy.rst | 45 ---------------- docs/source/scripts.rst | 5 -- straxen/matplotlib_utils.py | 7 +-- tests/test_basics.py | 10 +--- 7 files changed, 5 insertions(+), 124 deletions(-) delete mode 100644 docs/source/reference/straxen.legacy.plugins_1t.rst delete mode 100644 docs/source/reference/straxen.legacy.rst diff --git a/docs/source/cmt.rst b/docs/source/cmt.rst index a072b2e39..b5d2ffae3 100644 --- a/docs/source/cmt.rst +++ b/docs/source/cmt.rst @@ -6,7 +6,7 @@ In specific CMT is a class within `strax `_ allows the user to query and retrieve information. This class uses the start time of a given run to find the corresponding information and version for a given correction. For every correction user must set the proper configuration in order to retrieve the information, the syntax is the following ``my_configuration = (“my_correction”, “version”, True)`` the first part correspond to the string of the correction, then the version, it can be either an ONLINE version or OFFLINE version and finally the boolean correspond to the detector configuration (1T or nT). +A customized CMT can be implemented given the experiment software, in the case of straxen, experiment specifics can be added to CMT. To set CMT accordingly to straxen a class `CorrectionsManagementService() `_ allows the user to query and retrieve information. This class uses the start time of a given run to find the corresponding information and version for a given correction. For every correction user must set the proper configuration in order to retrieve the information, the syntax is the following ``my_configuration = (“my_correction”, “version”, True)`` the first part correspond to the string of the correction, then the version, it can be either an ONLINE version or OFFLINE version and finally the boolean correspond to the detector configuration. In the case of straxen there are several plug-ins that call CMT to retrieve information, in that case, the configuration option is set by the ``strax.option()`` and the information is retrieve in `set()` via the function `straxen.get_correction_from_cmt()` and example is shown below where the electron life time is retrieve for a particular run ID, using the ONLINE version for the detector configuration nT=True. diff --git a/docs/source/index.rst b/docs/source/index.rst index d68c263a2..6311b088e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -63,13 +63,6 @@ Straxen is the analysis framework for XENONnT, built on top of the generic `stra reference/context -.. toctree:: - :maxdepth: 1 - :caption: 1T Datastructure - - reference/datastructure_1T - - .. toctree:: :maxdepth: 1 :caption: Reference diff --git a/docs/source/reference/straxen.legacy.plugins_1t.rst b/docs/source/reference/straxen.legacy.plugins_1t.rst deleted file mode 100644 index 56be9eb97..000000000 --- a/docs/source/reference/straxen.legacy.plugins_1t.rst +++ /dev/null @@ -1,53 +0,0 @@ -straxen.legacy.plugins\_1t package -================================== - -Submodules ----------- - -straxen.legacy.plugins\_1t.event\_info module ---------------------------------------------- - -.. automodule:: straxen.legacy.plugins_1t.event_info - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.plugins\_1t.fake\_daqreader module -------------------------------------------------- - -.. automodule:: straxen.legacy.plugins_1t.fake_daqreader - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.plugins\_1t.pax\_interface module ------------------------------------------------- - -.. automodule:: straxen.legacy.plugins_1t.pax_interface - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.plugins\_1t.peak\_positions module -------------------------------------------------- - -.. automodule:: straxen.legacy.plugins_1t.peak_positions - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.plugins\_1t.x1t\_cuts module -------------------------------------------- - -.. automodule:: straxen.legacy.plugins_1t.x1t_cuts - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: straxen.legacy.plugins_1t - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/reference/straxen.legacy.rst b/docs/source/reference/straxen.legacy.rst deleted file mode 100644 index c9f8cb313..000000000 --- a/docs/source/reference/straxen.legacy.rst +++ /dev/null @@ -1,45 +0,0 @@ -straxen.legacy package -====================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - straxen.legacy.plugins_1t - -Submodules ----------- - -straxen.legacy.contexts\_1t module ----------------------------------- - -.. automodule:: straxen.legacy.contexts_1t - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.hitfinder\_thresholds module -------------------------------------------- - -.. automodule:: straxen.legacy.hitfinder_thresholds - :members: - :undoc-members: - :show-inheritance: - -straxen.legacy.xenon1t\_url\_configs module -------------------------------------------- - -.. automodule:: straxen.legacy.xenon1t_url_configs - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: straxen.legacy - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/scripts.rst b/docs/source/scripts.rst index 305e1146c..63d29cdf9 100644 --- a/docs/source/scripts.rst +++ b/docs/source/scripts.rst @@ -180,11 +180,6 @@ bootstrax [DAQ-only] As the main DAQ processing script. This is discussed separately. It is only used for XENONnT. -fake_daq ------------------- -Script that allows mimiming DAQ-processing by opening raw-records data. - - microstrax ------------------ Mini strax interface that allows strax-data to be retrieved using HTTP requests diff --git a/straxen/matplotlib_utils.py b/straxen/matplotlib_utils.py index 92260e045..47e6ad673 100644 --- a/straxen/matplotlib_utils.py +++ b/straxen/matplotlib_utils.py @@ -13,7 +13,6 @@ def plot_pmts( c, label="", figsize=None, - xenon1t=False, show_tpc=True, extend="neither", vmin=None, @@ -40,7 +39,7 @@ def plot_pmts( # Single-valued array passed vmax += 1 if figsize is None: - figsize = (11.25, 4.25) if xenon1t else (13.25, 5.75) + figsize = (13.25, 5.75) f, axes = plt.subplots(1, 2, figsize=figsize) plot_result = None @@ -51,7 +50,6 @@ def plot_pmts( plot_result = plot_on_single_pmt_array( c, - xenon1t=xenon1t, array_name=array_name, show_tpc=show_tpc, vmin=vmin, @@ -75,7 +73,6 @@ def plot_pmts( def plot_on_single_pmt_array( c, array_name="top", - xenon1t=False, r=straxen.tpc_r * 1.03, pmt_label_size=8, pmt_label_color="white", @@ -106,7 +103,7 @@ def plot_on_single_pmt_array( if vmax is None: vmax = c.max() - pmt_positions = straxen.pmt_positions(xenon1t=xenon1t).to_records() + pmt_positions = straxen.pmt_positions().to_records() ax = plt.gca() ax.set_aspect("equal") diff --git a/tests/test_basics.py b/tests/test_basics.py index e34ae36cb..16c9bea17 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -28,11 +28,10 @@ def tearDownClass(cls): shutil.rmtree(cls.tempdir) def test_run_selection(self): - st = self.st # Ignore strax-internal warnings - st.set_context_config({"free_options": tuple(st.config.keys())}) + self.st.set_context_config({"free_options": tuple(self.st.config.keys())}) - run_df = st.select_runs(available="raw_records") + run_df = self.st.select_runs(available="raw_records") print(run_df) run_id = run_df.iloc[0]["name"] assert run_id == self.run_id @@ -59,8 +58,6 @@ def _extract_latest_comment( assert st.runs is not None, "No registry build?" assert "comments" in st.runs.keys() runs = st.select_runs(available=test_for_target) - if context == "demo": - assert len(st.runs) assert f"{test_for_target}_available" in runs.keys() def test_extract_latest_comment_nt(self, **opt): @@ -69,9 +66,6 @@ def test_extract_latest_comment_nt(self, **opt): context="xenonnt_online", minimum_run_number=10_000, maximum_run_number=12_000, **opt ) - def test_extract_latest_comment_demo(self): - self._extract_latest_comment(context="demo") - def test_extract_latest_comment_lone_hits(self): """Run the test for some target that is not in the default availability check.""" self.test_extract_latest_comment_nt(test_for_target="lone_hits")