def sapm(effective_irradiance, temp_cell, module):
T0 = <NUM_LIT><EOL>q = <NUM_LIT>  <EOL>kb = <NUM_LIT>  <EOL>Ee = np.array(effective_irradiance, dtype='<STR_LIT>')<EOL>Ee_gt_0 = np.full_like(Ee, False, dtype='<STR_LIT:bool>')<EOL>Ee_eq_0 = np.full_like(Ee, False, dtype='<STR_LIT:bool>')<EOL>notnan = ~np.isnan(Ee)<EOL>np.greater(Ee, <NUM_LIT:0>, where=notnan, out=Ee_gt_0)<EOL>np.equal(Ee, <NUM_LIT:0>, where=notnan, out=Ee_eq_0)<EOL>Bvmpo = module['<STR_LIT>'] + module['<STR_LIT>']*(<NUM_LIT:1> - Ee)<EOL>Bvoco = module['<STR_LIT>'] + module['<STR_LIT>']*(<NUM_LIT:1> - Ee)<EOL>delta = module['<STR_LIT:N>'] * kb * (temp_cell + <NUM_LIT>) / q<EOL>logEe = np.full_like(Ee, np.nan)<EOL>np.log(Ee, where=Ee_gt_0, out=logEe)<EOL>logEe = np.where(Ee_eq_0, -np.inf, logEe)<EOL>cells_in_series = module['<STR_LIT>']<EOL>out = OrderedDict()<EOL>out['<STR_LIT>'] = (<EOL>module['<STR_LIT>'] * Ee * (<NUM_LIT:1> + module['<STR_LIT>']*(temp_cell - T0)))<EOL>out['<STR_LIT>'] = (<EOL>module['<STR_LIT>'] * (module['<STR_LIT>']*Ee + module['<STR_LIT>']*(Ee**<NUM_LIT:2>)) *<EOL>(<NUM_LIT:1> + module['<STR_LIT>']*(temp_cell - T0)))<EOL>out['<STR_LIT>'] = np.maximum(<NUM_LIT:0>, (<EOL>module['<STR_LIT>'] + cells_in_series * delta * logEe +<EOL>Bvoco*(temp_cell - T0)))<EOL>out['<STR_LIT>'] = np.maximum(<NUM_LIT:0>, (<EOL>module['<STR_LIT>'] +<EOL>module['<STR_LIT>'] * cells_in_series * delta * logEe +<EOL>module['<STR_LIT>'] * cells_in_series * ((delta * logEe) ** <NUM_LIT:2>) +<EOL>Bvmpo*(temp_cell - T0)))<EOL>out['<STR_LIT>'] = out['<STR_LIT>'] * out['<STR_LIT>']<EOL>out['<STR_LIT>'] = (<EOL>module['<STR_LIT>'] * (module['<STR_LIT>']*Ee + module['<STR_LIT>']*(Ee**<NUM_LIT:2>)) *<EOL>(<NUM_LIT:1> + module['<STR_LIT>']*(temp_cell - T0)))<EOL>out['<STR_LIT>'] = (<EOL>module['<STR_LIT>'] * (module['<STR_LIT>']*Ee + module['<STR_LIT>']*(Ee**<NUM_LIT:2>)) *<EOL>(<NUM_LIT:1> + module['<STR_LIT>']*(temp_cell - T0)))<EOL>if isinstance(out['<STR_LIT>'], pd.Series):<EOL><INDENT>out = pd.DataFrame(out)<EOL><DEDENT>return out<EOL>
The Sandia PV Array Performance Model (SAPM) generates 5 points on a
PV module's I-V curve (Voc, Isc, Ix, Ixx, Vmp/Imp) according to
SAND2004-3535. Assumes a reference cell temperature of 25 C.

Parameters
----------
effective_irradiance : numeric
    Effective irradiance (suns).

temp_cell : numeric
    The cell temperature (degrees C).

module : dict-like
    A dict, Series, or DataFrame defining the SAPM performance
    parameters. See the notes section for more details.

Returns
-------
A DataFrame with the columns:

    * i_sc : Short-circuit current (A)
    * i_mp : Current at the maximum-power point (A)
    * v_oc : Open-circuit voltage (V)
    * v_mp : Voltage at maximum-power point (V)
    * p_mp : Power at maximum-power point (W)
    * i_x : Current at module V = 0.5Voc, defines 4th point on I-V
      curve for modeling curve shape
    * i_xx : Current at module V = 0.5(Voc+Vmp), defines 5th point on
      I-V curve for modeling curve shape

Notes
-----
The coefficients from SAPM which are required in ``module`` are
listed in the following table.

The modules in the Sandia module database contain these
coefficients, but the modules in the CEC module database do not.
Both databases can be accessed using :py:func:`retrieve_sam`.

================   ========================================================
Key                Description
================   ========================================================
A0-A4              The airmass coefficients used in calculating
                   effective irradiance
B0-B5              The angle of incidence coefficients used in calculating
                   effective irradiance
C0-C7              The empirically determined coefficients relating
                   Imp, Vmp, Ix, and Ixx to effective irradiance
Isco               Short circuit current at reference condition (amps)
Impo               Maximum power current at reference condition (amps)
Aisc               Short circuit current temperature coefficient at
                   reference condition (1/C)
Aimp               Maximum power current temperature coefficient at
                   reference condition (1/C)
Bvoco              Open circuit voltage temperature coefficient at
                   reference condition (V/C)
Mbvoc              Coefficient providing the irradiance dependence for the
                   BetaVoc temperature coefficient at reference irradiance
                   (V/C)
Bvmpo              Maximum power voltage temperature coefficient at
                   reference condition
Mbvmp              Coefficient providing the irradiance dependence for the
                   BetaVmp temperature coefficient at reference irradiance
                   (V/C)
N                  Empirically determined "diode factor" (dimensionless)
Cells_in_Series    Number of cells in series in a module's cell string(s)
IXO                Ix at reference conditions
IXXO               Ixx at reference conditions
FD                 Fraction of diffuse irradiance used by module
================   ========================================================

References
----------
[1] King, D. et al, 2004, "Sandia Photovoltaic Array Performance
Model", SAND Report 3535, Sandia National Laboratories, Albuquerque,
NM.

See Also
--------
retrieve_sam
sapm_celltemp