Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orientation: add horizontal single axis tracking #220

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Release Notes
* Due to ambiguity, conversion functions (`.pv(...)`, `.wind(...)` etc.) now raise an `ValueError` if shapes and matrix are given.
* Atlite now supports calculating of heat pump coefficients of performance (https://github.com/PyPSA/atlite/pull/145).
* Enabled the GitHub feature "Cite this repository" to generate a BibTeX file (Added a `CITATION.cff` file to the repository).
* Atlite now supports calculating PV potentials with a Horizontal Single Axis Tracker (HSAT). The method can be activated setting the `orientation="hsat"` in the `pv` conversion function.

**Bug fixes**
* The solar position for ERA5 cutouts is now calculated for half a time step earlier (time-shift by `cutout.dt/2`) to account for the aggregated nature of
Expand Down
24 changes: 24 additions & 0 deletions atlite/pv/orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ def get_orientation(name, **params):
return getattr(sys.modules[__name__], "make_{}".format(name))(**params)


def make_hsat():
"""
Returns a function mimicing a Horizontal Single Axis Tracker (HSAT).

The method sets the east-west tilt of the PV panel perpendicular to the
solar altitude. The axis of rotation is horizontal with respect to the
ground.
"""

def horizontal_tracking(lon, lat, solar_position):

slope = np.pi / 2 - np.abs(solar_position["altitude"])

# South orientation for panels on northern hemisphere and vice versa
azimuth = np.where(solar_position["azimuth"] < np.pi, np.pi / 2, 3 * np.pi / 2)

return dict(
slope=slope,
azimuth=xr.DataArray(azimuth, coords=solar_position["altitude"].coords),
)

return horizontal_tracking


def make_latitude_optimal():
"""
Returns an optimal tilt angle for the given ``lat``, assuming that
Expand Down
11 changes: 11 additions & 0 deletions test/test_preparation_and_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ def pv_test(cutout):
# should be roughly the same
assert (production_other.sum() / production_opt.sum()).round(0) == 1

# now use horizontal tracking
production_hsat = cutout.pv(
atlite.resource.solarpanels.CdTe,
"hsat",
layout=cap_factor_opt,
)

assert production_hsat.sel(time=TIME + " 00:00") == 0
# should be lower since it's winter
assert (production_hsat.sum() / production_opt.sum()) < 1


def csp_test(cutout):
"""
Expand Down