Skip to content

Commit 9dc331f

Browse files
committed
materials for dc workshop
1 parent a7c7d93 commit 9dc331f

9 files changed

+13279
-0
lines changed

boulder_clear_aug_sept.csv

Lines changed: 1465 additions & 0 deletions
Large diffs are not rendered by default.

boulder_cloudy_aug_sept.csv

Lines changed: 1465 additions & 0 deletions
Large diffs are not rendered by default.

boulder_fx_demo_aug_sept.csv

Lines changed: 1465 additions & 0 deletions
Large diffs are not rendered by default.

boulder_fx_holmgren_aug_sept.csv

Lines changed: 1465 additions & 0 deletions
Large diffs are not rendered by default.

dc.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# DC data sharing
2+
3+
## Creating Sites, Observations, Forecasts
4+
5+
* Create a Site (weather station)
6+
* Boulder: 40 N, -105 E, 1650 m
7+
* Create a Site (power plant)
8+
* Boulder Power Plant: 10 MW AC, 14 MW DC, tracking, .4 gcr
9+
* Create an Observation.
10+
* AC power, hourly average, beginning
11+
* View sample data, upload boulder_cloudy_aug_sept.csv
12+
* Note: procedure must be repeated for each variable. Tedious, but avoids need to agree upon and parse column names
13+
* Create a Forecast
14+
* AC power, hourly average, beginning
15+
* upload boulder_fx_demo_aug_sept.csv
16+
17+
## Data sharing
18+
19+
For this exercise you need two accounts. Here we use demo and holmgren.
20+
For now we must use uuids to share data, but email support will come soon.
21+
22+
* demo: 4f738239-e632-11e9-ab45-52540015d5ce
23+
* holmgren: 26653f79-e62d-11e9-ab45-52540015d5ce
24+
25+
* Goal: demo@solarforecastarbiter.org wants to share its AC power data with a forecast provider (holmgren@email.arizona.edu), receive a forecast from the forecast provider, and generate a report comparing to its own forecast (created previously).
26+
* Show roles page
27+
* In a second incognito window, log in as holmgren@email.arizona.edu, show available sites -- cannot see demo’s
28+
* From demo window, create role for sharing sites, obs metadata, values
29+
* Use “all *” permissions for simplicity, but note this can be made much more fine grained
30+
* Assign role to forecast provider account
31+
* From holmgren window, create forecast, upload forecast
32+
* AC power, hourly average, beginning
33+
* upload boulder_fx_holmgren_aug_sept.csv
34+
* Note that demo could have created a forecast metadata object
35+
* Share new holmgren forecast metadata and data with the demo account
36+
* From demo account, see that there is now a new forecast
37+
* From demo create report comparing demo forecast and holmgren forecast to demo obs
38+
39+
## Data sharing on MIDC Arizona OASIS
40+
41+
* From holmgren window, create OASIS forecast, upload forecast
42+
* issue time of day 7Z, run length 1 day, lead time 1 day
43+
* Premade uploaded forecast is a bias corrected version of GFS forecast
44+
* Note that demo could have created a forecast metadata object
45+
* If not already done, share new holmgren forecast metadata and data with the demo account
46+
* From demo account, see that there is now a new forecast
47+
* Create report comparing reference forecast and holmgren forecast to reference obs

generate_ac_obs.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import numpy as np
2+
import pandas as pd
3+
4+
from solarforecastarbiter import datamodel
5+
from solarforecastarbiter import pvmodel
6+
7+
from pvlib.location import Location
8+
9+
10+
# define metadata
11+
modeling_params = datamodel.SingleAxisModelingParameters(
12+
ac_capacity=10, dc_capacity=14, temperature_coefficient=-0.004,
13+
dc_loss_factor=0, ac_loss_factor=0,
14+
axis_tilt=0, axis_azimuth=0, ground_coverage_ratio=.4,
15+
backtrack=True, max_rotation_angle=45)
16+
17+
metadata = datamodel.SolarPowerPlant(
18+
name='Boulder Power Plant', latitude=40., longitude=-105.,
19+
elevation=1650., timezone='America/Denver', provider='Sandia',
20+
modeling_parameters=modeling_params)
21+
22+
times = pd.date_range(
23+
start='20190801', end='20191001', freq='5min', closed='left')
24+
25+
solpos = pvmodel.calculate_solar_position(
26+
metadata.latitude, metadata.longitude, metadata.elevation, times)
27+
cs = pvmodel.calculate_clearsky(
28+
metadata.latitude, metadata.longitude, metadata.elevation,
29+
solpos['apparent_zenith'])
30+
ac_clear = pvmodel.irradiance_to_power(
31+
modeling_params, solpos['apparent_zenith'], solpos['azimuth'],
32+
cs['ghi'], cs['dni'], cs['dhi'])
33+
34+
ac_clear_1h = ac_clear.resample('1h').mean()
35+
ac_clear_1h = pd.DataFrame({'value': ac_clear_1h, 'quality_flag': 0})
36+
ac_clear_1h.to_csv('boulder_clear_aug_sept.csv', index_label='timestamp')
37+
38+
# make it cloudy, but apply clipping
39+
random = np.random.random(size=len(times)) + 0.5
40+
random = random.clip(max=1)
41+
ac = ac_clear * random
42+
43+
ac_1h = ac.resample('1h').mean()
44+
ac_1h = pd.DataFrame({'value': ac_1h, 'quality_flag': 0})
45+
ac_1h.to_csv('boulder_cloudy_aug_sept.csv', index_label='timestamp')
46+
47+
fx_demo = ac_1h['value'].shift(1)
48+
fx_demo.to_csv('boulder_fx_demo_aug_sept.csv',
49+
header=['value'], index_label='timestamp')
50+
51+
csi = ac / ac_clear
52+
csi = csi.fillna(0) # account for divide by 0
53+
ac_csi = csi.shift(12) * ac_clear
54+
holmgren_demo = ac_csi.resample('1h').mean()
55+
holmgren_demo.to_csv('boulder_fx_holmgren_aug_sept.csv',
56+
header=['value'], index_label='timestamp')

0 commit comments

Comments
 (0)