7.83 undulator_brightness

&undulator_brightness  
    STRING tag = NULL;  
    double wavelength = 0;  
    double photon_energy = 0;  
    long   harmonic = 1;  
    double detuning = -0.5;  
    double period_length = 0;  
    long   n_periods = 0;  
    double total_length = 0;  
    double current = 0;  
    long   use_twiss_output_values = 0;  
    double coupling = 0;  
    STRING twiss_element = NULL;  
    long   twiss_occurence = 1;  
    double emitx = 0;  
    double emity = 0;  
    double betax = 0;  
    double alphax = 0;  
    double betay = 0;  
    double alphay = 0;  
    double etax = 0;  
    double etaxp = 0;  
    double etay = 0;  
    double etayp = 0;  
    double Sdelta = 0;  
&end

The command may be issued multiple times to register multiple undulator brightness probes (different photon energies, different undulators, different observation points in the lattice). Each registration creates an RPN scalar named <tag>.brightness, distinguished by the user-supplied tag (same naming convention as rpn_load). Until the first twiss_output runs, the scalar holds the value 0.

The deflection parameter K is not a namelist input. It is derived at every evaluation from the undulator resonance condition

         (       )
    -λu--     K2-
λ = 2nγ2  1 +  2   ,
(17)

using γ obtained from Pref_output (which is γβ) at the chosen Twiss source element, n from harmonic, λu from period_length, and λ from either wavelength or photon_energy. If the requested wavelength is below the fundamental at K=0, the spec warns once and leaves the RPN scalar at its previous value.

Beam parameters (the (ϵ,β,α,η,ηδ) tuple for each plane) are first reduced to their dispersion-corrected effective values before being passed to the brightness routine, so the dispersion fields etax, etaxp, etay, etayp are functional inputs, not ornamental.

The reported brightness is in conventional accelerator units of photons / s / 0.1% BW / mm2 / mrad2.

vary_element