Skip to main content

Tools for performing common tasks on solar PV data signals

Project description

solar-data-tools

PyPI release Anaconda Cloud release

Tools for performing common tasks on solar PV data signals. These tasks include finding clear days in a data set, common data transforms, and fixing time stamp issues. These tools are designed to be automatic and require little if any input from the user. Libraries are included to help with data IO and plotting as well.

There is close integration between this repository and the Statistical Clear Sky repository, which provides a "clear sky model" of system output, given only measured power as an input.

See notebooks folder for examples.

Setup

Recommended: Set up conda environment with provided .yml file

Updated September 2020

We recommend seting up a fresh Python virutal environment in which to use solar-data-tools. We recommend using the Conda package management system, and creating an environment with the environment configuration file named pvi-user.yml, provided in the top level of this repository. This will install the statistical-clear-sky package as well.

Please see the Conda documentation page, "Creating an environment from an environment.yml file" for more information.

Installing this project as PIP package

$ pip install solar-data-tools

As of March 6, 2019, it fails because scs package installed as a dependency of cxvpy expects numpy to be already installed. scs issue 85 says, it is fixed. However, it doesn't seem to be reflected in its pip package. Also, cvxpy doesn't work with numpy version less than 1.16. As a work around, install numpy separatly first and then install this package. i.e.

$ pip install 'numpy>=1.16'
$ pip install statistical-clear-sky

Solvers

By default, ECOS solver is used, which is supported by cvxpy because it is Open Source.

However, it is found that Mosek solver is more stable. Thus, we encourage you to install it separately as below and obtain the license on your own.

  • mosek - For using MOSEK solver.

    $ pip install -f https://download.mosek.com/stable/wheel/index.html Mosek
    

Installing this project as Anaconda package

$ conda install -c slacgismo solar-data-tools

If you are using Anaconda, the problem described in the section for PIP package above doesn't occur since numpy is already installed. And during solar-data-tools installation, numpy is upgraded above 1.16.

Solvers

By default, ECOS solver is used, which is supported by cvxpy because it is Open Source.

However, it is found that Mosek solver is more stable. Thus, we encourage you to install it separately as below and obtain the license on your own.

  • mosek - For using MOSEK solver.

    $ conda install -c mosek mosek
    

Using this project by cloning this GIT repository

From a fresh python environment, run the following from the base project folder:

$ pip install -r requirements.txt

As of March 6, 2019, it fails because scs package installed as a dependency of cxvpy expects numpy to be already installed. scs issue 85 says, it is fixed. However, it doesn't seem to be reflected in its pip package. Also, cvxpy doesn't work with numpy version less than 1.16. As a work around, install numpy separatly first and then install this package. i.e.

$ pip install 'numpy>=1.16'
$ pip install -r requirements.txt

To test that everything is working correctly, launch

$ jupyter notebook

and run the two notebooks in the notebooks/ folder.

Usage

Clear Day Detection

This algorithm estimates the clear days in a data set two ways and then combines the estimates for the final estimations. The first estimate is based on the "smoothness" of each daily power signal. The second estimate is based on the seasonally adjusted daily energy output of the system.

import numpy as np
from solardatatools.clear_day_detection import find_clear_days
from solardatatools.data_transforms import make_2d
from solardatatools.dataio import get_pvdaq_data

pv_system_data = get_pvdaq_data(sysid=35, api_key='DEMO_KEY', year=[2011, 2012, 2013])

power_signals_d = make_2d(pv_system_data, key='dc_power')

clear_days = find_clear_days(power_signals_d)

Time Shift Detection and Fixing

This algorithm determines if the time stamps provided with the data have "shifted" at any point and then corrects the shift if found. These shifts can often be caused by incorrect handling of daylight savings time, but can come from other sources as well.

from solardatatools.data_transforms import fix_time_shifts, make_2d
from solardatatools.dataio import get_pvdaq_data
from solardatatools.plotting import plot_2d

pv_system_data = get_pvdaq_data(sysid=1199, year=[2015, 2016, 2017], api_key='DEMO_KEY')

power_signals_d = make_2d(pv_system_data, key='dc_power')

fixed_power_signals_d, time_shift_days_indices_ixs = fix_time_shifts(
    power_signals_d, return_ixs=True)

Versioning

We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the BSD 2-Clause License - see the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solar-data-tools-0.4.1.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solar_data_tools-0.4.1-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file solar-data-tools-0.4.1.tar.gz.

File metadata

  • Download URL: solar-data-tools-0.4.1.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.50.2 CPython/3.6.8

File hashes

Hashes for solar-data-tools-0.4.1.tar.gz
Algorithm Hash digest
SHA256 29c4f9839ed0669816f396df6a0fb65d3f724a9261e9bc1c30c6f7b33994f273
MD5 65b692e5a796837dc6842f74e24163a8
BLAKE2b-256 dd2874d8256c88013f855bc545c9fa1a37493e52beeeddcbee8cb06914c43877

See more details on using hashes here.

File details

Details for the file solar_data_tools-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: solar_data_tools-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.50.2 CPython/3.6.8

File hashes

Hashes for solar_data_tools-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b040182d0ef2e41721569064dc9bca187810581c47b160b2e0f4737ca322e0b
MD5 8a4bff8c4de5313a0c7ca3a167e0660a
BLAKE2b-256 139e2215d88bcd19e4a9ad1b0a67131be548c8752e12579c40fbcea4829b2829

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page