Skip to content

bug in get_relative_airmass(model='youngirvine1967') #545

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

Closed
wholmgren opened this issue Aug 25, 2018 · 2 comments
Closed

bug in get_relative_airmass(model='youngirvine1967') #545

wholmgren opened this issue Aug 25, 2018 · 2 comments
Labels
Milestone

Comments

@wholmgren
Copy link
Member

Describe the bug
pvlib python implements the Young and Irvine 1967 model as:

    elif 'youngirvine1967' == model:
        am = ((1.0 / np.cos(zenith_rad)) *
              (1 - 0.0012*((1.0 / np.cos(zenith_rad)) ** 2) - 1))

The published formula is

am = sec(z) * (1 - 0.0012 * (sec(z)^2 - 1))

See http://adsbit.harvard.edu/cgi-bin/nph-iarticle_query?bibcode=1967AJ.....72..945Y&db_key=AST&page_ind=3&plate_select=NO&data_type=GIF&type=SCREEN_GIF&classic=YES

If you squint very hard you might notice that pvlib python's implementation is equivalent to

am = sec(z) * (1 - 0.0012 * sec(z)^2 - 1)

Versions:

  • pvlib.__version__: 0.5.2. I probably broke it when cleaning up code in the 0.1-0.2 era.

Additional context
Discovered when implementing #158. Write good unit tests! I'll make a pr with a fix soon.

@cwhanse
Copy link
Member

cwhanse commented Aug 25, 2018

Nice squinting.

@wholmgren
Copy link
Member Author

closed by #546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants