The data
The $455.72 is only as good as the data under it. The sunlight, the prices and the household use all come from public U.S. government datasets. None of it is made up, and you can get all three yourself.
What I use
One for each of the three things a day is made of: what the panels make, what power costs, and what the house uses.
Sunlight
U.S. National Renewable Energy Laboratory
Prices
OpenEI Utility Rate Database, U.S. Department of Energy
Household use
U.S. Department of Energy
Do it yourself
All three are free and public. Nothing here is behind a login I have and you do not.
PVWatts and the rate database are both served from developer.nlr.gov. Signing up is free and takes a minute. Set the key as an environment variable, or put it in a .env file at the root of the repository.
The program asks PVWatts once for a full year, and the rate database for the tariff. Both are saved to disk, so the year downloads once instead of 365 times. The ResStock profiles are already in the repository.
Every response is checked before it is used: no sun at night, sensible midday peaks, 24 prices at believable levels. The tests run against saved copies, so they never need the network or my key.
All three land on the same 24 hourly slots. Energy is added up within each hour and the price for that hour is attached, so a day becomes three lined-up lists plus the battery’s settings.
terminal
export NREL_API_KEY=your_key_here
python -c "from quantum_solar import annual_savings; print(annual_savings(39.74, -105.18))"That prints the same $455.72 the rest of this project is built on. If it does not, one of us has a bug and I would like to know which.
One detail that matters
The ResStock profiles average the 22 July weekdays exactly as the 2018 calendar defines them. So when my program asks whether day 193 is a weekday, it has to use 2018 too. Any other year would put weekday household patterns on days the source data treated as weekends.
2018 is also not a leap year, so 365 days line up exactly with the 8,760 hours PVWatts returns and there is no February 29 to handle. Both reasons are written into the code, so nobody makes the year adjustable later and breaks the alignment.
What this data does not cover
Credit
PVWatts and ResStock are published by the U.S. National Renewable Energy Laboratory. The Utility Rate Database is run by the Department of Energy’s OpenEI project. None of the datasets is mine. My part is picking them, checking them, and lining them up so they describe the same house on the same day.
Keep reading