Skip to content

Commit

Permalink
v2.11.04
Browse files Browse the repository at this point in the history
SolCast --> Solcast (per official spelling)
Bug fix
  • Loading branch information
StefaE committed Jan 21, 2024
1 parent 51ac375 commit 25d05dd
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 43 deletions.
2 changes: 1 addition & 1 deletion PVForecast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = """Stefan E"""
__email__ = 'se_misc ... hotmail.com'
__version__ = '2.11.03'
__version__ = '2.11.04'
2 changes: 1 addition & 1 deletion PVForecast/influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _verifyDB(self, client):

# ----------------------------------------------------------------------------------- outdated code
def getPostData(self, solcast, power_field):
"""get data to be posted to SolCast - deprecated as SolCast deprecated data upload"""
"""get data to be posted to Solcast - deprecated as Solcast deprecated data upload"""
try:
if self._influx_V2:
sys.tracebacklimit=0
Expand Down
15 changes: 8 additions & 7 deletions PVForecast/solcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, config):
if self._site_2 is not None: # if we have two arrays, each consume a credit
self._apiCalls = floor(self._apiCalls/2)
if self._force:
print("Warning --- SolCast download forced!!! Note limits in number of downloads/day!")
print("Warning --- Solcast download forced!!! Note limits in number of downloads/day!")
self.SQLTable = 'solcast'
self.postDict = None # dictionary to post to solcat

Expand Down Expand Up @@ -112,15 +112,16 @@ def _doDownload(self):
retVal = True
else:
nextDL = now_utc + timedelta(minutes= interval - delta_t)
if (nextDL > mySun['sunset']):
nextDL = mySun['sunrise'] + timedelta(days=1)
print("Message - SolCast download inhibted to preserve credits; next DL planned after (UTC): " + nextDL.strftime("%Y-%m-%d, %H:%M:%S"))
if self._interval != -3:
if (nextDL > mySun['sunset']):
nextDL = mySun['sunrise'] + timedelta(days=1)
print("Message - Solcast download inhibted to preserve credits; next DL planned after (UTC): " + nextDL.strftime("%Y-%m-%d, %H:%M:%S"))
if retVal:
print("Message - downloading SolCast data at (UTC): " + str(now_utc))
print("Message - downloading Solcast data at (UTC): " + str(now_utc))
else:
print("Warning --- getting SolCast data not supported without database storage enabled (storeDB or storeInflux)")
print("Warning --- getting Solcast data not supported without database storage enabled (storeDB or storeInflux)")
else:
print("Message - SolCast download inhibted between sunset and sunrise (see 'interval' parameter)")
print("Message - Solcast download inhibted between sunset and sunrise (see 'interval' parameter)")
return(retVal)

def getSolCast(self):
Expand Down
8 changes: 7 additions & 1 deletion debug/solcast_timeInterval.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
location = LocationInfo('na', 'na', 'UTC', latitude=50.2, longitude=8.7) # Frankfurt: 50.2N / 8.7E
day = datetime(2023, 1, 1, 0, 0, 0, tzinfo=timezone.utc) # day, from which to run

DAYS = 365 # number of days to run (more verbose output if DAYS = 1)
DAYS = 365 # number of days to run (more verbose output if DAYS = 1)
INTERVAL = 0 # interval used (as in solcast.py: 0 .. -3)
apiCalls = 10 # available API credits
isDualArray = True # whether we have a dual-array config
Expand Down Expand Up @@ -79,6 +79,12 @@
print(n, " -- ", now_utc, "; delta_t = ", delta_t)
if delta_t < 1440: stepSize.append(delta_t)
last_issue = now_utc
elif DAYS == 1:
nextDL = now_utc + timedelta(minutes= interval - delta_t)
if INTERVAL != -3:
if (nextDL > mySun['sunset']):
nextDL = mySun['sunrise'] + timedelta(days=1)
print("Message - Solcast download inhibted to preserve credits; next DL planned after (UTC): " + nextDL.strftime("%Y-%m-%d, %H:%M:%S"))
print("day: ", day.date(), " nCalls= ", n, " Intervals used: ", set(stepSize))
allSteps = allSteps + list(set(stepSize))
credits_used.append(n)
Expand Down
8 changes: 4 additions & 4 deletions docs/PVOutput.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ The following shows forecast and actual data for a week in early May 2021:

<img src="pictures/SolCast_8days.png">

For comparison reasons, also _MOSMIX_ is shown in red. It seems obvious that _SolCast_ does a much better job in modeling the actual ups and downs of output power over the day. This is because they update their forecast every 15min ([region dependent](https://solcast.com/live-and-forecast)) and in the graph the most recent update is shown.
For comparison reasons, also _MOSMIX_ is shown in red. It seems obvious that _Solcast_ does a much better job in modeling the actual ups and downs of output power over the day. This is because they update their forecast every 15min ([region dependent](https://solcast.com/live-and-forecast)) and in the graph the most recent update is shown.

_SolCast_ is also the only source which provides a confidence interval (percentiles p10, p90) for its forecasts. We should hence expect fluctuations of actual generated power roughly within this interval.
_Solcast_ is also the only source which provides a confidence interval (percentiles p10, p90) for its forecasts. We should hence expect fluctuations of actual generated power roughly within this interval.

### Traditional weather services

Expand Down Expand Up @@ -68,7 +68,7 @@ Hmm... what to believe? Forecasts are difficult, especially those about the futu

### Forecast horizon

For the example of _SolCast_, we'll investigate a bit how forecasts evolve over different forecast horizons. Solcast is updating its forecast every 15min (although forecast intervals are always fixed at 30min for the rooftop version). The maximum forecast horizon is 14 days.
For the example of _Solcast_, we'll investigate a bit how forecasts evolve over different forecast horizons. Solcast is updating its forecast every 15min (although forecast intervals are always fixed at 30min for the rooftop version). The maximum forecast horizon is 14 days.

Hence, if we look at eg. April 29th, we get the following picture. The concept described here is identical for other forecast providers, although forecast updates are much rarer (hourly, six-hourly)

Expand All @@ -84,7 +84,7 @@ Comparing these forecasts with actuals, show that on this exceptional day, Solca

<img src="pictures/SolCast_Apr29.png">

Generally speaking, _SolCast_ and _VisualCrossing_ update their forecasts aggressively over time. _MOSMIX_ does not significantly change forecasts once issued. This is true for both versions of _MOSMIX_: the station specific three-hourly update (`MOSMIX_L`) as well as the 'all-stations' hourly update (`MOSMIX_S`).
Generally speaking, _Solcast_ and _VisualCrossing_ update their forecasts aggressively over time. _MOSMIX_ does not significantly change forecasts once issued. This is true for both versions of _MOSMIX_: the station specific three-hourly update (`MOSMIX_L`) as well as the 'all-stations' hourly update (`MOSMIX_S`).

### Quantifying forecast quality

Expand Down
Loading

0 comments on commit 25d05dd

Please sign in to comment.