Skip to content

raise ValueError when invalid model provided to relativeairmass #119

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 Jan 31, 2016 · 0 comments
Closed

raise ValueError when invalid model provided to relativeairmass #119

wholmgren opened this issue Jan 31, 2016 · 0 comments
Labels
Milestone

Comments

@wholmgren
Copy link
Member

The atmosphere.relativeairmass function currently assumes the 'kastenyoung1989' model if the specified model is invalid. The Python convention for this is to raise a ValueError, and I think that's the right thing to do here too. Since 0.3 is going to break everyone's code anyways, this is a good opportunity to fix this small problem.

    if ...

    elif 'gueymard1993' == model:
        AM = ( 1.0 / (np.cos(zenith_rad) +
            0.00176759*(z)*((94.37515 - z) ** - 1.21563)) )
    else:
        pvl_logger.warning("%s is not a valid model type for relative airmass. The 'kastenyoung1989' model was used.",
                           model)
        AM = ( 1.0 / (np.cos(zenith_rad) +
            0.50572*(((6.07995 + (90 - z)) ** - 1.6364))) )

PRs welcome.

@wholmgren wholmgren added the api label Jan 31, 2016
@wholmgren wholmgren added this to the 0.3 milestone Jan 31, 2016
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

1 participant