Astra Emission Model
Chapter §15.10.2 Communicated by dabell@radiasoft.net
(a) The definitions of p_x and p_y both have an extra ')' at the end of the line.
(b) Since p_z is defined as p_{total}|\cos(\theta)|, I expect to see p_x = p_{total} \sin(\theta) \cos(\phi) p_y = p_{total} \sin(\theta) \sin(\phi)
(c) I would expect see the angles described as \phi uniformly distributed in the range [0,2\pi), and \theta = \arcsin(x), where x is uniform in [0,1].
(d) When a subscript is a word, such a "total", long-established typographic convention in science and mathematics demands that it be set in an upright (i.e. roman) font. Thus, for example, write p_\text{total}, rather than p_{total}. For more than you might conceivably wish to know on this subject—in excruciating detail—see NIST’s Special Publication 811.