diff --git a/xgm.py b/xgm.py index 86415110902eda26b7cb166115057908bc8f43f1..b4a3c6473f600a0fa6085712caea530991aa50ed 100644 --- a/xgm.py +++ b/xgm.py @@ -591,7 +591,7 @@ tim_calibration_table = { [ 3.69445588e-11, -1.97731342e-07, 3.98203522e-04, -3.78338599e-01, 1.41894119e+02]]) } -def timFactorFromVoltage(voltage, photonEnergy=None, mcp=1): +def timFactorFromTable(voltage, photonEnergy, mcp=1): ''' Returns an energy calibration factor for TIM integrated peak signal (APD) according to calibration from March 2019, proposal 900074, semester 201930, runs 69 - 111 (Ni edge): https://in.xfel.eu/elog/SCS+Beamline/2323 @@ -603,15 +603,12 @@ def timFactorFromVoltage(voltage, photonEnergy=None, mcp=1): voltage: MCP voltage in volts. photonEnergy: FEL photon energy in eV. Calibration factor is linearly interpolated between the known values from the calibration table. - If None, takes the median photon energy from the calibration table. mcp: MCP channel (1, 2, or 3). Output: f: calibration factor in microjoule per APD signal ''' energies = np.sort([key for key in tim_calibration_table]) - if photonEnergy is None: - photonEnergy = np.median(energies) if photonEnergy not in photon_energies: if photonEnergy > energies.max(): photonEnergy = energies.max() @@ -628,4 +625,3 @@ def timFactorFromVoltage(voltage, photonEnergy=None, mcp=1): poly = np.poly1d(tim_calibration_table[photonEnergy][mcp-1]) f = -np.exp(poly(voltage)) return f - \ No newline at end of file