energy_methods.acceptance_band#

Publication-based two-stage acceptance bands, DOI 10.3390/en13092166.

This is a maintained reimplementation of the previous ASVA method, not original author software. The paper’s inconsistent printed distance/roughness expressions are resolved explicitly in README.md. Fit receives training data only. Bounds depend on irradiance alone and never inspect the observations being evaluated.

Scientific sources: ascencio_vasquez_2021_thesis and ascencio_vasquez_2020_modelling in energy_methods.references.

exception energy_methods.acceptance_band.BandFitUnavailable[source]#

Bases: ValueError

Insufficient scientific support; callers must not silently skip the filter.

class energy_methods.acceptance_band.AcceptanceBandConfig(bin_width_wm2=50.0, irradiance_max_wm2=1300.0, min_samples_per_bin=10, min_supported_bins=7, accuracy_level='low')[source]#

Bases: object

Numerical conventions that were not fully specified in the publication.

Parameters:
  • bin_width_wm2 (float)

  • irradiance_max_wm2 (float)

  • min_samples_per_bin (int)

  • min_supported_bins (int)

  • accuracy_level (Literal['low', 'medium', 'high'])

bin_width_wm2: float#
irradiance_max_wm2: float#
min_samples_per_bin: int#
min_supported_bins: int#
accuracy_level: Literal['low', 'medium', 'high']#
class energy_methods.acceptance_band.FittedAcceptanceBand(config, lower_coefficients, center_coefficients, upper_coefficients, power_scale_mwh, support_wm2, populated_bin_ids, training_rows, fitted_bins)[source]#

Bases: object

Frozen curves with an explicit populated-bin and joint-curve support domain.

Parameters:
  • config (AcceptanceBandConfig)

  • lower_coefficients (FloatArray)

  • center_coefficients (FloatArray)

  • upper_coefficients (FloatArray)

  • power_scale_mwh (float)

  • support_wm2 (tuple[float, float])

  • populated_bin_ids (tuple[int, ...])

  • training_rows (int)

  • fitted_bins (int)

config: AcceptanceBandConfig#
lower_coefficients: FloatArray#
center_coefficients: FloatArray#
upper_coefficients: FloatArray#
power_scale_mwh: float#
support_wm2: tuple[float, float]#
populated_bin_ids: tuple[int, ...]#
training_rows: int#
fitted_bins: int#
to_dict()[source]#

Export portable coefficients with source and support provenance.

Return type:

dict[str, object]

bounds(poa_wm2)[source]#

NaN outside fitted bins or for crossing bounds; never extrapolate or swap.

Parameters:

poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

Return type:

tuple[FloatArray, FloatArray]

mask(poa_wm2, actual_mwh)[source]#

Inclusive physical and band boundaries; unsupported observations fail.

Parameters:
  • poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • actual_mwh (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

Return type:

BoolArray

energy_methods.acceptance_band.fit_acceptance_band(poa_wm2, actual_mwh, config=AcceptanceBandConfig(bin_width_wm2=50.0, irradiance_max_wm2=1300.0, min_samples_per_bin=10, min_supported_bins=7, accuracy_level='low'))[source]#

Fit Gaussian within-bin percentiles and separately trimmed quartic curves.

Supply only the chronological training partition. POA is the published independent variable; substituting GHI is a separate, explicitly labelled scientific adaptation and is not performed here. Hourly interval energy equals mean MW numerically only for one elapsed hour.

Parameters:
  • poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • actual_mwh (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • config (AcceptanceBandConfig)

Return type:

FittedAcceptanceBand

energy_methods.acceptance_band.performance_ratio(actual_mwh, poa_wm2, dc_capacity_mw, interval_hours=1.0)[source]#

E_AC / (P_DC,STC * POA/1000 * hours); caller must qualify DC provenance.

Missing, nonpositive irradiance/capacity/duration or negative energy gives NaN. AC capacity and GHI are not silently substituted.

Parameters:
  • actual_mwh (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • poa_wm2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • dc_capacity_mw (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • interval_hours (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

Return type:

FloatArray

energy_methods.acceptance_band.pr_acceptance_mask(pr, lower=0.5, upper=1.0)[source]#

Inclusive 50-100% gate by default; missing PR is unknown, not accepted.

Parameters:
  • pr (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • lower (float)

  • upper (float)

Return type:

BoolArray