From 2e4a3c83a59a69a04b5354f3991ab13b871dc492 Mon Sep 17 00:00:00 2001 From: marco cammarata Date: Thu, 16 Mar 2017 09:49:00 +0100 Subject: [PATCH] fixed bug, the keyword parameter e_hole_pair was actually not used --- xray/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xray/utils.py b/xray/utils.py index 864d844..d1f2efa 100644 --- a/xray/utils.py +++ b/xray/utils.py @@ -305,7 +305,7 @@ def transmission(material='Si',thickness=100e-6, density=None, natural_density=N return np.exp(-thickness/att_len) -def chargeToPhoton(chargeOrCurrent,material="Si",thickness=100e-6,energy=10,e_hole_pair=3.6): +def chargeToPhoton(chargeOrCurrent,material="Si",thickness=100e-6,energy=10,e_hole_pair=3.63): """ Function to convert charge (or current to number of photons (or number of photons per second) @@ -322,8 +322,8 @@ def chargeToPhoton(chargeOrCurrent,material="Si",thickness=100e-6,energy=10,e_ho A = 1-transmission(material=material,energy=energy,thickness=thickness) chargeOrCurrent = chargeOrCurrent/A - e_hole_pair_energy = 3.6e-3 - n_charge_per_photon = energy/e_hole_pair_energy + e_hole_pair_energy_keV = e_hole_pair*1e-3 + n_charge_per_photon = energy/e_hole_pair_energy_keV # convert to Q charge_per_photon = n_charge_per_photon*1.60217662e-19 nphoton = chargeOrCurrent/charge_per_photon