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.
Metadata
Release files for swc 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| swc-0.7.2.tar.gz | 35.3 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swc-0.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.2 MB
Release files / swc-0.7.2.tar.gz
| Download URL | swc-0.7.2.tar.gz |
|---|---|
| Size | 35.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2a4bf03d95fc95e6b9ab0cc78139500202916a50e0421e610bcd6e85b431253
|
|
BLAKE2b-256 checksum How to use checksums |
d909395e9c283bfa95b2833c4e5685b9fa4832e4bd7fafc3b858eb3a3fd06854
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / swc-0.7.2-py3-none-any.whl
| Download URL | swc-0.7.2-py3-none-any.whl |
|---|---|
| Size | 61.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
539722cf93c40ea850c00cd0145329faa37b24637e298e9230fe61e00354a11c
|
|
BLAKE2b-256 checksum How to use checksums |
380511d584eda9a24718b54ff73dbafc0db830506cf0c06f991801021b68ab53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for swc 0.7.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.