Fit Function: HLOSS2

Fit Function \[\begin{align*} \end{align*}\]
Comments

Fortran

Arguments
namedescriptionunitstype(s)
pt requested photon energy eV real, dimension(:)
pcf coefficient data array real, dimension(9)
kncf number of coefficients in the data array integer
pfit cross section cm2 real, dimension(:)
kermsg error message character
Return values
namedescriptionunitstype(s)
pfit cross section cm2 real, dimension(:)
Code
c
c###################################################################
c
      subroutine hloss2(pe, pcf, kncf, pxs, kermsg)
c
c     this is a subroutine to calculate cross sections (cm[2])
c     versus energy (eV) for electron removal.
c
c     pe = collision energy in eV/amu
c
c     pcf(1-3) = A1 - A3
c
c    - warning- .
c
c     the coefficient array pcf is updated by this routine to
c     include energy independent constants. these coefficients can be
c     used in subsequent calls for the same entry.
c
c     kermsg = blank if no errors
c
c     pxs = cross section in cm[2]
c
c------------------------------------------------------------------------
c
      double precision e, pe, pcf, pxs
      double precision xs1
      double precision a1, a2, a3
c
      dimension pcf(3)
      character*(*) kermsg
c
      if(pe .ge. 0.0) then
        kermsg = ' '
      else
        pxs = 0.0
        return
      endif
c
c generate the energy in keV
c
      e = pe*1.0e-03
c
c     determine the value of the cross section  pxs
c
      if(kncf .eq. 3) then
        a1 = pcf(1)
        a2 = pcf(2)
        a3 = pcf(3)
        xs1 = a1 * (1.d0 - dexp(-a2*dlog(dexp(1.d0) + a3*e)/e))
        pxs = 1.0e-14 * xs1 
      else
          kermsg = ' incorrect number of coefficients passed to hloss2'
          return
      endif
c
      return
      end

Python

Arguments
namedescriptionunitstype(s)
pt requested photon energy eV float, np.ndarray
pcf coefficient data array float, np.ndarray
kncf number of coefficients in the data array int
pfit cross section cm2 float, np.ndarray
kermsg error message str
Return values
namedescriptionunitstype(s)
pfit cross section cm2 float, np.ndarray
Code