Skip to content

Commit 33451a1

Browse files
author
AdamRJensen
committed
Update documentation
1 parent 6ec3c9b commit 33451a1

File tree

1 file changed

+46
-40
lines changed

1 file changed

+46
-40
lines changed

pvlib/iotools/pvgis.py

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,98 +24,102 @@
2424
URL = 'https://re.jrc.ec.europa.eu/api/'
2525

2626

27-
def get_pvgis_hourly(lat, lon, angle=0, aspect=0,
27+
def get_pvgis_hourly(lat, lon, angle=0, aspect=0,
2828
outputformat='json', usehorizon=True,
29-
userhorizon=None, raddatabase=None,
29+
userhorizon=None, raddatabase=None,
3030
startyear=None, endyear=None,
3131
pvcalculation=False, peakpower=None,
3232
pvtechchoice='crystSi', mountingplace='free', loss=None,
3333
trackingtype=0,
3434
optimal_inclination=False, optimalangles=False,
3535
components=True, url=URL, timeout=30):
3636
"""
37-
Get hourly solar radiation data and optimal modeled PV power output from
38-
PVGIS. For more information see the PVGIS [1]_ TMY tool
39-
documentation [2]_.
37+
Get hourly solar radiation data and modeled PV power output from PVGIS
38+
[1]_.
39+
4040
Parameters
4141
----------
42-
lat : float
42+
lat: float
4343
Latitude in degrees north
44-
lon : float
44+
lon: float
4545
Longitude in degrees east
4646
angle: float, default: 0
4747
Tilt angle from horizontal plane. Not relevant for 2-axis tracking.
4848
aspect: float, default: 0
4949
Orientation (azimuth angle) of the (fixed) plane. 0=south, 90=west,
5050
-90: east. Not relevant for tracking systems.
51-
outputformat : str, default: 'json'
52-
Must be in ``['csv', 'basic', 'json']``. See PVGIS TMY tool
53-
documentation [2]_ for more info.
54-
usehorizon : bool, default: True
55-
include effects of horizon
56-
userhorizon : list of float, default: None
57-
optional user specified elevation of horizon in degrees, at equally
51+
outputformat: str, default: 'json'
52+
Must be in ``['csv', 'json']``. See PVGIS hourly data documentation
53+
[2]_ for more info.
54+
usehorizon: bool, default: True
55+
Include effects of horizon
56+
userhorizon: list of float, default: None
57+
Optional user specified elevation of horizon in degrees, at equally
5858
spaced azimuth clockwise from north, only valid if `usehorizon` is
5959
true, if `usehorizon` is true but `userhorizon` is `None` then PVGIS
6060
will calculate the horizon [4]_
61-
raddatabase : str, default: None
61+
raddatabase: str, default: None
6262
Name of radiation database. Options depend on location, see [3]_.
63-
startyear : int, default: None
64-
first year of the radiation time series. Defaults to first year avaiable.
65-
endyear : int, default: None
66-
last year of the radiation time series. Defaults to last year avaiable.
67-
pvcalculation : bool, default: False
63+
startyear: int, default: None
64+
First year of the radiation time series. Defaults to first year
65+
avaiable.
66+
endyear: int, default: None
67+
Last year of the radiation time series. Defaults to last year avaiable.
68+
pvcalculation: bool, default: False
6869
Also return estimate of hourly production.
69-
peakpower : float, default: None
70+
peakpower: float, default: None
7071
Nominal power of PV system in kW. Required if pvcalculation=True.
71-
pvtechchoice : {'crystSi', 'CIS', 'CdTe', 'Unknown'}, default: 'crystSi'
72+
pvtechchoice: {'crystSi', 'CIS', 'CdTe', 'Unknown'}, default: 'crystSi'
7273
PV technology.
73-
mountingplace : {'free', 'building'}, default: free
74+
mountingplace: {'free', 'building'}, default: free
7475
Type of mounting for PV system. Options of 'free' for free-standing
7576
and 'building' for building-integrated.
76-
loss : float, default: None
77-
Sum of PV system losses in percent. Required if pvcalculation=True
77+
loss: float, default: None
78+
Sum of PV system losses in percent. Required if pvcalculation=True
7879
trackingtype: {0, 1, 2, 3, 4, 5}, default: 0
7980
Type of suntracking. 0=fixed, 1=single horizontal axis aligned
8081
north-south, 2=two-axis tracking, 3=vertical axis tracking, 4=single
8182
horizontal axis aligned east-west, 5=single inclined axis aligned
8283
north-south.
83-
optimalinclination : bool, default: False
84+
optimalinclination: bool, default: False
8485
Calculate the optimum tilt angle. Not relevant for 2-axis tracking
85-
optimalangles : bool, default: False
86+
optimalangles: bool, default: False
8687
Calculate the optimum tilt and azimuth angles. Not relevant for 2-axis
8788
tracking.
88-
components : bool, default: True
89+
components: bool, default: True
8990
Output solar radiation components (beam, diffuse, and reflected).
9091
Otherwise only global irradiance is returned.
91-
url : str, default :const:`pvlib.iotools.pvgis.URL`
92-
base url of PVGIS API, append ``tmy`` to get TMY endpoint
93-
timeout : int, default: 30
94-
time in seconds to wait for server response before timeout
92+
url: str, default:const:`pvlib.iotools.pvgis.URL`
93+
Base url of PVGIS API, append ``seriescalc`` to get hourly data
94+
endpoint
95+
timeout: int, default: 30
96+
Time in seconds to wait for server response before timeout
97+
9598
Returns
9699
-------
97100
data : pandas.DataFrame
98-
the weather data
99-
months_selected : list
100-
TMY year for each month, ``None`` for basic and EPW
101+
Time-series of hourly data
101102
inputs : dict
102-
the inputs, ``None`` for basic and EPW
103+
Dictionary of the request input parameters
103104
meta : list or dict
104-
meta data, ``None`` for basic
105+
meta data
106+
105107
Raises
106108
------
107109
requests.HTTPError
108110
if the request response status is ``HTTP/1.1 400 BAD REQUEST``, then
109111
the error message in the response will be raised as an exception,
110112
otherwise raise whatever ``HTTP/1.1`` error occurred
113+
111114
See also
112115
--------
113-
read_pvgis_tmy
116+
pvlib.iotools.read_pvgis_hourly
117+
114118
References
115119
----------
116120
.. [1] `PVGIS <https://ec.europa.eu/jrc/en/pvgis>`_
117-
.. [2] `PVGIS hourly radiation data
118-
<https://re.jrc.ec.europa.eu/pvg_tools/en/#HR>`_
121+
.. [2] `PVGIS Hourly Radiation
122+
<https://ec.europa.eu/jrc/en/PVGIS/tools/hourly-radiation>`_
119123
.. [3] `PVGIS Non-interactive service
120124
<https://ec.europa.eu/jrc/en/PVGIS/docs/noninteractive>`
121125
.. [3] `PVGIS horizon profile tool
@@ -170,6 +174,8 @@ def get_pvgis_hourly(lat, lon, angle=0, aspect=0,
170174
if outputformat == 'json':
171175
src = res.json()
172176
return _parse_pvgis_hourly_json(src)
177+
elif outputformat == 'csv':
178+
return _parse_pvgis_hourly_csv(src)
173179
else:
174180
# this line is never reached because if outputformat is not valid then
175181
# the response is HTTP/1.1 400 BAD REQUEST which is handled earlier

0 commit comments

Comments
 (0)