-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem? Please describe.
The wvm() function in pvlib.scaling can produce negative or unrealistically large clear-sky index values as a result of wavelet reconstruction. While this behavior is mathematically expected, such values are physically non-meaningful and can cause issues when the output is used directly in irradiance or PV power modeling workflows. Currently, users must manually post-process the output to enforce physical bounds.
Describe the solution you'd like
Add an optional output bounding (clipping) capability to wvm(), allowing users to constrain the smoothed clear-sky index to physically meaningful limits. For example, optional parameters such as clip, clip_min, and clip_max could be provided, with default behavior remaining unchanged to preserve backward compatibility.
Describe alternatives you've considered
Manually clipping the output of wvm() in user code before passing it to downstream models. While this works, it leads to duplicated logic across projects and inconsistent handling of physical bounds.
Additional context
Wavelet-based reconstruction methods are known to overshoot, and bounding is commonly applied as a post-processing step in PV modeling workflows. Providing this option directly in wvm() would improve usability while maintaining mathematical correctness and backward compatibility.