Skip to content

Commit

Permalink
Inherit center_time from peaklets (#102)
Browse files Browse the repository at this point in the history
* Inherit `center_time` from `peaklets`

Following XENONnT/straxen#1503

* Debug for requirements installation

* Update version of plugin
  • Loading branch information
dachengx authored Feb 9, 2025
1 parent 5f9e6a0 commit 0556b37
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.10", "3.11" ]
python-version: [ "3.11" ]
test: [ "coveralls" ]

steps:
Expand All @@ -47,12 +47,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pytest coverage coveralls
- name: Install requirements for Python 3.10
if: matrix.python-version == '3.10'
run: pip install git+https://github.com/XENONnT/[email protected] --force-reinstall

- name: Install requirements for Python 3.11
if: matrix.python-version == '3.11'
- name: Install requirements
run: pip install git+https://github.com/XENONnT/base_environment.git --force-reinstall

- name: Install strax and straxen
Expand Down Expand Up @@ -85,10 +80,6 @@ jobs:
SCADA_LOGIN_URL: ${{ secrets.SCADA_LOGIN_URL }}
SCADA_PWD: ${{ secrets.SCADA_PWD }}

- name: Install requirements
run: |
pip install -r extra_requirements/requirements-tests.txt
- name: Install Axidence
run: |
pip install .
Expand Down
18 changes: 12 additions & 6 deletions axidence/plugins/pairing/peaks_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class PeaksPaired(ExhaustPlugin, DownChunkingPlugin):
__version__ = "0.0.1"
__version__ = "0.0.2"
depends_on = (
"run_meta",
"isolated_s1",
Expand Down Expand Up @@ -447,11 +447,13 @@ def shadow_matching(
s2_group_index = np.hstack([group[1] for group in group_index_list]).astype(int)
drift_time = np.hstack([group[2] for group in group_index_list]).astype(int)
assert len(s1_group_index) == len(s2_group_index)
return paring_rate_full, (
s1["group_number"][s1_group_index],
s2["group_number"][s2_group_index],
drift_time,
)
return paring_rate_full, (
s1["group_number"][s1_group_index],
s2["group_number"][s2_group_index],
drift_time,
)
else:
return paring_rate_full

def split_chunks(self, n_peaks):
# divide results into chunks
Expand Down Expand Up @@ -509,6 +511,7 @@ def build_arrays(
_array[0]["origin_center_time"] = s1["center_time"][s1_index]
_array[0]["origin_n_competing"] = s1["n_competing"][s1_index]
_array[0]["origin_group_type"] = 1
_array[0]["center_time"] = s1_center_time[i]
_array[0]["time"] = s1_center_time[i] - (
s1["center_time"][s1_index] - s1["time"][s1_index]
)
Expand All @@ -528,6 +531,9 @@ def build_arrays(
_array[1:]["origin_center_time"] = s2_group_i["center_time"]
_array[1:]["origin_n_competing"] = s2_group_i["n_competing"]
_array[1:]["origin_group_type"] = 2
_array[1:]["center_time"] = s2_center_time[i] - (
s2_group_i["center_time"][s2_index] - s2_group_i["center_time"]
)
_array[1:]["time"] = s2_center_time[i] - (
s2_group_i["center_time"][s2_index] - s2_group_i["time"]
)
Expand Down
3 changes: 0 additions & 3 deletions extra_requirements/requirements-tests.txt

This file was deleted.

0 comments on commit 0556b37

Please sign in to comment.