diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb index 621025e921ae29eb57967758c5fbe8a89672c5ce..3832165cc90bd938ebeeac61ddf12032c9de7f0b 100644 --- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb @@ -20,7 +20,7 @@ "outputs": [], "source": [ "in_folder = \"/gpfs/exfel/exp/FXE/202221/p003225/raw\" # the folder to read data from, required\n", - "out_folder = \"/gpfs/exfel/data/scratch/ahmedk/test/gotthard2\" # the folder to output to, required\n", + "out_folder = \"/gpfs/exfel/data/scratch/ahmedk/test/gotthard2\" # the folder to output to, required\n", "run = 50 # run to process, required\n", "sequences = [-1] # sequences to correct, set to [-1] for all, range allowed\n", "sequences_per_node = 1 # number of sequence files per node if notebook executed through xfel-calibrate, set to 0 to not run SLURM parallel\n", @@ -81,7 +81,8 @@ "from extra_data import RunDirectory, H5File\n", "from pathlib import Path\n", "\n", - "from cal_tools import gotthard2algs, gotthard2lib, h5_copy_except\n", + "from cal_tools import h5_copy_except\n", + "from cal_tools.gotthard2 import gotthard2algs, gotthard2lib\n", "from cal_tools.step_timing import StepTimer\n", "from cal_tools.tools import (\n", " get_constant_from_db_and_time,\n", diff --git a/src/cal_tools/gotthard2/__init__.py b/src/cal_tools/gotthard2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/cal_tools/gotthard2algs.pyx b/src/cal_tools/gotthard2/gotthard2algs.pyx similarity index 100% rename from src/cal_tools/gotthard2algs.pyx rename to src/cal_tools/gotthard2/gotthard2algs.pyx diff --git a/tests/test_cythonalgs.py b/tests/test_cythonalgs.py index a20d2370310c2d7a40b30430bfb867bfe2392876..cff7fe33b8da91059309d0c05d64673986416bba 100644 --- a/tests/test_cythonalgs.py +++ b/tests/test_cythonalgs.py @@ -1,3 +1,3 @@ def test_import(): from cal_tools import agipdalgs # noqa - from cal_tools import gotthard2algs # noqa + from cal_tools.gotthard2 import gotthard2algs # noqa diff --git a/tests/test_gotthard2algs.py b/tests/test_gotthard2algs.py index eb461ec6d473c2f9562f401ec191bfda56b1a1a5..6b5fbbd63116b25352574b3432a2451b85a4c8cc 100644 --- a/tests/test_gotthard2algs.py +++ b/tests/test_gotthard2algs.py @@ -1,11 +1,11 @@ import numpy as np import pytest -from cal_tools.gotthard2algs import convert_to_10bit, correct_train +from cal_tools.gotthard2.gotthard2algs import convert_to_10bit, correct_train def test_convert_to_10bit(): - + """Test converting 12bit Gotthard2 image to 10bit.""" n_stripes = 10 n_pulses = 500 @@ -31,6 +31,7 @@ def test_convert_to_10bit(): @pytest.mark.parametrize("gain_corr", [True, False]) def test_correct_train(gain_corr): + """Test gotthard2 correction function.""" raw_d = np.random.randn(2700, 1280).astype(np.float32) gain = np.random.choice([0, 1, 2], size=(2700, 1280)).astype(np.uint8)