8000 Implement reverse transposition using Perez-Driesse forward transposition by adriesse · Pull Request #1907 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Implement reverse transposition using Perez-Driesse forward transposition #1907

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

Merged
merged 28 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
662846e
Add reverse transposition function and two helpers.
adriesse Nov 12, 2023
24772a9
Add missing import.
adriesse Nov 12, 2023
60b103a
Add to docs under transposition until a better place is found/made.
adriesse Nov 12, 2023
2c4e4b9
Minor doc string fixes.
adriesse Nov 12, 2023
9bf9064
Add full_output option similar to newton().
adriesse Nov 13, 2023
1196851
First example for reverse transposition.
adriesse Nov 13, 2023
bf9105a
Second example for reverse transposition.
adriesse Nov 13, 2023
97d4559
Some improvements to the two examples.
adriesse Nov 13, 2023
17b3f3d
Placate flake8.
adriesse Nov 13, 2023
613e70b
Add tests for reverse transpostion.
adriesse Nov 14, 2023
e5025b4
Refine examples and fix test.
adriesse Nov 14, 2023
aaf34ba
Update whatsnew.
adriesse Nov 14, 2023
74f5c06
Refine examples.
adriesse Nov 14, 2023
58e8ded
Try to get rid of matplotlib warning in example.
adriesse Nov 14, 2023
0f35860
Remove unused import.
adriesse Nov 14, 2023< 8000 /relative-time>
6e7ec7b
Update pvlib/irradiance.py
adriesse Nov 27, 2023
8106fcb
Improve examples based on reviews.
adriesse Nov 27, 2023
1c4da53
Settle conflict.
adriesse Nov 27, 2023
1c16709
Try again.
adriesse Nov 27, 2023
69d6288
Merge branch 'main' into rtranspose
adriesse Nov 27, 2023
8d7afa9
Remove one space.
adriesse Nov 27, 2023
d83e306
Merge branch 'main' into rtranspose
adriesse Dec 2, 2023
ae3cdb6
Final(?) changes.
adriesse Dec 2, 2023
d7fb73d
Update reference in erbs_driesse().
adriesse Dec 2, 2023
8021769
Fix links in examples.
adriesse Dec 2, 2023
cbf971b
Update docs/examples/irradiance-transposition/plot_rtranpose_limitati…
adriesse Dec 7, 2023
afcf178
Address review comments.
adriesse Dec 7, 2023
71db4c4
Final renames.
adriesse Dec 12, 2023
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
< 8000 /div>
Prev Previous commit
Next Next commit
Add tests for reverse transpostion.
  • Loading branch information
adriesse committed Nov 14, 2023
commit 613e70b6cc7714f7e2dcb8579b0b298f0425edd3
45 changes: 45 additions & 0 deletions pvlib/tests/test_irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,51 @@ def test_dirint_min_cos_zenith_max_zenith():
assert_series_equal(out, expected, check_less_precise=True)


def test_rtranspose_driesse():
# inputs copied from test_gti_dirint
times = pd.DatetimeIndex(
['2014-06-24T06-0700', '2014-06-24T09-0700', '2014-06-24T12-0700'])
poa_global = np.array([20, 300, 1000])
aoi = np.array([100, 70, 10])
zenith = np.array([80, 45, 20])
azimuth = np.array([90, 135, 180])
surface_tilt = 30
surface_azimuth = 180

# test core function
output = irradiance.rtranspose_driesse_2023(
surface_tilt, surface_azimuth, zenith, azimuth,
poa_global, dni_extra=1366.1)

expected = [22.089, 304.088, 931.143]
assert_allclose(expected, output, atol=0.001)

# test series output
poa_global = pd.Series([20, 300, 1000], index=times)

output = irradiance.rtranspose_driesse_2023(
surface_tilt, surface_azimuth, zenith, azimuth,
poa_global, dni_extra=1366.1)

assert isinstance(output, pd.Series)

# test full_output option and special cases
poa_global = np.array([0, 1500, np.nan])

ghi, conv, niter = irradiance.rtranspose_driesse_2023(
surface_tilt, surface_azimuth, zenith, azimuth,
poa_global, dni_extra=1366.1, full_output=True)

expected = [0, np.nan, np.nan]
assert_allclose(expected, ghi, atol=0.001)

expected = [True, False, False]
assert_allclose(expected, conv)

expected = [0, -1, 0]
assert_allclose(expected, niter)


def test_gti_dirint():
times = pd.DatetimeIndex(
['2014-06-24T06-0700', '2014-06-24T09-0700', '2014-06-24T12-0700'])
Expand Down
0