From 8e778eaf5662072846eacb31cd36f1d98c42114e Mon Sep 17 00:00:00 2001 From: Vonka Jakub Date: Mon, 31 Oct 2022 23:14:42 +0100 Subject: [PATCH] added comments --- src/cristallina/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cristallina/utils.py b/src/cristallina/utils.py index 8f1c411..172f218 100644 --- a/src/cristallina/utils.py +++ b/src/cristallina/utils.py @@ -8,6 +8,7 @@ from sfdata import SFDataFiles, sfdatafile, SFScanInfo, SFProcFile from xraydb import material_mu from joblib import Parallel, delayed, cpu_count from scipy.stats.stats import pearsonr +import matplotlib.pyplot as plt def scan_info(run_number,base_path=None,small_data=True): """Returns SFScanInfo object for a given run number. @@ -146,7 +147,7 @@ def find_offset(run_no_or_scan, ch1,ch2, offsets=range(-7,7),step=0,verbose = Fa """Attempts to find an ideal offset between pids of two channels. Offset is added to Channel_2. Channel_1 is used as reference. Returns best offset, best_correlation, [all offsets, all correlations].""" scan = scan_from_run_number_or_scan(run_no_or_scan) - run_number = int(str(scan.fs)[-19:-15]) + run_number = int(str(scan.fs)[-19:-15]) # Find the run number from the path string d = scan[step] assert len(d[ch1].shape) ==1, "Channel 2 has more than 1 dimension, can't correlate" assert len(d[ch2].shape) ==1, "Channel 2 has more than 1 dimension, can't correlate"