Skip to content

Commit cd9afe4

Browse files
cdelinekandersolar
andauthored
Model chains set clearsky (#233)
* Move CS inputs to new set_clearsky function: pvlib_location ,pv_tilt, pv_azimuth, clearsky_poa, clearsky temp, albedo * Explicit error message if set_clearsky not run prior to clearsky_analysis. * remove Py2.7 check in block 3 of RdAnalysis_example.ipynb * boost analysis.py test coverage to 94% * add pv_energy pytest case. Change to ValueError rather than basic Exception when set_clearsky hasn't been run. Co-authored-by: Kevin Anderson <[email protected]>
1 parent 3cb3cfd commit cd9afe4

File tree

6 files changed

+238
-183
lines changed

6 files changed

+238
-183
lines changed

docs/RdAnalysis_example.ipynb

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

docs/RdAnalysis_example_pvdaq4.ipynb

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,25 @@
187187
" temperature_coefficient=meta['gamma_pdc'],\n",
188188
" interp_freq=freq,\n",
189189
" max_timedelta=pd.to_timedelta('15 minutes'),\n",
190-
" pvlib_location=loc,\n",
191190
" windspeed=df['wind_speed'],\n",
192-
" pv_tilt=meta['tilt'],\n",
193-
" pv_azimuth=meta['azimuth'],\n",
194191
" pv_nameplate=meta['power_dc_rated'],\n",
195-
" temperature_model=meta['temp_model_params'],\n",
196-
" albedo=0.25)"
192+
" temperature_model=meta['temp_model_params'])"
193+
]
194+
},
195+
{
196+
"cell_type": "markdown",
197+
"metadata": {},
198+
"source": [
199+
"A second step is required to set up the clearsky model, which needs to be localized and have tilt/orientation information."
200+
]
201+
},
202+
{
203+
"cell_type": "code",
204+
"execution_count": 8,
205+
"metadata": {},
206+
"outputs": [],
207+
"source": [
208+
"rd.set_clearsky(pvlib_location=loc, pv_tilt=meta['tilt'], pv_azimuth=meta['azimuth'], albedo=0.25)"
197209
]
198210
},
199211
{
@@ -211,7 +223,7 @@
211223
},
212224
{
213225
"cell_type": "code",
214-
"execution_count": 8,
226+
"execution_count": 9,
215227
"metadata": {},
216228
"outputs": [],
217229
"source": [
@@ -228,7 +240,7 @@
228240
},
229241
{
230242
"cell_type": "code",
231-
"execution_count": 9,
243+
"execution_count": 10,
232244
"metadata": {},
233245
"outputs": [],
234246
"source": [
@@ -238,7 +250,7 @@
238250
},
239251
{
240252
"cell_type": "code",
241-
"execution_count": 10,
253+
"execution_count": 11,
242254
"metadata": {},
243255
"outputs": [
244256
{
@@ -258,7 +270,7 @@
258270
},
259271
{
260272
"cell_type": "code",
261-
"execution_count": 11,
273+
"execution_count": 12,
262274
"metadata": {},
263275
"outputs": [
264276
{
@@ -279,7 +291,7 @@
279291
},
280292
{
281293
"cell_type": "code",
282-
"execution_count": 12,
294+
"execution_count": 13,
283295
"metadata": {},
284296
"outputs": [
285297
{
@@ -307,7 +319,7 @@
307319
},
308320
{
309321
"cell_type": "code",
310-
"execution_count": 13,
322+
"execution_count": 14,
311323
"metadata": {},
312324
"outputs": [
313325
{
@@ -332,7 +344,7 @@
332344
},
333345
{
334346
"cell_type": "code",
335-
"execution_count": 14,
347+
"execution_count": 15,
336348
"metadata": {},
337349
"outputs": [
338350
{
@@ -357,7 +369,7 @@
357369
},
358370
{
359371
"cell_type": "code",
360-
"execution_count": 15,
372+
"execution_count": 16,
361373
"metadata": {},
362374
"outputs": [
363375
{
@@ -382,7 +394,7 @@
382394
},
383395
{
384396
"cell_type": "code",
385-
"execution_count": 16,
397+
"execution_count": 17,
386398
"metadata": {},
387399
"outputs": [
388400
{
@@ -414,7 +426,7 @@
414426
},
415427
{
416428
"cell_type": "code",
417-
"execution_count": 17,
429+
"execution_count": 18,
418430
"metadata": {},
419431
"outputs": [
420432
{
@@ -436,7 +448,7 @@
436448
},
437449
{
438450
"cell_type": "code",
439-
"execution_count": 18,
451+
"execution_count": 19,
440452
"metadata": {},
441453
"outputs": [
442454
{
@@ -458,7 +470,7 @@
458470
},
459471
{
460472
"cell_type": "code",
461-
"execution_count": 19,
473+
"execution_count": 20,
462474
"metadata": {},
463475
"outputs": [
464476
{
@@ -487,7 +499,7 @@
487499
},
488500
{
489501
"cell_type": "code",
490-
"execution_count": 20,
502+
"execution_count": 21,
491503
"metadata": {},
492504
"outputs": [
493505
{
@@ -610,7 +622,7 @@
610622
"8 0.862228 90 True "
611623
]
612624
},
613-
"execution_count": 20,
625+
"execution_count": 21,
614626
"metadata": {},
615627
"output_type": "execute_result"
616628
}
@@ -630,7 +642,7 @@
630642
},
631643
{
632644
"cell_type": "code",
633-
"execution_count": 21,
645+
"execution_count": 22,
634646
"metadata": {},
635647
"outputs": [
636648
{
@@ -653,12 +665,8 @@
653665
" temperature_coefficient=meta['gamma_pdc'],\n",
654666
" interp_freq=freq,\n",
655667
" max_timedelta=pd.to_timedelta('15 minutes'),\n",
656-
" pvlib_location=loc,\n",
657668
" windspeed=df['wind_speed'],\n",
658-
" pv_tilt=meta['tilt'],\n",
659-
" pv_azimuth=meta['azimuth'],\n",
660-
" temperature_model=meta['temp_model_params'],\n",
661-
" albedo=0.25)\n",
669+
" temperature_model=meta['temp_model_params'])\n",
662670
"\n",
663671
"# Modify the poa filter parameters\n",
664672
"rd_new_filter.filter_params['poa_filter'] = {'poa_global_low':500}\n",
@@ -681,7 +689,7 @@
681689
},
682690
{
683691
"cell_type": "code",
684-
"execution_count": 22,
692+
"execution_count": 23,
685693
"metadata": {},
686694
"outputs": [],
687695
"source": [
@@ -700,7 +708,7 @@
700708
},
701709
{
702710
"cell_type": "code",
703-
"execution_count": 23,
711+
"execution_count": 24,
704712
"metadata": {},
705713
"outputs": [],
706714
"source": [
@@ -710,17 +718,13 @@
710718
" temperature_coefficient=meta['gamma_pdc'],\n",
711719
" interp_freq=freq,\n",
712720
" max_timedelta=pd.to_timedelta('15 minutes'),\n",
713-
" pvlib_location=loc,\n",
714721
" windspeed=df['wind_speed'],\n",
715-
" pv_tilt=meta['tilt'],\n",
716-
" pv_azimuth=meta['azimuth'],\n",
717-
" temperature_model=meta['temp_model_params'],\n",
718-
" albedo=0.25)"
722+
" temperature_model=meta['temp_model_params'])"
719723
]
720724
},
721725
{
722726
"cell_type": "code",
723-
"execution_count": 24,
727+
"execution_count": 25,
724728
"metadata": {},
725729
"outputs": [],
726730
"source": [
@@ -734,7 +738,7 @@
734738
},
735739
{
736740
"cell_type": "code",
737-
"execution_count": 25,
741+
"execution_count": 26,
738742
"metadata": {},
739743
"outputs": [
740744
{

docs/sphinx/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Conduct end-to-end Degradation and Soiling analysis with sensor_analysis or clea
3333
:toctree: generated/
3434

3535
analysis.RdAnalysis
36+
analysis.RdAnalysis.set_clearsky
3637
analysis.RdAnalysis.sensor_analysis
3738
analysis.RdAnalysis.clearsky_analysis
3839
analysis.RdAnalysis.plot_degradation_summary

docs/sphinx/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
RdTools Change Log
22
==================
33

4+
.. include:: changelog/v2.1.0.rst
45
.. include:: changelog/v2.0.1.rst
56
.. include:: changelog/v2.0.0.rst
67
.. include:: changelog/pre_2.0.0.rst

0 commit comments

Comments
 (0)