pvlib 0.11.0a1__py3-none-any.whl → 0.11.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pvlib/atmosphere.py +157 -1
- pvlib/bifacial/__init__.py +4 -4
- pvlib/bifacial/loss_models.py +163 -0
- pvlib/clearsky.py +18 -29
- pvlib/data/pvgis_tmy_meta.json +32 -93
- pvlib/data/pvgis_tmy_test.dat +8761 -8761
- pvlib/data/tmy_45.000_8.000_2005_2020.csv +8789 -0
- pvlib/data/tmy_45.000_8.000_2005_2020.epw +8768 -0
- pvlib/data/tmy_45.000_8.000_2005_2020.json +1 -0
- pvlib/data/tmy_45.000_8.000_2005_2020.txt +8761 -0
- pvlib/data/tmy_45.000_8.000_userhorizon.json +1 -1
- pvlib/data/variables_style_rules.csv +2 -1
- pvlib/iotools/pvgis.py +39 -3
- pvlib/irradiance.py +141 -120
- pvlib/location.py +5 -5
- pvlib/modelchain.py +1 -1
- pvlib/pvsystem.py +2 -2
- pvlib/shading.py +8 -8
- pvlib/singlediode.py +1 -1
- pvlib/solarposition.py +55 -50
- pvlib/spa.py +24 -22
- pvlib/spectrum/__init__.py +9 -4
- pvlib/spectrum/irradiance.py +272 -0
- pvlib/spectrum/mismatch.py +118 -508
- pvlib/spectrum/response.py +280 -0
- pvlib/spectrum/spectrl2.py +16 -16
- pvlib/tests/bifacial/test_losses_models.py +54 -0
- pvlib/tests/iotools/test_pvgis.py +57 -11
- pvlib/tests/spectrum/__init__.py +0 -0
- pvlib/tests/spectrum/conftest.py +40 -0
- pvlib/tests/spectrum/test_irradiance.py +138 -0
- pvlib/tests/{test_spectrum.py → spectrum/test_mismatch.py} +32 -306
- pvlib/tests/spectrum/test_response.py +124 -0
- pvlib/tests/spectrum/test_spectrl2.py +72 -0
- pvlib/tests/test_atmosphere.py +71 -0
- pvlib/tests/test_clearsky.py +37 -25
- pvlib/tests/test_irradiance.py +6 -6
- pvlib/tests/test_solarposition.py +84 -36
- pvlib/tests/test_spa.py +1 -1
- pvlib/tools.py +26 -2
- pvlib/tracking.py +53 -47
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/METADATA +31 -29
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/RECORD +47 -38
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/WHEEL +1 -1
- pvlib/data/tmy_45.000_8.000_2005_2016.csv +0 -8789
- pvlib/data/tmy_45.000_8.000_2005_2016.epw +0 -8768
- pvlib/data/tmy_45.000_8.000_2005_2016.json +0 -1
- pvlib/data/tmy_45.000_8.000_2005_2016.txt +0 -8761
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/AUTHORS.md +0 -0
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/LICENSE +0 -0
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.1.dist-info}/top_level.txt +0 -0
|
@@ -10,6 +10,7 @@ bhi;beam/direct horizontal irradiance
|
|
|
10
10
|
ghi;global horizontal irradiance
|
|
11
11
|
ghi_extra;horizontal irradiance at top of atmosphere (extraterrestrial)
|
|
12
12
|
gri;ground-reflected irradiance
|
|
13
|
+
ape;average photon energy
|
|
13
14
|
aoi;angle of incidence between :math:`90\deg` and :math:`90\deg`
|
|
14
15
|
aoi_projection;cos(aoi)
|
|
15
16
|
airmass;airmass
|
|
@@ -49,7 +50,7 @@ transposition_factor; the gain ratio of the radiation on inclined plane to globa
|
|
|
49
50
|
pdc0; nameplate DC rating
|
|
50
51
|
pdc, dc; dc power
|
|
51
52
|
gamma_pdc; module temperature coefficient. Typically in units of 1/C.
|
|
52
|
-
pac, ac; ac
|
|
53
|
+
pac, ac; ac power
|
|
53
54
|
eta_inv; inverter efficiency
|
|
54
55
|
eta_inv_ref; reference inverter efficiency
|
|
55
56
|
eta_inv_nom; nominal inverter efficiency
|
pvlib/iotools/pvgis.py
CHANGED
|
@@ -18,10 +18,10 @@ import io
|
|
|
18
18
|
import json
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
import requests
|
|
21
|
+
import numpy as np
|
|
21
22
|
import pandas as pd
|
|
23
|
+
import pytz
|
|
22
24
|
from pvlib.iotools import read_epw, parse_epw
|
|
23
|
-
import warnings
|
|
24
|
-
from pvlib._deprecation import pvlibDeprecationWarning
|
|
25
25
|
|
|
26
26
|
URL = 'https://re.jrc.ec.europa.eu/api/'
|
|
27
27
|
|
|
@@ -390,9 +390,33 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
|
|
|
390
390
|
raise ValueError(err_msg)
|
|
391
391
|
|
|
392
392
|
|
|
393
|
+
def _coerce_and_roll_tmy(tmy_data, tz, year):
|
|
394
|
+
"""
|
|
395
|
+
Assumes ``tmy_data`` input is UTC, converts from UTC to ``tz``, rolls
|
|
396
|
+
dataframe so timeseries starts at midnight, and forces all indices to
|
|
397
|
+
``year``. Only works for integer ``tz``, but ``None`` and ``False`` are
|
|
398
|
+
re-interpreted as zero / UTC.
|
|
399
|
+
"""
|
|
400
|
+
if tz:
|
|
401
|
+
tzname = pytz.timezone(f'Etc/GMT{-tz:+d}')
|
|
402
|
+
else:
|
|
403
|
+
tz = 0
|
|
404
|
+
tzname = pytz.timezone('UTC')
|
|
405
|
+
new_index = pd.DatetimeIndex([
|
|
406
|
+
timestamp.replace(year=year, tzinfo=tzname)
|
|
407
|
+
for timestamp in tmy_data.index],
|
|
408
|
+
name=f'time({tzname})')
|
|
409
|
+
new_tmy_data = pd.DataFrame(
|
|
410
|
+
np.roll(tmy_data, tz, axis=0),
|
|
411
|
+
columns=tmy_data.columns,
|
|
412
|
+
index=new_index)
|
|
413
|
+
return new_tmy_data
|
|
414
|
+
|
|
415
|
+
|
|
393
416
|
def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
|
|
394
417
|
userhorizon=None, startyear=None, endyear=None,
|
|
395
|
-
map_variables=True, url=URL, timeout=30
|
|
418
|
+
map_variables=True, url=URL, timeout=30,
|
|
419
|
+
roll_utc_offset=None, coerce_year=None):
|
|
396
420
|
"""
|
|
397
421
|
Get TMY data from PVGIS.
|
|
398
422
|
|
|
@@ -424,6 +448,13 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
|
|
|
424
448
|
base url of PVGIS API, append ``tmy`` to get TMY endpoint
|
|
425
449
|
timeout : int, default 30
|
|
426
450
|
time in seconds to wait for server response before timeout
|
|
451
|
+
roll_utc_offset: int, optional
|
|
452
|
+
Use to specify a time zone other than the default UTC zero and roll
|
|
453
|
+
dataframe by ``roll_utc_offset`` so it starts at midnight on January
|
|
454
|
+
1st. Ignored if ``None``, otherwise will force year to ``coerce_year``.
|
|
455
|
+
coerce_year: int, optional
|
|
456
|
+
Use to force indices to desired year. Will default to 1990 if
|
|
457
|
+
``coerce_year`` is not specified, but ``roll_utc_offset`` is specified.
|
|
427
458
|
|
|
428
459
|
Returns
|
|
429
460
|
-------
|
|
@@ -510,6 +541,11 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
|
|
|
510
541
|
if map_variables:
|
|
511
542
|
data = data.rename(columns=VARIABLE_MAP)
|
|
512
543
|
|
|
544
|
+
if not (roll_utc_offset is None and coerce_year is None):
|
|
545
|
+
# roll_utc_offset is specified, but coerce_year isn't
|
|
546
|
+
coerce_year = coerce_year or 1990
|
|
547
|
+
data = _coerce_and_roll_tmy(data, roll_utc_offset, coerce_year)
|
|
548
|
+
|
|
513
549
|
return data, months_selected, inputs, meta
|
|
514
550
|
|
|
515
551
|
|