Added checker for the pid offset between two channels

This commit is contained in:
2023-11-13 18:18:53 +01:00
parent ff87dbdd60
commit aa6190e9dd
2 changed files with 52 additions and 3 deletions

View File

@@ -2,8 +2,8 @@ import pytest
import os
import numpy as np
import cristallina.utils as utils
from cristallina.utils import ROI, print_run_info, heuristic_extract_pgroup, gauss, find_nearest, xray_transmission,stand_table
from sfdata import SFDataFiles
from cristallina.utils import ROI, print_run_info, heuristic_extract_pgroup, gauss, find_nearest, xray_transmission,stand_table,check_pid_offset
def test_print(capsys):
@@ -30,8 +30,10 @@ def test_ROI():
def test_extract_pgroup():
cwd = os.getcwd()
os.chdir("tests/data/p20841/raw/")
assert heuristic_extract_pgroup() == '20841'
os.chdir(cwd)
def test_gauss():
@@ -47,6 +49,9 @@ def test_xray_transmission():
T = xray_transmission(9000, 100e-6, material = 'Si')
assert T == 0.342385039732607
def test_check_pid_offset():
with SFDataFiles(f"tests/data/p20841/raw/run0205/data/acq*.h5") as data:
assert check_pid_offset(data,'SARFE10-PBPG050:HAMP-INTENSITY-CAL','SARFE10-PBIG050-EVR0:CALCI') == 0
# This test can only be run localy (github has no access to /sf/cristallina), therefore it's commented out.