pyglow
pyglow copied to clipboard
ap, f107 checks in hwm.py
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"?
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.