From 701d2fa214187bb0ea2a54496970372ba131d4a1 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Tue, 16 Aug 2022 10:41:59 +0200 Subject: [PATCH 1/3] Update cams links --- pvlib/iotools/sodapro.py | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index a5d3e1efd1..08f4af4905 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -47,12 +47,11 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', server='www.soda-is.com', timeout=30): """ Retrieve time-series of radiation and/or clear-sky global, beam, and - diffuse radiation from CAMS. Data from CAMS Radiation [1]_ and CAMS McClear - [2]_ are retrieved from SoDa [3]_. + diffuse radiation from CAMS (see [1]_). Data is retrieved from SoDa [2]_. Time coverage: 2004-01-01 to two days ago - Access: free, but requires registration, see [1]_ + Access: free, but requires registration, see [2]_ Requests: max. 100 per day Geographical coverage: worldwide for CAMS McClear and approximately -66° to @@ -107,7 +106,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', Notes ----- In order to use the CAMS services, users must register for a free SoDa - account using an email address [1]_. + account using an email address [2]_. The returned data DataFrame includes the following fields: @@ -130,7 +129,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', ======================== ====== ========================================= †Parameters only returned if identifier='cams_radiation'. For description - of additional output parameters in verbose mode, see [1]_ and [2]_. + of additional output parameters in verbose mode, see [1]_. Note that it is recommended to specify the latitude and longitude to at least the fourth decimal place. @@ -152,12 +151,10 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', References ---------- - .. [1] `CAMS Radiation Service Info - `_ - .. [2] `CAMS McClear Service Info - `_ - .. [3] `CAMS McClear Automatic Access - `_ + .. [1] `CAMS solar radiation documentation + `_ + .. [2] `CAMS Radiation Automatic Access (SoDa) + `_ """ try: time_step_str = TIME_STEPS_MAP[time_step] @@ -233,7 +230,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', def parse_cams(fbuf, integrated=False, label=None, map_variables=True): """ Parse a file-like buffer with data in the format of a CAMS Radiation or - McClear file. The CAMS services are described in [1]_ and [2]_. + McClear file. The CAMS solar radiation services are described in [1]_. Parameters ---------- @@ -262,10 +259,8 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True): References ---------- - .. [1] `CAMS Radiation Service Info - `_ - .. [2] `CAMS McClear Service Info - `_ + .. [1] `CAMS solar radiation documentation + `_ """ metadata = {} # Initial lines starting with # contain metadata @@ -334,8 +329,9 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True): def read_cams(filename, integrated=False, label=None, map_variables=True): """ - Read a CAMS Radiation or McClear file into a pandas DataFrame. CAMS - radiation and McClear are described in [1]_ and [2]_, respectively. + Read a CAMS Radiation or McClear file into a pandas DataFrame. + + CAMS Radiation and McClear are described in [1]_. Parameters ---------- @@ -365,10 +361,8 @@ def read_cams(filename, integrated=False, label=None, map_variables=True): References ---------- - .. [1] `CAMS Radiation Service Info - `_ - .. [2] `CAMS McClear Service Info - `_ + .. [1] `CAMS solar radiation documentation + `_ """ with open(str(filename), 'r') as fbuf: content = parse_cams(fbuf, integrated, label, map_variables) From d896aee9ee8c57d189219cfaf751330beb19f80f Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Tue, 16 Aug 2022 10:53:10 +0200 Subject: [PATCH 2/3] Update whatsnew --- docs/sphinx/source/whatsnew/v0.9.2.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.9.2.rst b/docs/sphinx/source/whatsnew/v0.9.2.rst index e5b10ffdd5..7648f4fcba 100644 --- a/docs/sphinx/source/whatsnew/v0.9.2.rst +++ b/docs/sphinx/source/whatsnew/v0.9.2.rst @@ -28,19 +28,17 @@ Bug fixes rise/set/transit times for the wrong day in recent versions of ``ephem`` (:issue:`1449`, :pull:`1448`) - Testing ~~~~~~~ * Switched CI testing provider from Azure to GitHub Actions (:pull:`1306`) * Speed up CI setup using micromamba instead of conda (:pull:`1493`) - Documentation ~~~~~~~~~~~~~ * Added a reference to :py:func:`pvlib.inverter.sandia_multi`. (:pull:`1479`) * Add gallery example of simulating rearside irradiance for a fixed-tilt array with pvfactors (:pull:`1470`) - +* Updated reference links to CAMS Radiation (:issue:`1515`, :pull:`1529`) Benchmarking ~~~~~~~~~~~~~ From 1155fe72d4b0f949841d1cf27fcef6d937fe46e0 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:33:26 +0200 Subject: [PATCH 3/3] Rename CAMS_VARIABLE_MAP to VARIABLE_MAP --- pvlib/iotools/sodapro.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index 08f4af4905..c57052b254 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -15,7 +15,7 @@ 'GHI no corr', 'BHI no corr', 'DHI no corr', 'BNI no corr'] # Dictionary mapping CAMS Radiation and McClear variables to pvlib names -CAMS_VARIABLE_MAP = { +VARIABLE_MAP = { 'TOA': 'ghi_extra', 'Clear sky GHI': 'ghi_clear', 'Clear sky BHI': 'bhi_clear', @@ -90,7 +90,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', all time steps except for '1M' which has a default of 'right'. map_variables: bool, default: True When true, renames columns of the DataFrame to pvlib variable names - where applicable. See variable CAMS_VARIABLE_MAP. + where applicable. See variable :const:`VARIABLE_MAP`. server: str, default: 'www.soda-is.com' Main server (www.soda-is.com) or backup mirror server (pro.soda-is.com) timeout : int, default: 30 @@ -135,9 +135,8 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear', least the fourth decimal place. Variables corresponding to standard pvlib variables are renamed, - e.g. `sza` becomes `solar_zenith`. See the - `pvlib.iotools.cams.CAMS_VARIABLE_MAP` dict for the complete - mapping. + e.g. `sza` becomes `solar_zenith`. See variable :const:`VARIABLE_MAP` for + the complete mapping. See Also -------- @@ -244,7 +243,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True): all time steps except for '1M' which has a default of 'right'. map_variables: bool, default: True When true, renames columns of the Dataframe to pvlib variable names - where applicable. See variable CAMS_VARIABLE_MAP. + where applicable. See variable :const:`VARIABLE_MAP`. Returns ------- @@ -322,7 +321,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True): TIME_STEPS_IN_HOURS[time_step]) data.index.name = None # Set index name to None if map_variables: - data = data.rename(columns=CAMS_VARIABLE_MAP) + data = data.rename(columns=VARIABLE_MAP) return data, metadata @@ -345,7 +344,7 @@ def read_cams(filename, integrated=False, label=None, map_variables=True): all time steps except for '1M' which has a default of 'right'. map_variables: bool, default: True When true, renames columns of the Dataframe to pvlib variable names - where applicable. See variable CAMS_VARIABLE_MAP. + where applicable. See variable VARIABLE_MAP. Returns -------