diff --git a/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_CM_10kWp_CIS_5_2a_2013_2014.json b/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_CM_10kWp_CIS_5_2a_2013_2014.json deleted file mode 100644 index 3a27f4f368..0000000000 --- a/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_CM_10kWp_CIS_5_2a_2013_2014.json +++ /dev/null @@ -1 +0,0 @@ -{"inputs": {"location": {"latitude": 45.0, "longitude": 8.0, "elevation": 250.0}, "meteo_data": {"radiation_db": "PVGIS-CMSAF", "meteo_db": "ERA-Interim", "year_min": 2013, "year_max": 2014, "use_horizon": true, "horizon_db": null, "horizon_data": "DEM-calculated"}, "mounting_system": {"two_axis": {"slope": {"value": "-", "optimal": "-"}, "azimuth": {"value": "-", "optimal": "-"}}}, "pv_module": {"technology": "CIS", "peak_power": 10.0, "system_loss": 5.0}}, "outputs": {"hourly": [{"time": "20130101:0055", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 3.01, "WS10m": 1.23, "Int": 0.0}, {"time": "20130101:0155", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 2.22, "WS10m": 1.46, "Int": 0.0}, {"time": "20130101:0255", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 1.43, "WS10m": 1.7, "Int": 0.0}, {"time": "20130101:0355", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.64, "WS10m": 1.93, "Int": 0.0}, {"time": "20130101:0455", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.77, "WS10m": 1.8, "Int": 0.0}, {"time": "20130101:0555", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 0.91, "WS10m": 1.66, "Int": 0.0}, {"time": "20130101:0655", "P": 0.0, "Gb(i)": 0.0, "Gd(i)": 0.0, "Gr(i)": 0.0, "H_sun": 0.0, "T2m": 1.05, "WS10m": 1.53, "Int": 0.0}, {"time": "20130101:0755", "P": 3464.5, "Gb(i)": 270.35, "Gd(i)": 91.27, "Gr(i)": 6.09, "H_sun": 6.12, "T2m": 1.92, "WS10m": 1.44, "Int": 0.0}, {"time": "20130101:0855", "P": 1586.9, "Gb(i)": 80.76, "Gd(i)": 83.95, "Gr(i)": 9.04, "H_sun": 13.28, "T2m": 2.79, "WS10m": 1.36, "Int": 0.0}, {"time": "20130101:0955", "P": 713.3, "Gb(i)": 5.18, "Gd(i)": 70.57, "Gr(i)": 7.31, "H_sun": 18.56, "T2m": 3.66, "WS10m": 1.27, "Int": 0.0}]}, "meta": {"inputs": {"location": {"description": "Selected location", "variables": {"latitude": {"description": "Latitude", "units": "decimal degree"}, "longitude": {"description": "Longitude", "units": "decimal degree"}, "elevation": {"description": "Elevation", "units": "m"}}}, "meteo_data": {"description": "Sources of meteorological data", "variables": {"radiation_db": {"description": "Solar radiation database"}, "meteo_db": {"description": "Database used for meteorological variables other than solar radiation"}, "year_min": {"description": "First year of the calculations"}, "year_max": {"description": "Last year of the calculations"}, "use_horizon": {"description": "Include horizon shadows"}, "horizon_db": {"description": "Source of horizon data"}}}, "mounting_system": {"description": "Mounting system", "choices": "fixed, vertical_axis, inclined_axis, two_axis", "fields": {"slope": {"description": "Inclination angle from the horizontal plane", "units": "degree"}, "azimuth": {"description": "Orientation (azimuth) angle of the (fixed) PV system (0 = S, 90 = W, -90 = E)", "units": "degree"}}}, "pv_module": {"description": "PV module parameters", "variables": {"technology": {"description": "PV technology"}, "peak_power": {"description": "Nominal (peak) power of the PV module", "units": "kW"}, "system_loss": {"description": "Sum of system losses", "units": "%"}}}}, "outputs": {"hourly": {"type": "time series", "timestamp": "hourly averages", "variables": {"P": {"description": "PV system power", "units": "W"}, "Gb(i)": {"description": "Beam (direct) irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "Gd(i)": {"description": "Diffuse irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "Gr(i)": {"description": "Reflected irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "H_sun": {"description": "Sun height", "units": "degree"}, "T2m": {"description": "2-m air temperature", "units": "degree Celsius"}, "WS10m": {"description": "10-m total wind speed", "units": "m/s"}, "Int": {"description": "1 means solar radiation values are reconstructed"}}}}}} \ No newline at end of file diff --git a/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_SA2_10kWp_CIS_5_2a_2013_2014.json b/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_SA2_10kWp_CIS_5_2a_2013_2014.json new file mode 100644 index 0000000000..c6691217c1 --- /dev/null +++ b/pvlib/data/pvgis_hourly_Timeseries_45.000_8.000_SA2_10kWp_CIS_5_2a_2013_2014.json @@ -0,0 +1 @@ +{"inputs": {"location": {"latitude": 45.0, "longitude": 8.0, "elevation": 250.0}, "meteo_data": {"radiation_db": "PVGIS-SARAH2", "meteo_db": "ERA-Interim", "year_min": 2013, "year_max": 2014, "use_horizon": true, "horizon_db": null, "horizon_data": "DEM-calculated"}, "mounting_system": {"two_axis": {"slope": {"value": "-", "optimal": "-"}, "azimuth": {"value": "-", "optimal": "-"}}}, "pv_module": {"technology": "CIS", "peak_power": 10.0, "system_loss": 5.0}}, "outputs": {"hourly": [{"time": "20130101:0010", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -0.97, "WS10m": 1.52, "Int": 0.0}, {"time": "20130101:0110", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -1.06, "WS10m": 1.45, "Int": 0.0}, {"time": "20130101:0210", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -1.03, "WS10m": 1.45, "Int": 0.0}, {"time": "20130101:0310", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -0.48, "WS10m": 1.31, "Int": 0.0}, {"time": "20130101:0410", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -0.09, "WS10m": 1.24, "Int": 0.0}, {"time": "20130101:0510", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": -0.38, "WS10m": 1.17, "Int": 0.0}, {"time": "20130101:0610", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": 0.29, "WS10m": 1.03, "Int": 0.0}, {"time": "20130101:0710", "P": 0.0, "G(i)": 0.0, "H_sun": 0.0, "T2m": 1.0, "WS10m": 0.62, "Int": 0.0}, {"time": "20130101:0810", "P": 1187.2, "G(i)": 129.59, "H_sun": 8.06, "T2m": 0.97, "WS10m": 0.97, "Int": 0.0}, {"time": "20130101:0910", "P": 3950.1, "G(i)": 423.28, "H_sun": 14.8, "T2m": 1.89, "WS10m": 0.69, "Int": 0.0}]}, "meta": {"inputs": {"location": {"description": "Selected location", "variables": {"latitude": {"description": "Latitude", "units": "decimal degree"}, "longitude": {"description": "Longitude", "units": "decimal degree"}, "elevation": {"description": "Elevation", "units": "m"}}}, "meteo_data": {"description": "Sources of meteorological data", "variables": {"radiation_db": {"description": "Solar radiation database"}, "meteo_db": {"description": "Database used for meteorological variables other than solar radiation"}, "year_min": {"description": "First year of the calculations"}, "year_max": {"description": "Last year of the calculations"}, "use_horizon": {"description": "Include horizon shadows"}, "horizon_db": {"description": "Source of horizon data"}}}, "mounting_system": {"description": "Mounting system", "choices": "fixed, vertical_axis, inclined_axis, two_axis", "fields": {"slope": {"description": "Inclination angle from the horizontal plane", "units": "degree"}, "azimuth": {"description": "Orientation (azimuth) angle of the (fixed) PV system (0 = S, 90 = W, -90 = E)", "units": "degree"}}}, "pv_module": {"description": "PV module parameters", "variables": {"technology": {"description": "PV technology"}, "peak_power": {"description": "Nominal (peak) power of the PV module", "units": "kW"}, "system_loss": {"description": "Sum of system losses", "units": "%"}}}}, "outputs": {"hourly": {"type": "time series", "timestamp": "hourly averages", "variables": {"P": {"description": "PV system power", "units": "W"}, "G(i)": {"description": "Global irradiance on the inclined plane (plane of the array)", "units": "W/m2"}, "H_sun": {"description": "Sun height", "units": "degree"}, "T2m": {"description": "2-m air temperature", "units": "degree Celsius"}, "WS10m": {"description": "10-m total wind speed", "units": "m/s"}, "Int": {"description": "1 means solar radiation values are reconstructed"}}}}}} \ No newline at end of file diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index 64b23139eb..edfb28c124 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -26,7 +26,7 @@ URL = 'https://re.jrc.ec.europa.eu/api/' # Dictionary mapping PVGIS names to pvlib names -PVGIS_VARIABLE_MAP = { +VARIABLE_MAP = { 'G(h)': 'ghi', 'Gb(n)': 'dni', 'Gd(h)': 'dhi', @@ -112,10 +112,11 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None, documentation [2]_ for more info. url: str, default: :const:`pvlib.iotools.pvgis.URL` Base url of PVGIS API. ``seriescalc`` is appended to get hourly data - endpoint. + endpoint. Note, a specific PVGIS version can be specified, e.g., + https://re.jrc.ec.europa.eu/api/v5_2/ map_variables: bool, default: True When true, renames columns of the Dataframe to pvlib variable names - where applicable. See variable PVGIS_VARIABLE_MAP. + where applicable. See variable :const:`VARIABLE_MAP`. timeout: int, default: 30 Time in seconds to wait for server response before timeout @@ -138,10 +139,10 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None, Hint ---- PVGIS provides access to a number of different solar radiation datasets, - including satellite-based (SARAH, CMSAF, and NSRDB PSM3) and re-analysis - products (ERA5 and COSMO). Each data source has a different geographical - coverage and time stamp convention, e.g., SARAH and CMSAF provide - instantaneous values, whereas values from ERA5 are averages for the hour. + including satellite-based (SARAH, SARAH2, and NSRDB PSM3) and re-analysis + products (ERA5). Each data source has a different geographical coverage and + time stamp convention, e.g., SARAH and SARAH2 provide instantaneous values, + whereas values from ERA5 are averages for the hour. Notes ----- @@ -172,6 +173,12 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None, -------- pvlib.iotools.read_pvgis_hourly, pvlib.iotools.get_pvgis_tmy + Examples + -------- + >>> # Retrieve two years of irradiance data from PVGIS: + >>> data, meta, inputs = pvlib.iotools.get_pvgis_hourly( # doctest: +SKIP + >>> latitude=45, longitude=8, start=2015, end=2016) # doctest: +SKIP + References ---------- .. [1] `PVGIS `_ @@ -228,7 +235,7 @@ def _parse_pvgis_hourly_json(src, map_variables): data = data.drop('time', axis=1) data = data.astype(dtype={'Int': 'int'}) # The 'Int' column to be integer if map_variables: - data = data.rename(columns=PVGIS_VARIABLE_MAP) + data = data.rename(columns=VARIABLE_MAP) return data, inputs, metadata @@ -270,7 +277,7 @@ def _parse_pvgis_hourly_csv(src, map_variables): data.index = pd.to_datetime(data['time'], format='%Y%m%d:%H%M', utc=True) data = data.drop('time', axis=1) if map_variables: - data = data.rename(columns=PVGIS_VARIABLE_MAP) + data = data.rename(columns=VARIABLE_MAP) # All columns should have the dtype=float, except 'Int' which should be # integer. It is necessary to convert to float, before converting to int data = data.astype(float).astype(dtype={'Int': 'int'}) @@ -297,7 +304,7 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True): ``pvgis_format`` is required and must be in ``['csv', 'json']``. map_variables: bool, default True When true, renames columns of the DataFrame to pvlib variable names - where applicable. See variable PVGIS_VARIABLE_MAP. + where applicable. See variable :const:`VARIABLE_MAP`. Returns ------- @@ -369,8 +376,9 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, userhorizon=None, startyear=None, endyear=None, url=URL, map_variables=None, timeout=30): """ - Get TMY data from PVGIS. For more information see the PVGIS [1]_ TMY tool - documentation [2]_. + Get TMY data from PVGIS. + + For more information see the PVGIS [1]_ TMY tool documentation [2]_. Parameters ---------- @@ -396,7 +404,7 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, base url of PVGIS API, append ``tmy`` to get TMY endpoint map_variables: bool When true, renames columns of the Dataframe to pvlib variable names - where applicable. See variable PVGIS_VARIABLE_MAP. + where applicable. See variable const:`VARIABLE_MAP`. timeout : int, default 30 time in seconds to wait for server response before timeout @@ -428,13 +436,12 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, the error message in the response will be raised as an exception, otherwise raise whatever ``HTTP/1.1`` error occurred - See also + See Also -------- read_pvgis_tmy References ---------- - .. [1] `PVGIS `_ .. [2] `PVGIS TMY tool `_ .. [3] `PVGIS horizon profile tool @@ -492,7 +499,7 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, ) map_variables = False if map_variables: - data = data.rename(columns=PVGIS_VARIABLE_MAP) + data = data.rename(columns=VARIABLE_MAP) return data, months_selected, inputs, meta @@ -566,7 +573,7 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=None): be in ``['csv', 'epw', 'json', 'basic']``. map_variables: bool When true, renames columns of the Dataframe to pvlib variable names - where applicable. See variable PVGIS_VARIABLE_MAP. + where applicable. See variable :const:`VARIABLE_MAP`. Returns @@ -584,12 +591,12 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=None): ------ ValueError if ``pvgis_format`` is ``None`` and the file extension is neither - ``.csv``, ``.json``, nor ``.epw``, or if ``pvgis_format`` is provided as - input but isn't in ``['csv', 'epw', 'json', 'basic']`` + ``.csv``, ``.json``, nor ``.epw``, or if ``pvgis_format`` is provided + as input but isn't in ``['csv', 'epw', 'json', 'basic']`` TypeError if ``pvgis_format`` is ``None`` and ``filename`` is a buffer - See also + See Also -------- get_pvgis_tmy """ @@ -655,7 +662,6 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=None): ) map_variables = False if map_variables: - data = data.rename(columns=PVGIS_VARIABLE_MAP) + data = data.rename(columns=VARIABLE_MAP) return data, months_selected, inputs, meta - diff --git a/pvlib/tests/iotools/test_pvgis.py b/pvlib/tests/iotools/test_pvgis.py index a7b0cbbd0a..579c26914c 100644 --- a/pvlib/tests/iotools/test_pvgis.py +++ b/pvlib/tests/iotools/test_pvgis.py @@ -20,12 +20,12 @@ testfile_radiation_csv = DATA_DIR / \ 'pvgis_hourly_Timeseries_45.000_8.000_SA_30deg_0deg_2016_2016.csv' testfile_pv_json = DATA_DIR / \ - 'pvgis_hourly_Timeseries_45.000_8.000_CM_10kWp_CIS_5_2a_2013_2014.json' + 'pvgis_hourly_Timeseries_45.000_8.000_SA2_10kWp_CIS_5_2a_2013_2014.json' index_radiation_csv = \ pd.date_range('20160101 00:10', freq='1h', periods=14, tz='UTC') index_pv_json = \ - pd.date_range('2013-01-01 00:55', freq='1h', periods=10, tz='UTC') + pd.date_range('2013-01-01 00:10', freq='1h', periods=10, tz='UTC') columns_radiation_csv = [ 'Gb(i)', 'Gd(i)', 'Gr(i)', 'H_sun', 'T2m', 'WS10m', 'Int'] @@ -33,10 +33,9 @@ 'poa_direct', 'poa_sky_diffuse', 'poa_ground_diffuse', 'solar_elevation', 'temp_air', 'wind_speed', 'Int'] columns_pv_json = [ - 'P', 'Gb(i)', 'Gd(i)', 'Gr(i)', 'H_sun', 'T2m', 'WS10m', 'Int'] + 'P', 'G(i)', 'H_sun', 'T2m', 'WS10m', 'Int'] columns_pv_json_mapped = [ - 'P', 'poa_direct', 'poa_sky_diffuse', 'poa_ground_diffuse', - 'solar_elevation', 'temp_air', 'wind_speed', 'Int'] + 'P', 'poa_global', 'solar_elevation', 'temp_air', 'wind_speed', 'Int'] data_radiation_csv = [ [0.0, 0.0, 0.0, 0.0, 3.44, 1.43, 0.0], @@ -54,16 +53,16 @@ [4.25, 1.88, 0.05, 21.41, 7.84, 0.4, 1.0], [0.0, 0.0, 0.0, 0.0, 7.43, 0.72, 0.0]] data_pv_json = [ - [0.0, 0.0, 0.0, 0.0, 0.0, 3.01, 1.23, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 2.22, 1.46, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 1.43, 1.7, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.64, 1.93, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.77, 1.8, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.91, 1.66, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 1.05, 1.53, 0.0], - [3464.5, 270.35, 91.27, 6.09, 6.12, 1.92, 1.44, 0.0], - [1586.9, 80.76, 83.95, 9.04, 13.28, 2.79, 1.36, 0.0], - [713.3, 5.18, 70.57, 7.31, 18.56, 3.66, 1.27, 0.0]] + [0.0, 0.0, 0.0, -0.97, 1.52, 0.0], + [0.0, 0.0, 0.0, -1.06, 1.45, 0.0], + [0.0, 0.0, 0.0, -1.03, 1.45, 0.0], + [0.0, 0.0, 0.0, -0.48, 1.31, 0.0], + [0.0, 0.0, 0.0, -0.09, 1.24, 0.0], + [0.0, 0.0, 0.0, -0.38, 1.17, 0.0], + [0.0, 0.0, 0.0, 0.29, 1.03, 0.0], + [0.0, 0.0, 0.0, 1.0, 0.62, 0.0], + [1187.2, 129.59, 8.06, 0.97, 0.97, 0.0], + [3950.1, 423.28, 14.8, 1.89, 0.69, 0.0]] inputs_radiation_csv = {'latitude': 45.0, 'longitude': 8.0, 'elevation': 250.0, 'radiation_database': 'PVGIS-SARAH', @@ -80,7 +79,7 @@ inputs_pv_json = { 'location': {'latitude': 45.0, 'longitude': 8.0, 'elevation': 250.0}, - 'meteo_data': {'radiation_db': 'PVGIS-CMSAF', 'meteo_db': 'ERA-Interim', + 'meteo_data': {'radiation_db': 'PVGIS-SARAH2', 'meteo_db': 'ERA-Interim', 'year_min': 2013, 'year_max': 2014, 'use_horizon': True, 'horizon_db': None, 'horizon_data': 'DEM-calculated'}, 'mounting_system': {'two_axis': { @@ -88,45 +87,45 @@ 'azimuth': {'value': '-', 'optimal': '-'}}}, 'pv_module': {'technology': 'CIS', 'peak_power': 10.0, 'system_loss': 5.0}} + metadata_pv_json = { 'inputs': { - 'location': {'description': 'Selected location', 'variables': { - 'latitude': {'description': 'Latitude', 'units': 'decimal degree'}, - 'longitude': {'description': 'Longitude', 'units': 'decimal degree'}, # noqa: E501 - 'elevation': {'description': 'Elevation', 'units': 'm'}}}, - 'meteo_data': { - 'description': 'Sources of meteorological data', - 'variables': { - 'radiation_db': {'description': 'Solar radiation database'}, - 'meteo_db': {'description': 'Database used for meteorological variables other than solar radiation'}, # noqa: E501 - 'year_min': {'description': 'First year of the calculations'}, - 'year_max': {'description': 'Last year of the calculations'}, - 'use_horizon': {'description': 'Include horizon shadows'}, - 'horizon_db': {'description': 'Source of horizon data'}}}, - 'mounting_system': { - 'description': 'Mounting system', - 'choices': 'fixed, vertical_axis, inclined_axis, two_axis', - 'fields': { - 'slope': {'description': 'Inclination angle from the horizontal plane', 'units': 'degree'}, # noqa: E501 - 'azimuth': {'description': 'Orientation (azimuth) angle of the (fixed) PV system (0 = S, 90 = W, -90 = E)', 'units': 'degree'}}}, # noqa: E501 - 'pv_module': { - 'description': 'PV module parameters', - 'variables': { - 'technology': {'description': 'PV technology'}, - 'peak_power': {'description': 'Nominal (peak) power of the PV module', 'units': 'kW'}, # noqa: E501 - 'system_loss': {'description': 'Sum of system losses', 'units': '%'}}}}, # noqa: E501 - 'outputs': { - 'hourly': { - 'type': 'time series', 'timestamp': 'hourly averages', - 'variables': { - 'P': {'description': 'PV system power', 'units': 'W'}, - 'Gb(i)': {'description': 'Beam (direct) irradiance on the inclined plane (plane of the array)', 'units': 'W/m2'}, # noqa: E501 - 'Gd(i)': {'description': 'Diffuse irradiance on the inclined plane (plane of the array)', 'units': 'W/m2'}, # noqa: E501 - 'Gr(i)': {'description': 'Reflected irradiance on the inclined plane (plane of the array)', 'units': 'W/m2'}, # noqa: E501 - 'H_sun': {'description': 'Sun height', 'units': 'degree'}, - 'T2m': {'description': '2-m air temperature', 'units': 'degree Celsius'}, # noqa: E501 - 'WS10m': {'description': '10-m total wind speed', 'units': 'm/s'}, # noqa: E501 - 'Int': {'description': '1 means solar radiation values are reconstructed'}}}}} # noqa: E501 + 'location': + {'description': 'Selected location', 'variables': { + 'latitude': {'description': 'Latitude', 'units': 'decimal degree'}, # noqa: E501 + 'longitude': {'description': 'Longitude', 'units': 'decimal degree'}, # noqa: E501 + 'elevation': {'description': 'Elevation', 'units': 'm'}}}, + 'meteo_data': { + 'description': 'Sources of meteorological data', + 'variables': { + 'radiation_db': {'description': 'Solar radiation database'}, # noqa: E501 + 'meteo_db': {'description': 'Database used for meteorological variables other than solar radiation'}, # noqa: E501 + 'year_min': {'description': 'First year of the calculations'}, # noqa: E501 + 'year_max': {'description': 'Last year of the calculations'}, # noqa: E501 + 'use_horizon': {'description': 'Include horizon shadows'}, + 'horizon_db': {'description': 'Source of horizon data'}}}, + 'mounting_system': { + 'description': 'Mounting system', + 'choices': 'fixed, vertical_axis, inclined_axis, two_axis', + 'fields': { + 'slope': {'description': 'Inclination angle from the horizontal plane', 'units': 'degree'}, # noqa: E501 + 'azimuth': {'description': 'Orientation (azimuth) angle of the (fixed) PV system (0 = S, 90 = W, -90 = E)', 'units': 'degree'}}}, # noqa: E501 + 'pv_module': { + 'description': 'PV module parameters', + 'variables': { + 'technology': {'description': 'PV technology'}, + 'peak_power': {'description': 'Nominal (peak) power of the PV module', 'units': 'kW'}, # noqa: E501 + 'system_loss': {'description': 'Sum of system losses', 'units': '%'}}}}, # noqa: E501 + 'outputs': { + 'hourly': { + 'type': 'time series', 'timestamp': 'hourly averages', + 'variables': { + 'P': {'description': 'PV system power', 'units': 'W'}, + 'G(i)': {'description': 'Global irradiance on the inclined plane (plane of the array)', 'units': 'W/m2'}, # noqa: E501 + 'H_sun': {'description': 'Sun height', 'units': 'degree'}, + 'T2m': {'description': '2-m air temperature', 'units': 'degree Celsius'}, # noqa: E501 + 'WS10m': {'description': '10-m total wind speed', 'units': 'm/s'}, # noqa: E501 + 'Int': {'description': '1 means solar radiation values are reconstructed'}}}}} # noqa: E501 def generate_expected_dataframe(values, columns, index): @@ -215,12 +214,13 @@ def test_read_pvgis_hourly_bad_extension(): args_pv_json = { 'surface_tilt': 30, 'surface_azimuth': 0, 'outputformat': 'json', - 'usehorizon': True, 'userhorizon': None, 'raddatabase': 'PVGIS-CMSAF', + 'usehorizon': True, 'userhorizon': None, 'raddatabase': 'PVGIS-SARAH2', 'start': pd.Timestamp(2013, 1, 1), 'end': pd.Timestamp(2014, 5, 1), 'pvcalculation': True, 'peakpower': 10, 'pvtechchoice': 'CIS', 'loss': 5, - 'trackingtype': 2, 'optimalangles': True, 'components': True} + 'trackingtype': 2, 'optimalangles': True, 'components': False, + 'url': 'https://re.jrc.ec.europa.eu/api/v5_2/'} -url_pv_json = 'https://re.jrc.ec.europa.eu/api/seriescalc?lat=45&lon=8&outputformat=json&angle=30&aspect=0&pvtechchoice=CIS&mountingplace=free&trackingtype=2&components=1&usehorizon=1&raddatabase=PVGIS-CMSAF&startyear=2013&endyear=2014&pvcalculation=1&peakpower=10&loss=5&optimalangles=1' # noqa: E501 +url_pv_json = 'https://re.jrc.ec.europa.eu/api/v5_2/seriescalc?lat=45&lon=8&outputformat=json&angle=30&aspect=0&pvtechchoice=CIS&mountingplace=free&trackingtype=2&components=0&usehorizon=1&raddatabase=PVGIS-SARAH2&startyear=2013&endyear=2014&pvcalculation=1&peakpower=10&loss=5&optimalangles=1' # noqa: E501 @pytest.mark.parametrize('testfile,expected_name,args,map_variables,url_test', [ # noqa: E501