Calculate a flux density from pure gyrosynchrotron emission.

    This combines Dulk (1985) equations 40 and 41, which are fitting functions
    assuming a power-law electron population, with standard radiative transfer
    through a uniform medium. Arguments are:

    b
      Magnetic field strength in Gauss
    ne
      The density of electrons per cubic centimeter with energies greater than 10 keV.
    delta
      The power-law index defining the energy distribution of the electron population,
      with ``n(E) ~ E^(-delta)``. The equation is valid for ``2 <~ delta <~ 5``.
    sinth
      The sine of the angle between the line of sight and the magnetic field direction.
      It's not specified for what range of values the expressions work well.
    width
      The characteristic cross-sectional width of the emitting region, in cm.
    elongation
      The the elongation of the emitting region; ``depth = width * elongation``.
    dist
      The distance to the emitting region, in cm.
    ghz
      The frequencies at which to evaluate the spectrum, **in GHz**.
    E0
      The minimum energy of electrons to consider, in MeV. Defaults to 1 so that
      these functions can be called identically to the gyrosynchrotron functions.

    The return value is the flux density **in μJy**. The arguments can be
    Numpy arrays.

    No complaints are raised if you attempt to use the equations outside of
    their range of validity.

def calc_synch_snu_ujy(b, ne, delta, sinth, width, elongation, dist, ghz, E0=1.):
    """Calculate a flux density from pure gyrosynchrotron emission.

    This combines Dulk (1985) equations 40 and 41, which are fitting functions
    assuming a power-law electron population, with standard radiative transfer
    through a uniform medium. Arguments are:

    b
      Magnetic field strength in Gauss
    ne
      The density of electrons per cubic centimeter with energies greater than 10 keV.
    delta
      The power-law index defining the energy distribution of the electron population,
      with ``n(E) ~ E^(-delta)``. The equation is valid for ``2 <~ delta <~ 5``.
    sinth
      The sine of the angle between the line of sight and the magnetic field direction.
      It's not specified for what range of values the expressions work well.
    width
      The characteristic cross-sectional width of the emitting region, in cm.
    elongation
      The the elongation of the emitting region; ``depth = width * elongation``.
    dist
      The distance to the emitting region, in cm.
    ghz
      The frequencies at which to evaluate the spectrum, **in GHz**.
    E0
      The minimum energy of electrons to consider, in MeV. Defaults to 1 so that
      these functions can be called identically to the gyrosynchrotron functions.

    The return value is the flux density **in μJy**. The arguments can be
    Numpy arrays.

    No complaints are raised if you attempt to use the equations outside of
    their range of validity.

    """
    hz = ghz * 1e9
    eta = calc_synch_eta(b, ne, delta, sinth, hz, E0=E0)
    kappa = calc_synch_kappa(b, ne, delta, sinth, hz, E0=E0)
    snu = calc_snu(eta, kappa, width, elongation, dist)
    ujy = snu * cgs.jypercgs * 1e6
    return ujy