Comments (2)
Draft for a version of the ASTM std approach when you already have the std from the historian:
def drop_unstable_irr(data, std_perc_columns, threshold=2):
"""
Removes cloudy intervals by the statistical technique defined in ASTM E2848.
Filters out periods of unstable irradiance based on the standard deviation of
samples as a percentage of the mean of samples. Standard deviations that are
a higher percentage of the mean than the threshold are deemed periods of
unstable irradiance and dropped.
Parameters
----------
data : DataFrame
Data to filter which must include the columns specified by `std_perc_columns`
std_perc_columns : list
List of column names for the columns that contain the standard deviations of
the samples in an averaging interval as a percent of the mean of the samples
for the averaging interval.
threshold : numeric
Values greater than the threshold are removed. E.g. 2 is 2 percent.
all_cols : boolean, default False
By default any interval where any of the values in the columns of
`std_perc_columns` is above threshold is removed. Change to True
to require all columns to be above theshold to remove.
"""
df = data[std_perc_columns]
mask = df > threshold
return data[~(mask.any(axis=1))]
from pvcaptest.
Latest draft version, which improves on the above by calculating the std as a percent of the mean and adds those percentages to the data
and data_filtered
attributes:
class CapDataStd(CapData):
@update_summary
def filter_unstable_irr_std(self, poa_group, std_group, threshold=2):
"""
Removes cloudy intervals by the statistical technique defined in ASTM E2848.
Filters out periods of unstable irradiance based on the standard deviation of
samples as a percentage of the mean of samples. Standard deviations that are
a higher percentage of the mean than the threshold are deemed periods of
unstable irradiance and dropped.
Parameters
----------
poa_group : str
Id of `column_groups` for the group that contain the mean POA irradiance
measurements for each interval.
std_group : str
Id of `column_groups` for the group that contain the standard deviation of the POA irradiance
measurements for each interval.
threshold : numeric
Values greater than the threshold are removed. E.g. 2 is 2 percent.
"""
p = self.loc[poa_group]
s = self.loc[std_group]
std_perc_columns_list = []
for poa_col in p.columns:
p_tag = p[poa_col]
s_tag = s.filter(regex=poa_col).iloc[:, 0]
std_perc = ((s_tag / p_tag) * 100)
std_perc_columns_list.append(std_perc.rename(s_tag.name + '_perc'))
std_perc_columns = pd.concat(std_perc_columns_list, axis=1)
self.data = pd.concat([self.data, std_perc_columns], axis=1)
std_perc_columns_filtered = std_perc_columns.loc[self.data_filtered.index, :]
self.data_filtered = pd.concat([self.data_filtered, std_perc_columns_filtered], axis=1)
mask = std_perc_columns_filtered > threshold
self.data_filtered = self.data_filtered[~(mask.any(axis=1))]
from pvcaptest.
Related Issues (20)
- Export Filtered Datasets HOT 1
- Scipy version in yaml HOT 2
- load_pvsyst requires pandas<1.3.0 HOT 1
- CapData.copy should use deepcopy on column_groups attribute
- SVG version of logo HOT 2
- `tables` is not needed for `pvlib>=0.9.0` HOT 1
- Migrate CI from Travis to Github Actions HOT 3
- io.load_data kwargs docstring incorrect
- `DataLoader.load` doesn't pass kwargs to `file_reader` when path is to a file HOT 1
- `io.file_reader` should allow passing kwargs used in `read_csv`
- clean up io.DataLoader.load docstring
- remove references in docstrings to irr_rc_balanced
- Getting "invalid index to scalar variable" when loading data HOT 22
- Setup Zenodo to create DOI for releases? GH release process? HOT 7
- DataLoader.load try except obscuring errors
- Error when using a tolerance value with a decimal
- Holoviews import error when trying to import captest HOT 2
- Bokeh Plotting Issue HOT 7
- New plot() -- default_groups created in Layout tab is causing an error when data tag names have changed HOT 4
- Custom plot using plots_defaults.json fails doesn't work with more than one CapData object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pvcaptest.