@@ -180,14 +180,14 @@ def get_reference_spectra(wavelengths=None, standard="ASTM G173-03"):
180
180
return standard
181
181
182
182
183
- def average_photon_energy (spectrum ):
183
+ def average_photon_energy (spectra ):
184
184
r"""
185
185
Calculate the average photon energy of one or more spectral irradiance
186
186
distributions.
187
187
188
188
Parameters
189
189
----------
190
- spectrum : pandas.Series or pandas.DataFrame
190
+ spectra : pandas.Series or pandas.DataFrame
191
191
192
192
Spectral irradiance, must be positive. [Wm⁻²nm⁻¹]
193
193
@@ -236,7 +236,7 @@ def average_photon_energy(spectrum):
236
236
wavelength, :math:`G(\lambda)` is the spectral irradiance, :math:`q` is the
237
237
elementary charge used here so that the average photon energy,
238
238
:math:`\overline{E_\gamma}`, is expressed in electronvolts (eV). The
239
- integrals are computed over the full wavelength range of the ``spectrum ``
239
+ integrals are computed over the full wavelength range of the ``spectra ``
240
240
parameter.
241
241
242
242
References
@@ -246,24 +246,24 @@ def average_photon_energy(spectrum):
246
246
Photovoltaic in Europe Conference (pp. 1756-1759).
247
247
"""
248
248
249
- if not isinstance (spectrum , (pd .Series , pd .DataFrame )):
250
- raise TypeError ('`spectrum ` must be either a'
249
+ if not isinstance (spectra , (pd .Series , pd .DataFrame )):
250
+ raise TypeError ('`spectra ` must be either a'
251
251
' pandas Series or DataFrame' )
252
252
253
- if (spectrum < 0 ).any ().any ():
253
+ if (spectra < 0 ).any ().any ():
254
254
raise ValueError ('Spectral irradiance data must be positive' )
255
255
256
- hclambda = pd .Series ((constants .h * constants .c )/ (spectrum .T .index * 1e-9 ))
257
- hclambda .index = spectrum .T .index
258
- pfd = spectrum .div (hclambda )
256
+ hclambda = pd .Series ((constants .h * constants .c )/ (spectra .T .index * 1e-9 ))
257
+ hclambda .index = spectra .T .index
258
+ pfd = spectra .div (hclambda )
259
259
260
260
def integrate (e ):
261
261
return trapezoid (e , x = e .T .index , axis = - 1 )
262
262
263
- int_spectrum = integrate (spectrum )
263
+ int_spectra = integrate (spectra )
264
264
int_pfd = integrate (pfd )
265
265
266
266
with np .errstate (invalid = 'ignore' ):
267
- ape = (1 / constants .elementary_charge )* int_spectrum / int_pfd
267
+ ape = (1 / constants .elementary_charge )* int_spectra / int_pfd
268
268
269
269
return ape
0 commit comments