@@ -280,7 +280,8 @@ def orientation_strategy(self, strategy):
280
280
281
281
def prepare_inputs (self , times , irradiance = None , weather = None ):
282
282
"""
283
- Run the model.
283
+ Prepare the solar position, irradiance, and weather inputs to
284
+ the model.
284
285
285
286
Parameters
286
287
----------
@@ -339,6 +340,7 @@ def run_model(self):
339
340
"""
340
341
A stub function meant to be subclassed.
341
342
"""
343
+
342
344
raise NotImplementedError (
343
345
'you must subclass ModelChain and implement this method' )
344
346
@@ -347,20 +349,31 @@ class SAPM(ModelChain):
347
349
"""
348
350
Uses the SAPM to calculate cell temperature, DC power and AC power.
349
351
"""
350
- def run_model (self ):
352
+ def run_model (self , times , irradiance = None , weather = None ):
351
353
"""
352
354
Run the model.
353
355
354
356
Parameters
355
357
----------
358
+ times : DatetimeIndex
359
+ Times at which to evaluate the model.
360
+
361
+ irradiance : None or DataFrame
362
+ If None, calculates clear sky data.
363
+ Columns must be 'dni', 'ghi', 'dhi'.
364
+
365
+ weather : None or DataFrame
366
+ If None, assumes air temperature is 20 C and
367
+ wind speed is 0 m/s.
368
+ Columns must be 'wind_speed', 'temp_air'.
356
369
357
370
Returns
358
371
-------
359
372
self
360
373
361
374
Assigns attributes: temps, dc, ac
362
375
"""
363
-
376
+ self . prepare_inputs ( times , irradiance , weather )
364
377
365
378
self .temps = self .system .sapm_celltemp (self .total_irrad ['poa_global' ],
366
379
self .weather ['wind_speed' ],
@@ -383,12 +396,23 @@ class SingleDiode(ModelChain):
383
396
and the SAPM models to calculate cell temperature and AC power.
384
397
"""
385
398
386
- def run_model (self ):
399
+ def run_model (self , times , irradiance = None , weather = None ):
387
400
"""
388
401
Run the model.
389
402
390
403
Parameters
391
404
----------
405
+ times : DatetimeIndex
406
+ Times at which to evaluate the model.
407
+
408
+ irradiance : None or DataFrame
409
+ If None, calculates clear sky data.
410
+ Columns must be 'dni', 'ghi', 'dhi'.
411
+
412
+ weather : None or DataFrame
413
+ If None, assumes air temperature is 20 C and
414
+ wind speed is 0 m/s.
415
+ Columns must be 'wind_speed', 'temp_air'.
392
416
393
417
Returns
394
418
-------
@@ -397,6 +421,7 @@ def run_model(self):
397
421
Assigns attributes: temps, dc, ac
398
422
"""
399
423
424
+ self .prepare_inputs (times , irradiance , weather )
400
425
401
426
self .temps = self .system .sapm_celltemp (self .total_irrad ['poa_global' ],
402
427
self .weather ['wind_speed' ],
0 commit comments