From ce3780e74a8379dd7c8b48eccee7306f5b1f89b5 Mon Sep 17 00:00:00 2001 From: Marco Cammarata Date: Thu, 9 Mar 2017 23:22:26 +0100 Subject: [PATCH] fidex bug, chargeToPhoton was neglecting thickness --- xray/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xray/utils.py b/xray/utils.py index 1fcf2b6..24d6b72 100644 --- a/xray/utils.py +++ b/xray/utils.py @@ -30,11 +30,13 @@ def getEdfFiles(folder,**kw): return getFiles(folder,basename="*.edf*",**kw) def getDelayFromString(string) : - match = _timeInStr_regex_regex.search(string) + match = _timeInStr_regex.search(string) return match and match.group(1) or None _time_regex = re.compile("(-?\d+\.?\d*)((?:s|fs|ms|ns|ps|us)?)") + def strToTime(delay) : + if isinstance(delay,bytes): delay = delay.decode('ascii') _time2value = dict( fs = 1e-15, ps = 1e-12, ns = 1e-9, us = 1e-6, ms = 1e-3, s = 1) match = _time_regex.search(delay) @@ -309,7 +311,7 @@ def chargeToPhoton(chargeOrCurrent,material="Si",thickness=100e-6,energy=10,e_ho """ # calculate absortption - A = 1-transmission(material=material,energy=energy) + A = 1-transmission(material=material,energy=energy,thickness=thickness) chargeOrCurrent = chargeOrCurrent/A e_hole_pair_energy = 3.6e-3