pvfit.measurement package

Submodules

pvfit.measurement.spectral_correction module

class pvfit.measurement.spectral_correction.DataFunction(*, x: numpy.ndarray, y: numpy.ndarray)

Bases: object

Store data representing one/more functions in \(\mathbb{R}^2\) with common, monotonic increasing domain values.

TODO Describe interface.

class pvfit.measurement.spectral_correction.DataFunctionPositiveXNonnegativeY(*, x: numpy.ndarray, y: numpy.ndarray)

Bases: pvfit.measurement.spectral_correction.DataFunction

Store data representing a function in \(\mathbb{R}^2\) with \(0 < x\) and \(0 \leq y\).

TODO Describe interface.

pvfit.measurement.spectral_correction.M(*, S_TD_OC: pvfit.measurement.spectral_correction.SpectralResponsivity, E_TD_OC: pvfit.measurement.spectral_correction.SpectralIrradiance, S_TD_RC: pvfit.measurement.spectral_correction.SpectralResponsivity, E_TD_RC: pvfit.measurement.spectral_correction.SpectralIrradiance, S_RD_OC: pvfit.measurement.spectral_correction.SpectralResponsivity, E_RD_OC: pvfit.measurement.spectral_correction.SpectralIrradiance, S_RD_RC: pvfit.measurement.spectral_correction.SpectralResponsivity, E_RD_RC: pvfit.measurement.spectral_correction.SpectralIrradiance) → numpy.ndarray

Compute spectral mismatch correction factor (\(M\)).

The spectral mismatch is between a photovoltaic (PV) test device (TD) and a PV reference device (RD), each at a particular (non-explicit) temperature and illuminated by a (possibly different) spectral irradiance at operating condition (OC). The corresponding reference condition (RC) of each device need not be the same, but often are. \(M\) should be strictly positive, but could evalute to be zero, infinite, or NaN depending on possible zero values of the component integrals. See the SpectralIrradiance and SpectralResponsivity classes for details on the data function models that inform the computation, which includes vectorized computations.

Parameters:
  • S_TD_OC – Spectral responsivity of TD at OC [A/W].
  • E_TD_OC – Spectral irradiance illuminating TD at OC [W/m2/nm].
  • S_TD_RC – Spectral responsivity of TD at RC [A/W].
  • E_TD_RC – Spectral irradiance illuminating TD at RC [W/m2/nm].
  • S_RD_OC – Spectral responsivity of RD at OC [A/W].
  • E_RD_OC – Spectral irradiance illuminating RD at OC [W/m2/nm].
  • S_RD_RC – Spectral responsivity of RD at RC [A/W].
  • E_RD_RC – Spectral irradiance illuminating RD at RC [W/m2/nm].
Returns:

M – Spectral mismatch correction factor (\(M\)).

Return type:

numpy.ndarray

Warns:

UserWarning – If \(M\) is computed as non-positive, infinite, or NaN.

See also

inner_product()
The function used to compute the integrals of the products of two data functions.

Notes

\(M\) is defined by this relationship between the short-circuit currents (\(I_\mathrm{sc}\)) of a TD and a RD at their respective OC and RC–

\[\frac{I_\mathrm{sc,TD,OC}}{I_\mathrm{sc,TD,RC}} = M \frac{I_\mathrm{sc,RD,OC}}{I_\mathrm{sc,RD,RC}},\]

so that, under linearity and homogeneity assumption, \(M\) is computed as–

\[\begin{split}M &= \frac{I_\mathrm{sc,TD,OC} I_\mathrm{sc,RD,RC}} {I_\mathrm{sc,TD,RC} I_\mathrm{sc,RD,OC}} \\ &= \frac{ \int_{\lambda=0}^\infty S_\mathrm{TD}(T_\mathrm{TD,OC}, \lambda) E_\mathrm{TD,OC}(\lambda) \, \mathrm{d}\lambda \, \int_{\lambda=0}^\infty S_\mathrm{RD}(T_\mathrm{RD,RC}, \lambda) E_\mathrm{RD,RC}(\lambda) \, \mathrm{d}\lambda}{ \int_{\lambda=0}^\infty S_\mathrm{TD}(T_\mathrm{TD,RC}, \lambda) E_\mathrm{TD,RC}(\lambda) \, \mathrm{d}\lambda \, \int_{\lambda=0}^\infty S_\mathrm{RD}(T_\mathrm{RD,OC}, \lambda) E_\mathrm{RD,OC}(\lambda) \, \mathrm{d}\lambda},\end{split}\]

where any pertinent constant scaling factors cancel out between numerator and denominator, such as device areas, curve measurement scaling errors, and unit conversions [1].

References

[1]M. Campanelli and B. Hamadani, “Calibration of a single‐diode performance model without a short‐circuit temperature coefficient,” Energy Science & Engineering, vol. 6, no. 4, pp. 222-238, 2018. https://doi.org/10.1002/ese3.190.
class pvfit.measurement.spectral_correction.QuantumEfficiency(*, lambda_nm: numpy.ndarray, QE: numpy.ndarray, is_percent: bool = False)

Bases: pvfit.measurement.spectral_correction.DataFunctionPositiveXNonnegativeY

Store data representing a quantum efficiency (QE) curve.

TODO Describe interface and units [nm] and [1] or [%].

QE

Return QE as fraction.

QE_percent

Return QE as percent.

S_A_per_W

Convert quantum efficiency (QE) curve to spectral responsivity (SR) curve.

TODO Describe interface.

lambda_nm

Return wavelengths.

class pvfit.measurement.spectral_correction.SpectralIrradiance(*, lambda_nm: numpy.ndarray, E_W_per_m2_nm: numpy.ndarray)

Bases: pvfit.measurement.spectral_correction.DataFunctionPositiveXNonnegativeY

Store data representing a spectral irradiance curve.

TODO Describe interface and units [nm] and [A/W/m^2].

E_W_per_m2_nm
lambda_nm
class pvfit.measurement.spectral_correction.SpectralResponsivity(*, lambda_nm: numpy.ndarray, S_A_per_W: numpy.ndarray)

Bases: pvfit.measurement.spectral_correction.DataFunctionPositiveXNonnegativeY

Store data representing a spectral responsivity (SR) curve.

TODO Describe interface and units [nm] and [A/W].

QE

Convert spectral responsivity (SR) curve to quantum efficiency (QE) curve.

TODO Describe interface.

S_A_per_W
lambda_nm
pvfit.measurement.spectral_correction.inner_product(*, f1: pvfit.measurement.spectral_correction.DataFunction, f2: pvfit.measurement.spectral_correction.DataFunction) → numpy.ndarray

Compute inner product of two data functions.

The inner product of two data functions is the integral of the product of the two functions over their common domain of defintion. Because the data function model is piecewise linear, an algebraic solution exists and is used for the computation. See the DataFunction class for details on the model that informs the computation.

Parameters:
  • f1 – First data function.
  • f2 – Second data function.
Returns:

inner_product – Integral of the product of the two data functions over their common domain.

Return type:

numpy.ndarray

Warns:

UserWarning – If inner_product is non-finite or is zero due to no domain overlap.

Notes

The inner product is computed as–

\[\int_{x=x_1}^{x_2} f_1(x) \, f_{2}(x) \, \mathrm{d}x,\]

where the interval of integration \([x_1, x_2]\) is the common domain of the two data functions. If the domains do not overlap, then zero is returned.

pvfit.measurement.spectral_correction_data module

Sample data for example computations.

Module contents