0

I am having a conceptual problem with pvlib's predictions: The problem is that if I ask for "past predictions" then I do not know what the temporal horizon is for the prediction. For actual future predictions it is a little more obvious, naively I would just subtract the present time from the timestamp of the prediction returned, although if data requests (model dependent) are made only at hourly or 6-hourly intervals, then it seems like I would have to add that uncertainty to the horizon, so I am still unsure.

For past predictions, I just have no idea what the horizon is. How can this be determined?

This question applies to both pvlib-python's standard way to get data/ forecasts and I think it also applies to the special script https://github.com/wholmgren/get_nomads to get data for predictions further into the past.

Any help would be appreciated in understanding this situation.

To try to make this question more concrete I am including this bit of code taken from forecast_to_power.ipynb with the start and end times modified to be in the past:

# built-in python modules
import datetime
import inspect
import os

# scientific python add-ons
import numpy as np
import pandas as pd

# plotting stuff
# first line makes the plots appear in the notebook
%matplotlib inline 
import matplotlib.pyplot as plt
import matplotlib as mpl

# finally, we import the pvlib library
from pvlib import solarposition,irradiance,atmosphere,pvsystem
from pvlib.forecast import GFS, NAM, NDFD, RAP, HRRR

# Choose a location.
# Tucson, AZ
latitude = 32.2
longitude = -110.9
tz = 'US/Mountain'

surface_tilt = 30
surface_azimuth = 180 # pvlib uses 0=North, 90=East, 180=South, 270=West convention
albedo = 0.2

# for this example, let's predict into the past:
start = pd.Timestamp(datetime.date.today(), tz=tz) - pd.Timedelta(days=14) # 14 days ago
end = start + pd.Timedelta(days=7) # 7 days from start

fm = GFS()

forecast_data = fm.get_processed_data(latitude, longitude, start, end)

forecast_data.head()

temp_air    wind_speed  ghi dni dhi total_clouds    low_clouds  mid_clouds  high_clouds
2019-02-25 06:00:00-07:00   6.581512    1.791610    0.000000    0.000000    0.000000    33.0    0.0 0.0 33.0
2019-02-25 09:00:00-07:00   4.832214    0.567790    392.833659  668.164855  121.831040  0.0 0.0 0.0 0.0
2019-02-25 12:00:00-07:00   3.409973    0.860611    794.120954  910.658669  118.492918  0.0 0.0 0.0 0.0
2019-02-25 15:00:00-07:00   6.841797    0.942555    529.425232  515.727013  222.689391  22.0    0.0 0.0 22.0
2019-02-25 18:00:00-07:00   24.458038   0.466084    11.339769   0.000000    11.339769   52.0    0.0 0.0 52.0

What is the temporal horizon for this back prediction? Can I adjust it? If so how?

apoyoman
  • 1
  • 1

1 Answers1

0

For actual future predictions it is a little more obvious, naively I would just subtract the present time from the timestamp of the prediction returned

Yes, this is correct for true predictions. For past predictions, you should define the horizon in a way that is consistent with your ability to make true predictions.

NCEP maintains a model status page that details the typical times at which the weather model data is available on its servers. Each model has a different delay between its initialization time and its forecast availability.

The Solar Forecast Arbiter definitions document might also help.

Will Holmgren
  • 696
  • 5
  • 12