rencal.calibration.solar.solar_calibrator
rencal.calibration.solar.solar_calibrator defines the concrete solar calibration workflow for converting ERA5 solar resource data and historical generation into fitted PV curves and long-term load-factor streams.
SolarCalibrator extends Calibrator for solar technologies, estimates plant-specific gamma and NOCT parameters, and writes tabular calibration outputs plus stream artifacts for downstream simulation.
Example
Section titled “Example”from pathlib import Path
from rencal.calibration.solar.solar_calibrator import SolarCalibrator
calibrator = SolarCalibrator( data_path="data", plant_id_col="plant_id", output_path=Path("outputs"), visual_output=False, stream_npy_output=True,)calibrator.calibrate()Constructor
Section titled “Constructor”SolarCalibrator
Section titled “SolarCalibrator”class SolarCalibrator( data_path: str = None, plant_id_col: str = None, output_path: str | Path = Path.cwd(), visual_output: bool = False, stream_npy_output: bool = False,): SolarCalibratorCalibrates solar power curves for a set of timestamps and plant 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 PV curve is plotted to the output folder.visual_outputbool -
If True, solar streams are written in NPY format alongside PARQUET.stream_npy_outputbool
Returns SolarCalibrator
Methods
Section titled “Methods”SolarCalibrator.calibrate
Section titled “SolarCalibrator.calibrate”calibrate() -> NoneTriggers the full solar calibration workflow.
This workflow extracts plant-level irradiance and temperature data, calculates historical load factors, fits a NOCT-based PV curve for each plant, writes calibration summary artifacts, generates solar streams, and writes the resulting outputs.
Returns None
SolarCalibrator.solar_regression_model
Section titled “SolarCalibrator.solar_regression_model”solar_regression_model( x_data, gamma, noct,) -> np.ndarrayDefines the NOCT-style solar regression used to map irradiance and temperature to expected plant output.
The model is:
T_cell = T + (NOCT - 20) * G / 800return (1 - gamma * (T_cell - 25)) * G / 1000where G is irradiance and T is temperature. This gives a physically plausible PV response that decreases with elevated cell temperature while scaling with available irradiance.
Returns np.ndarray
SolarCalibrator.extract_resource_timeseries_for_plants
Section titled “SolarCalibrator.extract_resource_timeseries_for_plants”extract_resource_timeseries_for_plants() -> pd.DataFrameExtracts solar irradiance and temperature data for plants into a DataFrame.
Returns pd.DataFrame
SolarCalibrator.calculate_historical_load_factors
Section titled “SolarCalibrator.calculate_historical_load_factors”calculate_historical_load_factors() -> pd.DataFrameCalculates historical solar load factors from generation, capacity, and aligned irradiance/temperature data for each plant.
Returns pd.DataFrame
SolarCalibrator.fit_historical_load_factor_distribution
Section titled “SolarCalibrator.fit_historical_load_factor_distribution”fit_historical_load_factor_distribution() -> pd.DataFrameFits an empirical irradiance histogram for each plant and stores distribution summary statistics.
Returns pd.DataFrame
SolarCalibrator.estimate_load_factors_for_resource
Section titled “SolarCalibrator.estimate_load_factors_for_resource”estimate_load_factors_for_resource() -> pd.DataFrameFits the plant-specific NOCT curve parameters using curve_fit, then stores the resulting gamma, NOCT, and mean estimated load factor.
Returns pd.DataFrame
SolarCalibrator.generate_resource_streams
Section titled “SolarCalibrator.generate_resource_streams”generate_resource_streams() -> pd.DataFrameApplies the fitted PV curves to the full historical irradiance and temperature records to create plant-level solar load-factor streams.
Returns pd.DataFrame

