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

ap, f107 checks in hwm.py #121

Open
grawe opened this issue Oct 9, 2019 · 1 comment
Open

ap, f107 checks in hwm.py #121

grawe opened this issue Oct 9, 2019 · 1 comment

Comments

@grawe
Copy link

grawe commented Oct 9, 2019

In the ap / f017 parameter checking inside of the run function (hwm.py), e.g.,

    # HWM14:
    elif version == 2014:
        if not ap:
            raise ValueError(
                "Must supply ap for HWM14"
            )
        self._run_hwm14(location_time, ap)

the checks are done using 'if not ap', etc. Since "not 0.0" is True in Python, won't this lead to erroneous raises when, for example, ap = 0.0? Would it be better to use "if ap is None"?

@bharding512
Copy link
Collaborator

Agreed on "if ap is None" or maybe something that includes nan like np.isfinite().

I thought I had always implemented pure HWM (i.e., not including DWM) in my code by setting ap=0.0. Maybe I'm remembering that incorrectly. Unfortunately there's a large blackout in the bay area right now and all of our servers are offline so I can't check.

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

No branches or pull requests

2 participants