diff --git a/docs/sphinx/source/whatsnew/v0.9.2.rst b/docs/sphinx/source/whatsnew/v0.9.2.rst index 30c84cd005..89b52f1fad 100644 --- a/docs/sphinx/source/whatsnew/v0.9.2.rst +++ b/docs/sphinx/source/whatsnew/v0.9.2.rst @@ -42,12 +42,12 @@ Testing * Speed up CI setup using micromamba instead of conda (:pull:`1493`) * Drop python 3.6 (reached end of life Dec 2021) and add 3.10 to test matrix (:pull:`1507`) - 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 ~~~~~~~~~~~~~ diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index a5d3e1efd1..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', @@ -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 @@ -91,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 @@ -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,15 +129,14 @@ 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. 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 -------- @@ -152,12 +150,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 +229,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 ---------- @@ -247,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 ------- @@ -262,10 +258,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 @@ -327,15 +321,16 @@ 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 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 ---------- @@ -349,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 ------- @@ -365,10 +360,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)