8000 Add sodapro.get_cams_radiation by AdamRJensen · Pull Request #1175 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add sodapro.get_cams_radiation #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Jun 13, 2021
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d7deb80
Add cams.get_cams_radiation function
Feb 22, 2021
510f08e
Revert "Add cams.get_cams_radiation function"
Feb 22, 2021
84e820c
Add cams.get_cams_mcclear
Feb 22, 2021
0a92f72
Update v0.9.0.rst
Feb 22, 2021
e8d1098
Reference correct pull request in whatsnew
Feb 23, 2021
2092f8b
Add test file for monthly data
Feb 23, 2021
ff9cece
Create sub-functions parse and read
Feb 23, 2021
0c28299
Fixed stickler
Feb 23, 2021
75e575f
Update constants names
Feb 25, 2021
1f2ec30
Fixed monthly integration of values
Feb 25, 2021
641fc97
Improvement to meta-data parsing
Feb 25, 2021
527fa1c
Update test file to be during the day
Feb 26, 2021
673bf3b
Convert to get_cams to add support for CAMS Radiation
Feb 26, 2021
c6764d3
Fixed stickler issues
Feb 26, 2021
225b0e1
Update function names to just 'cams'
Feb 26, 2021
924c58a
Update return description
Feb 27, 2021
cbc116d
Rename to cams_radiation
Feb 27, 2021
294c14a
Convert print statements to warnings
Feb 27, 2021
d28143a
Update function names
Feb 27, 2021
f263184
Fixed stickler
Feb 27, 2021
9b26d91
Fixed stickler
Feb 27, 2021
e3cb60d
Improvements to documentation
Feb 27, 2021
af66bbe
Raise warning for unrecognized time step
AdamRJensen Feb 27, 2021
2949cb1
Reworked URL formatting & comments on HTTP status
Mar 6, 2021
19fcdb8
Fixed stickler
Mar 6, 2021
328c86e
Add tests for cams.read_cams_radiation
Mar 7, 2021
1df6830
Add tests coverage for metadata
AdamRJensen Mar 7, 2021
f518246
Update docs/sphinx/source/whatsnew/v0.9.0.rst
AdamRJensen Mar 7, 2021
96e3719
Add reference to parsing function in whatsnew
AdamRJensen Mar 7, 2021
5f952c0
Update module and function names
AdamRJensen May 31, 2021
b4a686d
Update iotools init file with new names
AdamRJensen May 31, 2021
1ccbe70
update test file name
AdamRJensen May 31, 2021
5c9ef69
Add ".." to conftest import and update function documentation
AdamRJensen Jun 4, 2021
bb34a25
Change asterisk to † in documentation
AdamRJensen Jun 4, 2021
7c7ec0b
Merge branch 'master' into cams_mcclear
AdamRJensen Jun 4, 2021
71c3a64
Update from master
AdamRJensen Jun 4, 2021
9f6195e
Merge remote-tracking branch 'upstream/master' into cams_mcclear
AdamRJensen Jun 4, 2021
e335730
Add mock tests
AdamRJensen Jun 4, 2021
5a018ca
Stickler fixes and add import of requests_mock
AdamRJensen Jun 4, 2021
d0a2571
Remove import request_mock in test_sodapro.py
AdamRJensen Jun 4, 2021
e642399
Added requests-mock to setup.py and CI requirements files
AdamRJensen Jun 4, 2021
9e69d3e
Add requests-mock to ci\azure\posix.yml
AdamRJensen Jun 4, 2021
e085373
Move requests-mock to pip install section
AdamRJensen Jun 4, 2021
51b6ab9
Move requests-mock to pip install section for py36 and py36-min
AdamRJensen Jun 5, 2021
9814cae
Add additional tests for full coverage
AdamRJensen Jun 5, 2021
1d28d1a
Update stickler
AdamRJensen Jun 5, 2021
1d115db
Add timeout option to get_cams
AdamRJensen Jun 7, 2021
8e53165
Add timeout option to get_cams
AdamRJensen Jun 7, 2021
3714e62
Extent tests to cover label, integrated, map_variables arguments
AdamRJensen Jun 7, 2021
cc5347d
Fix stickler
AdamRJensen Jun 7, 2021
9fc945f
Updates to documentation
AdamRJensen Jun 7, 2021
8d85f0b
Update to documentation
AdamRJensen Jun 7, 2021
857bd91
Reformat data inputs, set index name to None
AdamRJensen Jun 7, 2021
15e097c
Remove rounding when converting from integrated values
AdamRJensen Jun 7, 2021
e80cbde
Minor updates to mock tests
AdamRJensen Jun 7, 2021
6aadd5c
Remove round(4)
AdamRJensen Jun 7, 2021
f194905
Change meta variable name to metadata
AdamRJensen Jun 11, 2021
128c3f9
Change start_date/end_date to start/end
AdamRJensen Jun 11, 2021
1e6d262
Make stickler happy
AdamRJensen Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed stickler issues
  • Loading branch information
AdamRJensen committed Feb 26, 2021
commit c6764d3e909e1d1ad3e09c8b2cf6c38e7385a685
11 changes: 6 additions & 5 deletions pvlib/iotools/cams.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
TIME_STEPS_IN_HOURS = {'1min': 1/60, '15min': 15/60, '1h': 1, '1d': 24}

SUMMATION_PERIOD_TO_TIME_STEP = {'0 year 0 month 0 day 0 h 1 min 0 s': '1min',
'0 year 0 month 0 day 0 h 15 min 0 s': '15min',
'0 year 0 month 0 day 0 h 15 min 0 s': '15min', # noqa
'0 year 0 month 0 day 1 h 0 min 0 s': '1h',
'0 year 0 month 1 day 0 h 0 min 0 s': '1d',
'0 year 1 month 0 day 0 h 0 min 0 s': '1M'}
Expand All @@ -50,7 +50,8 @@ def get_cams(start_date, end_date, latitude, longitude, email,
diffuse radiation CAMS [2]_ using the WGET service [3]_.


Geographical coverage: -66 to 66 latitude/longitude (radiation) and wordwide (McClear)
Geographical coverage: Wordwide for CAMS McClear and -66 to 66 for both
latitude and longitude for CAMS Radiation
Time coverage: 2004-01-01 to two days ago
Access: free, but requires registration, see [1]_
Requests: max. 100 per day
Expand Down Expand Up @@ -127,7 +128,7 @@ def get_cams(start_date, end_date, latitude, longitude, email,

The returned units for the radiation parameters depends on the integrated
argument, i.e. integrated=False returns units of W/m2, whereas
integrated=True returns units of Wh/m2.
integrated=True returns units of Wh/m2.

Note that it is recommended to specify the latitude and longitude to at
least the fourth decimal place.
Expand Down Expand Up @@ -252,7 +253,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
meta['Longitude (positive East, ISO 19115)'] = \
float(meta['Longitude (positive East, ISO 19115)'])
meta['Altitude (m)'] = float(meta['Altitude (m)'])
meta['Unit for radiation'] = {True:'Wh/m2', False:'W/m2'}[integrated]
meta['Unit for radiation'] = {True: 'Wh/m2', False: 'W/m2'}[integrated]

# Determine the time_step from the meta-data dictionary
time_step = SUMMATION_PERIOD_TO_TIME_STEP[
Expand Down Expand Up @@ -282,7 +283,7 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
data.index = data.index - pd.Timedelta(days=1)

if not integrated: # Convert radiation values from Wh/m2 to W/m2
integrated_cols = [c for c in CAMS_INTEGRATED_COLUMNS if c in data.columns]
integrated_cols = [c for c in CAMS_INTEGRATED_COLUMNS if c in data.columns] # noqa

if time_step == '1M':
time_delta = (pd.to_datetime(obs_period.str[1])
Expand Down
0