----- file created by xop_makedoc on: Mon Mar 31 12:31:11 2003
----- Documentation for /scisoft/XRayOptics/xop2.1/src_idl/sources/sync_ang.pro -----

 NAME:
       SYNC_ANG

 PURPOSE:
       Calculates the synchrotron radiation angular distribution

 CATEGORY:
       Mathematics.

 CALLING SEQUENCE:
       Result = sync_angle(flag, angle )

 INPUTS:
	flag: 	0 Flux fully integrated in photon energy
		1 Flux at a given photon energy
       amgle:  the angle array [in mrad]

 KEYWORD PARAMETERS:
	POLARIZATION: 0 Total 
		      1 Parallel       (l2=1, l3=0, in Sokolov&Ternov notation)
		      2 Perpendicular  (l2=0, l3=1)

	IF FLAG=0 THE FOLLOWING KEYWORDS MUST BE ENTERED
		E_GeV= The electron energy [in GeV] 
		I_A= the electron beam intensity [in A]
		HDiv_mrad= the horizontal divergence [in mrad]
		R_M= the bending magnet radius [in m]

	IF FLAG=1 THE FOLLOWING KEYWORDS MUST BE ENTERED
		All keyworsd for FLAG=0 plus:
		Energy = the energy value [in eV]
		EC_eV= The critical energy [eV]

 OUTPUTS:
       returns the array with the flux [photons/sec/0.1%bw]

 PROCEDURE:

	References: 
		G K Green, "Spectra and optics of synchrotron radiation" 
			BNL 50522 report (1976)
		A A Sokolov and I M Ternov, Synchrotron Radiation, 
			Akademik-Verlag, Berlin, 1968

 MODIFICATION HISTORY:
       Written by:     M. Sanchez del Rio, srio@esrf.fr, 2002-06-03


