CapData
The CapData class is the core interface for
capacity testing. It holds raw and filtered data, column group mappings, filter
history, and regression results.
|
Class to store capacity test data and column grouping. |
Setup
Methods that must be called after loading data and before filtering or
fitting a regression. Use set_regression_cols()
to map regression terms to column names or column group ids, then call
process_regression_columns() to validate and
prepare those mappings. custom_param() adds a
column of derived values (e.g. temperature-corrected power or spectral
corrections) directly to the CapData instance;
see Calculation Parameters for the available calculation functions.
|
Create a dictionary linking the regression variables to data. |
Walk the regression column dictionary and calculate parameters. |
|
|
Applies the function func with kwargs and adds result as new column to data. |
Data Management
Methods for inspecting, renaming, copying, and exporting data.
|
Get regression columns renamed with keys from regression_cols. |
Print column_groups with nice formatting. |
|
Create and returns a copy of self. |
|
Return a boolean indicating if the CapData object contains data. |
|
|
Drop columns from CapData data and column_groups. |
|
Rename columns in data and column_groups. |
Aggregation
Methods for aggregating sensor readings into single representative columns.
|
Aggregate measurments of the same variable from different sensors. |
|
Aggregate columns in a group. |
|
Traverses, expands, and sorts the agg_map. |
Remove aggregation columns from data and data_filtered attributes. |
Filtering
Thin wrappers that build a step class from captest.filters and
run() it, appending it to the CapData.filters chain (the single source
of truth from which data_filtered is derived). Each accepts an optional
custom_name label. describe_filters returns a written summary of the
run, while filters_to_config / run_pipeline serialize and replay the
chain. See Filters for the underlying step classes.
|
Filter on irradiance values. |
|
Remove PVsyst intervals operating off the maximum power point. |
|
Remove intervals of array shading. |
|
Select data for a specified time period. |
|
Keep or drop the timestamps belonging to a list of days. |
|
Apply EllipticEnvelope from scikit-learn to remove outliers in (poa, power). |
|
Remove intervals with a power factor below |
|
Remove intervals at or above a power threshold. |
|
Remove intervals where a column's rolling std is at or above a threshold. |
Remove intervals with a large fractional change from the prior interval. |
|
|
Remove intervals where a boolean/flag column is truthy. |
|
Keep intervals where |
|
Apply |
|
Drop suspicious measurements by comparing readings across sensors. |
Drop rows where a sensor deviates from its group average by too much. |
|
|
Remove unstable-irradiance intervals using pvlib detect_clearsky. |
Remove intervals where single-axis-tracker backtracking is active. |
|
|
Remove rows with missing data (NaN) in the regression columns. |
|
NOT CURRENTLY IMPLEMENTED - Filter on inverter operation state. |
Set data_filtered to data and reset filtering summary. |
|
Return a written, human-readable summary of the filtering run. |
|
Serialize the applied filter chain to a list of config dicts. |
|
|
Rebuild and run each filter step from a list of config dicts. |
Reporting Conditions
Methods for computing ASTM E2848 reporting conditions. rep_irr is the
reporting POA irradiance used to anchor filter_irr(ref_val='rep_irr'); within
a CapTest it resolves from the single test RC. See
Reporting Conditions in the user guide.
|
Calculate reporting conditions for the current regression formula. |
|
Calculate frequency-grouped reporting conditions. |
Reporting POA irradiance anchoring relative irradiance filters. |
Regression
Methods for fitting the ASTM E2848 regression and predicting capacities.
|
Perform a regression with statsmodels on the filtered data. |
Calculate expected capacities. |
Results and Uncertainty
Methods for quantifying test results, uncertainty, and completeness.
Calculate random standard uncertainty of the regression. |
|
|
Spatial uncertainties of the independent regression variables. |
|
Calculate expanded uncertainty of the predicted power. |
Returns DataFrame showing which filter removed each filtered time interval. |
|
Return a DataFrame summarizing the applied filter chain. |
|
|
print summary data on the number of points collected. |
Get length of test period. |
|
|
Set number of data points required for complete test attribute. |
|
Sets test_complete attribute. |
Visualization
Methods for scatter plots, filter inspection, and interactive dashboards.
|
Create a matplotlib scatter plot of regression lhs vs. |
|
Create a holoviews scatter plot of regression lhs vs. |
|
Create a dashboard to explore timeseries plots of the data. |
Create pandas scatter matrix of regression variables. |
|
Overlay of power-vs-irradiance scatters attributing removed intervals. |
|
Power-vs-time line with removed intervals highlighted per filter. |
Export
Methods for writing data and column groups to Excel.
Write the columns of data to an excel file as a template for a column grouping. |
|
|
Export the column groups attribute to an excel file. |