diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 773d45f8..098cf386 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -8,9 +8,10 @@ Release Notes ############# +Upcoming Release +================ -.. Upcoming Release -.. ================ +* Added solar tracking support for irradiation; e.g. ``cutout.irradiation(tracking='horizontal')``. Version 0.2.12 diff --git a/atlite/convert.py b/atlite/convert.py index d275843d..f1155686 100644 --- a/atlite/convert.py +++ b/atlite/convert.py @@ -554,23 +554,34 @@ def wind(cutout, turbine, smooth=False, add_cutout_windspeed=False, **params): # irradiation def convert_irradiation( - ds, orientation, irradiation="total", trigon_model="simple", clearsky_model=None + ds, + orientation, + tracking=None, + irradiation="total", + trigon_model="simple", + clearsky_model="simple", ): solar_position = SolarPosition(ds) - surface_orientation = SurfaceOrientation(ds, solar_position, orientation) + surface_orientation = SurfaceOrientation(ds, solar_position, orientation, tracking) irradiation = TiltedIrradiation( ds, solar_position, surface_orientation, trigon_model=trigon_model, clearsky_model=clearsky_model, + tracking=tracking, irradiation=irradiation, ) return irradiation def irradiation( - cutout, orientation, irradiation="total", clearsky_model=None, **params + cutout, + orientation, + irradiation="total", + tracking=None, + clearsky_model=None, + **params, ): """ Calculate the total, direct, diffuse, or ground irradiation on a tilted @@ -579,12 +590,11 @@ def irradiation( Parameters ---------- orientation : str, dict or callback - Surface orientation, e.g. a constant orientation {'slope': 0.0, - 'azimuth': 0.0}. However, 'latitude_optimal' or a callback function - with the same signature as the callbacks generated by the - 'atlite.pv.orientation.make_*' functions are also supported, - similar to the PV functions, although don't make much sense in this - context. + Panel orientation can be chosen from either + 'latitude_optimal', a constant orientation {'slope': 0.0, + 'azimuth': 0.0} or a callback function with the same signature + as the callbacks generated by the + 'atlite.pv.orientation.make_*' functions. irradiation : str The irradiation quantity to be returned. Defaults to "total" for total combined irradiation. Other options include "direct" for direct irradiation, @@ -592,13 +602,17 @@ def irradiation( by the ground via albedo. NOTE: "ground" irradiation is not calculated by all `trigon_model` options in the `convert_irradiation` method, so use with caution! + tracking : None or str: + None for no tracking, default + 'horizontal' for 1-axis horizontal tracking + 'tilted_horizontal' for 1-axis horizontal tracking with tilted axis + 'vertical' for 1-axis vertical tracking + 'dual' for 2-axis tracking clearsky_model : str or None Either the 'simple' or the 'enhanced' Reindl clearsky model. The default choice of None will choose dependending on data availability, since the 'enhanced' model also incorporates ambient air temperature and relative humidity. - NOTE: this option is only used if the used climate dataset - doesn't provide direct and diffuse irradiation separately! Returns ------- @@ -622,6 +636,7 @@ def irradiation( return cutout.convert_and_aggregate( convert_func=convert_irradiation, orientation=orientation, + tracking=tracking, irradiation=irradiation, clearsky_model=clearsky_model, **params,