15
15
'GHI no corr' , 'BHI no corr' , 'DHI no corr' , 'BNI no corr' ]
16
16
17
17
# Dictionary mapping CAMS Radiation and McClear variables to pvlib names
18
- CAMS_VARIABLE_MAP = {
18
+ VARIABLE_MAP = {
19
19
'TOA' : 'ghi_extra' ,
20
20
'Clear sky GHI' : 'ghi_clear' ,
21
21
'Clear sky BHI' : 'bhi_clear' ,
@@ -47,12 +47,11 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
47
47
server = 'www.soda-is.com' , timeout = 30 ):
48
48
"""
49
49
Retrieve time-series of radiation and/or clear-sky global, beam, and
50
- diffuse radiation from CAMS. Data from CAMS Radiation [1]_ and CAMS McClear
51
- [2]_ are retrieved from SoDa [3]_.
50
+ diffuse radiation from CAMS (see [1]_). Data is retrieved from SoDa [2]_.
52
51
53
52
Time coverage: 2004-01-01 to two days ago
54
53
55
- Access: free, but requires registration, see [1 ]_
54
+ Access: free, but requires registration, see [2 ]_
56
55
57
56
Requests: max. 100 per day
58
57
Geographical coverage: worldwide for CAMS McClear and approximately -66° to
@@ -91,7 +90,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
91
90
all time steps except for '1M' which has a default of 'right'.
92
91
map_variables: bool, default: True
93
92
When true, renames columns of the DataFrame to pvlib variable names
94
- where applicable. See variable CAMS_VARIABLE_MAP .
93
+ where applicable. See variable :const:`VARIABLE_MAP` .
95
94
server: str, default: 'www.soda-is.com'
96
95
Main server (www.soda-is.com) or backup mirror server (pro.soda-is.com)
97
96
timeout : int, default: 30
@@ -107,7 +106,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
107
106
Notes
108
107
-----
109
108
In order to use the CAMS services, users must register for a free SoDa
110
- account using an email address [1 ]_.
109
+ account using an email address [2 ]_.
111
110
112
111
The returned data DataFrame includes the following fields:
113
112
@@ -130,15 +129,14 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
130
129
======================== ====== =========================================
131
130
132
131
†Parameters only returned if identifier='cams_radiation'. For description
133
- of additional output parameters in verbose mode, see [1]_ and [2]_ .
132
+ of additional output parameters in verbose mode, see [1]_.
134
133
135
134
Note that it is recommended to specify the latitude and longitude to at
136
135
least the fourth decimal place.
137
136
138
137
Variables corresponding to standard pvlib variables are renamed,
139
- e.g. `sza` becomes `solar_zenith`. See the
140
- `pvlib.iotools.cams.CAMS_VARIABLE_MAP` dict for the complete
141
- mapping.
138
+ e.g. `sza` becomes `solar_zenith`. See variable :const:`VARIABLE_MAP` for
139
+ the complete mapping.
142
140
143
141
See Also
144
142
--------
@@ -152,12 +150,10 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
152
150
153
151
References
154
152
----------
155
- .. [1] `CAMS Radiation Service Info
156
- <https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
157
- .. [2] `CAMS McClear Service Info
158
- <https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
159
- .. [3] `CAMS McClear Automatic Access
160
- <https://www.soda-pro.com/help/cams-services/cams-mcclear-service/automatic-access>`_
153
+ .. [1] `CAMS solar radiation documentation
154
+ <https://atmosphere.copernicus.eu/solar-radiation>`_
155
+ .. [2] `CAMS Radiation Automatic Access (SoDa)
156
+ <https://www.soda-pro.com/help/cams-services/cams-radiation-service/automatic-access>`_
161
157
"""
162
158
try :
163
159
time_step_str = TIME_STEPS_MAP [time_step ]
@@ -233,7 +229,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
233
229
def parse_cams (fbuf , integrated = False , label = None , map_variables = True ):
234
230
"""
235
231
Parse a file-like buffer with data in the format of a CAMS Radiation or
236
- McClear file. The CAMS services are described in [1]_ and [2 ]_.
232
+ McClear file. The CAMS solar radiation services are described in [1]_.
237
233
238
234
Parameters
239
235
----------
@@ -247,7 +243,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
247
243
all time steps except for '1M' which has a default of 'right'.
248
244
map_variables: bool, default: True
249
245
When true, renames columns of the Dataframe to pvlib variable names
250
- where applicable. See variable CAMS_VARIABLE_MAP .
246
+ where applicable. See variable :const:`VARIABLE_MAP` .
251
247
252
248
Returns
253
249
-------
@@ -262,10 +258,8 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
262
258
263
259
References
264
260
----------
265
- .. [1] `CAMS Radiation Service Info
266
- <https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
267
- .. [2] `CAMS McClear Service Info
268
- <https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
261
+ .. [1] `CAMS solar radiation documentation
262
+ <https://atmosphere.copernicus.eu/solar-radiation>`_
269
263
"""
270
264
metadata = {}
271
265
# Initial lines starting with # contain metadata
@@ -327,15 +321,16 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
327
321
TIME_STEPS_IN_HOURS [time_step ])
328
322
data .index .name = None # Set index name to None
329
323
if map_variables :
330
- data = data .rename (columns = CAMS_VARIABLE_MAP )
324
+ data = data .rename (columns = VARIABLE_MAP )
331
325
332
326
return data , metadata
333
327
334
328
335
329
def read_cams (filename , integrated = False , label = None , map_variables = True ):
336
330
"""
337
- Read a CAMS Radiation or McClear file into a pandas DataFrame. CAMS
338
- radiation and McClear are described in [1]_ and [2]_, respectively.
331
+ Read a CAMS Radiation or McClear file into a pandas DataFrame.
332
+
333
+ CAMS Radiation and McClear are described in [1]_.
339
334
340
335
Parameters
341
336
----------
@@ -349,7 +344,7 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
349
344
all time steps except for '1M' which has a default of 'right'.
350
345
map_variables: bool, default: True
351
346
When true, renames columns of the Dataframe to pvlib variable names
352
- where applicable. See variable CAMS_VARIABLE_MAP .
347
+ where applicable. See variable VARIABLE_MAP .
353
348
354
349
Returns
355
350
-------
@@ -365,10 +360,8 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
365
360
366
361
References
367
362
----------
368
- .. [1] `CAMS Radiation Service Info
369
- <https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
370
- .. [2] `CAMS McClear Service Info
371
- <https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
363
+ .. [1] `CAMS solar radiation documentation
364
+ <https://atmosphere.copernicus.eu/solar-radiation>`_
372
365
"""
373
366
with open (str (filename ), 'r' ) as fbuf :
374
367
content = parse_cams (fbuf , integrated , label , map_variables )
0 commit comments