def SPEEDY_band_fraction(T):
<EOL>Tarray = np.array(T)<EOL>Tarray = np.minimum(Tarray, <NUM_LIT>)<EOL>Tarray = np.maximum(Tarray, <NUM_LIT>)<EOL>num_band = <NUM_LIT:4><EOL>dims = [num_band]<EOL>dims.extend(Tarray.shape)<EOL>FBAND = np.zeros(dims)<EOL>EPS2=<NUM_LIT><EOL>FBAND[<NUM_LIT:1>,:] = <NUM_LIT> - <NUM_LIT> *(T-<NUM_LIT>)**<NUM_LIT:2><EOL>FBAND[<NUM_LIT:2>,:] = (<NUM_LIT> - <NUM_LIT> *(T-<NUM_LIT>)**<NUM_LIT:2>)*EPS2<EOL>FBAND[<NUM_LIT:3>,:] = <NUM_LIT> + <NUM_LIT> *(T-<NUM_LIT>)**<NUM_LIT:2><EOL>FBAND[<NUM_LIT:0>,:] = <NUM_LIT:1.> - np.sum(FBAND, axis=<NUM_LIT:0>)<EOL>return FBAND<EOL>
Python / numpy implementation of the formula used by SPEEDY and MITgcm
    to partition longwave emissions into 4 spectral bands.

    Input: temperature in Kelvin

    returns: a four-element array of band fraction

    Reproducing here the FORTRAN code from MITgcm/pkg/aim_v23/phy_radiat.F

    .. code-block:: fortran

              EPS3=0.95 _d 0

              DO JTEMP=200,320
                FBAND(JTEMP,0)= EPSLW
                FBAND(JTEMP,2)= 0.148 _d 0 - 3.0 _d -6 *(JTEMP-247)**2
                FBAND(JTEMP,3)=(0.375 _d 0 - 5.5 _d -6 *(JTEMP-282)**2)*EPS3
                FBAND(JTEMP,4)= 0.314 _d 0 + 1.0 _d -5 *(JTEMP-315)**2
                FBAND(JTEMP,1)= 1. _d 0 -(FBAND(JTEMP,0)+FBAND(JTEMP,2)
             &                           +FBAND(JTEMP,3)+FBAND(JTEMP,4))
              ENDDO

              DO JB=0,NBAND
                DO JTEMP=lwTemp1,199
                  FBAND(JTEMP,JB)=FBAND(200,JB)
                ENDDO
                DO JTEMP=321,lwTemp2
                  FBAND(JTEMP,JB)=FBAND(320,JB)
                ENDDO
              ENDDO