Solar performance calculator
Project description
SWC
Simplified solar performance simulator
Table of contents
About
I made this code for my personal use. The code merges the NSRDB-API and the SAM-SDK in one easy code to simulate the performance of a solar power plant at a given location. If you want to know more about the SAM-SDK or NSRDB-API please visit their respective websites.
Installations
To install using pip
pip install swc
To upgrade
pip install --upgrade swc
How to use
Using the solar radiation data as input, we implemented an easy way to change the configuration parameters to simulate the performance of a PV system.
Configuration
First you need to get an API. Read https://developer.nrel.gov/signup/. Once you have it, create a .env file under your working folder that includes:
API_KEY=YOUR API_KEY_GOES_HERE
And thats it!
Solar radiation data
To get solar radiation data from the NSRB from a Jupyter Notebook or Console
import swc.nsrdb as nsrdb
# Define site dictionary
site_info = {
"lat": 18.3,
"lng": -99.3,
"api_key": "YourAPIKEY",
"force_download": False,
"year": "2014",
}
# Download data
df = nsrdb.get_nsrdb_data(**site_info)
print(df.head())
SAM simulation
To perform a SAM simulation using the data from the NSRDB
import swc.sam_simulation as sam
# Define simulation params
simulation_params = {
"lat": site_info["lat"],
"lng": site_info["lng"],
"losses": 4.3,
"dc_ac_ratio": 1.2,
"inv_eff": 96.0,
"tilt": 20,
"system_capacity": 100,
"elevation": 1100,
"timezone": -6,
"configuration": 0, # 0 For fixed tilt, 2 for 1-axis and 4 for 2-axis
"gcr": 0.4,
"azimuth": 100,
"interval": 60,
}
# Run SAM simulation
output_data, output_params = sam.sam_simulation(df, **simulation_params)
print(output_data.head())
Authors
- pesap
- Sergio Castellanos
Todo
- Update the code to include more use cases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file swc-0.7.2.tar.gz
.
File metadata
- Download URL: swc-0.7.2.tar.gz
- Upload date:
- Size: 35.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2a4bf03d95fc95e6b9ab0cc78139500202916a50e0421e610bcd6e85b431253 |
|
MD5 | 4650ade69c234f7013d530e92d2cb4a1 |
|
BLAKE2b-256 | d909395e9c283bfa95b2833c4e5685b9fa4832e4bd7fafc3b858eb3a3fd06854 |
File details
Details for the file swc-0.7.2-py3-none-any.whl
.
File metadata
- Download URL: swc-0.7.2-py3-none-any.whl
- Upload date:
- Size: 61.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 539722cf93c40ea850c00cd0145329faa37b24637e298e9230fe61e00354a11c |
|
MD5 | d41a4f87a2c9f309c53efc9a19dcf2e9 |
|
BLAKE2b-256 | 380511d584eda9a24718b54ff73dbafc0db830506cf0c06f991801021b68ab53 |