Skip to content

Utils

focal_length(radius, energy, N=1)

Calculate focal length using the pcds version of the focal length calculator

Source code in tfs/utils.py
23
24
25
26
27
28
29
30
31
def focal_length(radius, energy,N=1):
    """
    Calculate focal length using the pcds version of the focal length calculator
    """
    if N!=1:
        logger.error('N does not equal 1!')
    focal_length = calc.be_lens_calcs.calc_focal_length_for_single_lens(energy*1E-3,radius*1E-6)

    return focal_length

focal_length_old(radius, energy, N=1)

Calculate the focal length of a Beryllium lens Ref: HR Beguiristain et al. OPTICS LETTERS, Vol. 27, No. 9 (2002)

Probably want to use pcdscalc instead eventually

Source code in tfs/utils.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def focal_length_old(radius, energy, N=1):
    """
    Calculate the focal length of a Beryllium lens
    Ref: HR Beguiristain et al. OPTICS LETTERS, Vol. 27, No. 9 (2002)

    Probably want to use pcdscalc instead eventually
    """
    # Get scattering factors
    f1, f2 = pt.Be.xray.scattering_factors(energy=energy/1000)

    # Calculate delta (refraction index)
    f = f1+f2*1j
    f = f*p_be*NA/m_be
    wavelength = (12389.4/energy)*1E-08  # [cm]
    delta = (eRad * wavelength**2 * f / (2*np.pi)).real
    # delta = be_calcs.get_delta(energy/1000, 'Be', p_be) # too slow

    # f = R / (2N*delta)
    return radius*1e-6/2/N/delta