diff --git a/calibrationSuite/detectorInfo.py b/calibrationSuite/detectorInfo.py index d202046..f32d33d 100644 --- a/calibrationSuite/detectorInfo.py +++ b/calibrationSuite/detectorInfo.py @@ -12,6 +12,7 @@ def __init__(self, detType, detSubtype="1d", detVersion=0): # declare all detector-specific info vars here in case any setup_X functions don't, # and use -1 so caller knows things are not setup (non-0 to avoid error on divide. self.nModules = -1 + self.detSubtype = detSubtype self.nRows = -1 self.nCols = -1 @@ -45,7 +46,7 @@ def __init__(self, detType, detSubtype="1d", detVersion=0): if detType not in knownTypes: raise Exception("type %s not in known types %s" % (detType, str(knownTypes))) - self.epix10kCameraTypes = {1: "Epix10ka", 4: "Epix10kaQuad", 16: "Epix10ka2M"} + self.ePix10kCameraTypes = {1: "Epix10ka", 4: "Epix10kaQuad", 16: "Epix10ka2M"} self.jungfrauCameraTypes = {1: "Jungfrau0.5", 2: "Jungfrau1M", 8: "Jungfrau4M"} def setupDetector(self): ## needs nModules to be set diff --git a/calibrationSuite/psanaCommon.py b/calibrationSuite/psanaCommon.py index 52df33c..14d12cf 100755 --- a/calibrationSuite/psanaCommon.py +++ b/calibrationSuite/psanaCommon.py @@ -266,7 +266,7 @@ def setupFromCmdlineArgs(self): if self.args.nModules is not None: raise RuntimeError("should not specify exact detector type and n modules") if epix10k: - nModules = [k for k in self.detectorInfo.epix10kCameraTypes.keys() if self.detectorInfo.epix10kCameraTypes[k]==self.detType] + nModules = [k for k in self.detectorInfo.ePix10kCameraTypes.keys() if self.detectorInfo.ePix10kCameraTypes[k]==self.detType] if jungfrau: nModules = [k for k in self.detectorInfo.jungfrauCameraTypes.keys() if self.detectorInfo.jungfrauCameraTypes[k]==self.detType] if nModules == []: diff --git a/suite_scripts/AnalyzeH5.py b/suite_scripts/AnalyzeH5.py index c9b7bb7..a413412 100644 --- a/suite_scripts/AnalyzeH5.py +++ b/suite_scripts/AnalyzeH5.py @@ -41,7 +41,7 @@ def __init__(self): self.label = args.label self.camera = 0 self.seedCut = args.seedCut - self.isTestRun = 'testRun' in args.special + self.isTestRun = args.special is not None and 'testRun' in args.special def getFiles(self): fileNames = self.files.split(",") diff --git a/suite_scripts/EventScanParallelSlice.py b/suite_scripts/EventScanParallelSlice.py index b1ed41a..9c810aa 100644 --- a/suite_scripts/EventScanParallelSlice.py +++ b/suite_scripts/EventScanParallelSlice.py @@ -311,7 +311,7 @@ def analyze_h5(self, dataFile, label): pulseId = 0 else: timestamp = evt.datetime().timestamp() - pulsId = esp.getPulseId(evt) + pulseId = esp.getPulseId(evt) smdDict = { "timestamps": timestamp, "pulseIds": pulseId, diff --git a/tests/test_DetectorInfo.py b/tests/test_DetectorInfo.py index ca123eb..f800db0 100644 --- a/tests/test_DetectorInfo.py +++ b/tests/test_DetectorInfo.py @@ -3,6 +3,7 @@ def test_epixhr_setup(): detector = DetectorInfo("epixhr") + detector.setupDetector() assert detector.detectorType == "epixhr" assert detector.g0cut == 1 << 14 @@ -20,6 +21,7 @@ def test_epixhr_setup(): def test_epixm_setup(): detector = DetectorInfo("epixm") + detector.setupDetector() assert detector.detectorType == "epixm" assert detector.g0cut == 1 << 15 @@ -41,6 +43,7 @@ def test_epixm_setup(): def test_archon_setup_1d(): detector = DetectorInfo("archon") + detector.setupDetector() assert detector.detectorType == "archon" assert detector.dimension == 2 @@ -54,6 +57,7 @@ def test_archon_setup_1d(): def test_archon_setup_2d(): detector = DetectorInfo("archon", "2d") + detector.setupDetector() assert detector.detectorType == "archon" assert detector.dimension == 3 diff --git a/tests/test_SuiteScripts.py b/tests/test_SuiteScripts.py index ab7f129..db34a18 100644 --- a/tests/test_SuiteScripts.py +++ b/tests/test_SuiteScripts.py @@ -458,7 +458,6 @@ def test_HistogramFlux(suite_tester, command, output_dir_name): pytest.skip("Can only test with psana library on S3DF!") suite_tester.test_command(command, output_dir_name) - # this test uses input data from sdf filepath (available on s3df), # and we remove r102_custers.npy from the correctness comparison b/c this file is around 10gb! @pytest.mark.parametrize( @@ -468,7 +467,7 @@ def test_HistogramFlux(suite_tester, command, output_dir_name): [ "bash", "-c", - "time python AnalyzeH5.py -r 102 -f /sdf/data/lcls/ds/rix/rixx1005922/results/lowFlux/SimpleClusters__c0_r102_n100.h5 -p ./test_analyze_h5 --special testRun && rm ./test_analyze_h5/r102_clusters.npy", + "time python AnalyzeH5.py -r 102 -f /sdf/data/lcls/ds/rix/rixx1005922/results/lowFlux/SimpleClusters_testData_c0_r47_n666.h5 -p ./test_analyze_h5 --special testRun && rm ./test_analyze_h5/r102_clusters.npy", ], "test_analyze_h5", ), @@ -479,7 +478,6 @@ def test_Analyze_h5(suite_tester, command, output_dir_name): pytest.skip("Can only test with psana library on S3DF!") suite_tester.test_command(command, output_dir_name) - # non-working commands... ''' @pytest.mark.parametrize("command, output_dir_name", [