Skip to content

add NREL MIDC reader to iotools #601

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

Closed
wholmgren opened this issue Oct 10, 2018 · 3 comments
Closed

add NREL MIDC reader to iotools #601

wholmgren opened this issue Oct 10, 2018 · 3 comments
Labels
enhancement io solarfx2 DOE SETO Solar Forecasting 2 / Solar Forecast Arbiter
Milestone

Comments

@wholmgren
Copy link
Member

It might be useful to add a pvlib.iotools parser for the NREL MIDC sites, particularly for the 1 minute data from sites that are currently active.

I've copied/pasted code similar to this more times than I'd care to admit:

url = 'http://midcdmz.nrel.gov/apps/plot.pl?site=UAT&start=20101103&edy=2&emo=4&eyr=2018&year=2016&month=1&day=1&endyear=2017&endmonth=12&endday=31&time=23:59&inst=4&inst=5&inst=6&inst=7&inst=9&type=data&first=3&math=0&second=-1&value=0.0&user=0&axis=1'
weather = pd.read_csv(url)
datetime = weather['DATE (MM/DD/YYYY)'] + weather['MST']
datetime = pd.to_datetime(datetime, format='%m/%d/%Y%H:%M')
weather = weather.set_index(datetime)
weather = weather.tz_localize('America/Phoenix')
weather = weather.rename(columns={'Global Horiz (platform) [W/m^2]': 'ghi', 
                                  'Direct Normal [W/m^2]': 'dni', 
                                  'Diffuse Horiz [W/m^2]': 'dhi',
                                  'Air Temperature [deg C]': 'temp_air',
                                  'Avg Wind Speed @ 3m [m/s]': 'wind_speed'})
weather = weather.drop(columns=['DATE (MM/DD/YYYY)', 'MST'])

Like the UO SRML network, the NREL network has different instruments at different sites, and sometimes the instruments change.

NREL has a fairly straightforward API for daily data. I don't know if it's useful to try to wrap that in addition to the 1 minute data. It could help determine instrument changes.

There's also a nice site API here: https://midcdmz.nrel.gov/apps/data_api_doc.pl?_idtextlist_

Describe alternatives you've considered
Let users implement their own MIDC parsers as needed.

Additional context
Could be useful for Solar Forecasting 2. cc @cwhanse @lboeman @alorenzo175

@wholmgren wholmgren added enhancement solarfx2 DOE SETO Solar Forecasting 2 / Solar Forecast Arbiter io labels Oct 10, 2018
@lboeman lboeman mentioned this issue Oct 16, 2018
8 tasks
@cwhanse
Copy link
Member

cwhanse commented Oct 17, 2018

Perhaps #605 isn't the PR to do this, but, do we provide the pvlib variable names someplace? We ask users to create a dict mapping MIDC to pvlib names, it would help to point users to the list of available pvlib names.

@lboeman
Copy link
Contributor

lboeman commented Oct 17, 2018

I believe they are provided in pvlib/data/variable_style_rules.csv. and rendered in the documentation at https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html.
Although I found it by accident myself, so it's probably a good idea to point users in the right direction.

@wholmgren wholmgren added this to the 0.6.1 milestone Oct 20, 2018
@wholmgren
Copy link
Member Author

closed by #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement io solarfx2 DOE SETO Solar Forecasting 2 / Solar Forecast Arbiter
Projects
None yet
Development

No branches or pull requests

3 participants