Skip to content

raise ValueError when invalid model provided to relativeairmass #119

Closed

Description

@wholmgren

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.

Activity

  1. added this to the milestone on Jan 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions