rencal.calibration.wind.wind_calibrator
rencal.calibration.wind.wind_calibrator defines the concrete wind calibration workflow for converting ERA5 wind resource data and historical generation into fitted wind power curves and long-term load-factor streams.
WindCalibrator extends Calibrator for wind technologies, fits Weibull and logistic curve parameters per plant, and writes tabular calibration outputs plus stream artifacts for downstream simulation.
Example
Section titled “Example”from pathlib import Path
from rencal.calibration.wind.wind_calibrator import WindCalibrator
# Using local data filescalibrator = WindCalibrator( data_path="data", plant_id_col="plant_id", output_path=Path("outputs"), visual_output=False, stream_npy_output=True,)calibrator.calibrate()
# Using a custom loader (e.g. reading inputs from cloud storage)calibrator = WindCalibrator( loader=my_cloud_loader, output_path=Path("outputs"),)calibrator.calibrate()Constructor
Section titled “Constructor”WindCalibrator
Section titled “WindCalibrator”class WindCalibrator( data_path: str = None, plant_id_col: str = None, output_path: str | Path = Path.cwd(), visual_output: bool = False, stream_npy_output: bool = False, loader: DataLoader | None = None,): WindCalibratorCalibrates wind power curves for a set of timestamps and CFD IDs.
Parameters
Section titled “Parameters”-
Path to the folder containing plant information, generation, and resource data.data_pathstr -
Name of the plant identifier column.plant_id_colstr -
Location to write the output files to.output_pathstr|Path -
If True, each calibrated plant’s power curve is plotted to the output folder.visual_outputbool -
If True, wind streams are written in NPY format alongside PARQUET.stream_npy_outputbool -
Optional pre-configured data loader used instead of the defaultloaderDataLoader | NoneLocalDataLoader(e.g. a cloud loader reading inputs directly from their original Blob locations). When provided it overridesdata_path.
Returns WindCalibrator
Methods
Section titled “Methods”WindCalibrator.calibrate
Section titled “WindCalibrator.calibrate”calibrate() -> NoneTriggers the full wind calibration workflow.
This workflow extracts plant-level wind speeds, computes historical load factors, fits Weibull and logistic parameters, writes calibration summary artifacts, generates wind streams, and writes resulting outputs.
Returns None
WindCalibrator.extract_resource_timeseries_for_plants
Section titled “WindCalibrator.extract_resource_timeseries_for_plants”extract_resource_timeseries_for_plants() -> pd.DataFrameExtracts resource data for plants into a DataFrame.
Returns pd.DataFrame
WindCalibrator.calculate_historical_load_factors
Section titled “WindCalibrator.calculate_historical_load_factors”calculate_historical_load_factors() -> pd.DataFrameCalculates historical load factors based on resource availability and generation data for each plant.
Returns pd.DataFrame
WindCalibrator.fit_historical_load_factor_distribution
Section titled “WindCalibrator.fit_historical_load_factor_distribution”fit_historical_load_factor_distribution() -> pd.DataFrameFits probability distribution to historical load factors and resource availability.
Returns pd.DataFrame
WindCalibrator.estimate_load_factors_for_resource
Section titled “WindCalibrator.estimate_load_factors_for_resource”estimate_load_factors_for_resource() -> pd.DataFrameEstimates load factors based on the historical distribution and the whole resource availability history.
Returns pd.DataFrame
Raises
ValueError: If no calibration summary rows were produced.
WindCalibrator.logistic_function
Section titled “WindCalibrator.logistic_function”logistic_function( x: int | float | np.ndarray, b: float, c: float, g: float,) -> float | np.ndarrayDefines a generalised logistic function in the log domain for stability and calculates its value for any numeric input x.
For deeper conceptual context, see Logistic Power Curve.
The generalized logistic function has five shape parameters; this implementation constrains minimum/maximum to 0 and 1 respectively because load factors are bounded to [0, 1].
The non-log-domain form is:
where b is steepness, c is inflection location, and g is asymmetry.
Parameters
Section titled “Parameters”-
Input variable(s), i. e.: wind speed.xint|float|np.ndarray -
Steepness parameter of the generalised logistic function.bfloat -
X-axis inflection point location parameter of the generalised logistic function.cfloat -
Asymmetry parameter of the generalised logistic function.gfloat
Returns float | np.ndarray
WindCalibrator.weibull_function
Section titled “WindCalibrator.weibull_function”weibull_function( x: int | float | np.ndarray, k_val: float, lambda_val: float,) -> float | np.ndarrayCalculates the value of a specified Weibull distribution for any numeric input x.
For deeper conceptual context, see Weibull Wind-Speed Distribution.
The Weibull density is:
where k is shape and λ is scale.
Parameters
Section titled “Parameters”-
Input variable(s), i. e.: wind speed.xint|float|np.ndarray -
Shape parameter of the Weibull distribution.k_valfloat -
Scale parameter of the Weibull distribution.lambda_valfloat
Returns float | np.ndarray
WindCalibrator.generate_resource_streams
Section titled “WindCalibrator.generate_resource_streams”generate_resource_streams() -> pd.DataFrameGenerates wind streams from fitted and/or generalised power curve parameters and long-term wind data.
Returns pd.DataFrame
WindCalibrator.output_historical_load_factor_distribution_parameters
Section titled “WindCalibrator.output_historical_load_factor_distribution_parameters”output_historical_load_factor_distribution_parameters() -> NoneWrites historical load factor parameters to a CSV file.
Returns None
WindCalibrator.output_resource_per_plant
Section titled “WindCalibrator.output_resource_per_plant”output_resource_per_plant() -> NoneWrites resource time series for each plant to a CSV file.
Returns None
WindCalibrator.output_resource_streams
Section titled “WindCalibrator.output_resource_streams”output_resource_streams() -> NoneWrites resource streams to a parquet file.
If stream_npy_output=True, the method also writes an .npy file alongside the parquet output.
Returns None
WindCalibrator.output_estimated_load_factors_tabular
Section titled “WindCalibrator.output_estimated_load_factors_tabular”output_estimated_load_factors_tabular() -> NoneOutputs table of estimated load factors for whole resource availability history.
Returns None
WindCalibrator.output_estimated_load_factors_visual
Section titled “WindCalibrator.output_estimated_load_factors_visual”output_estimated_load_factors_visual( logistic_params: np.ndarray, load_factors: pd.DataFrame,) -> NoneOutputs a series of plots of estimated load and fitted curves per plant.
Parameters
Section titled “Parameters”-
Fitted logistic parameters.logistic_paramsnp.ndarray -
Plant load-factor observations.load_factorspd.DataFrame
Returns None

