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

ValueError: Must supply ap for HWM14 #133

Closed
rafaelmesquita1987 opened this issue Nov 26, 2020 · 1 comment
Closed

ValueError: Must supply ap for HWM14 #133

rafaelmesquita1987 opened this issue Nov 26, 2020 · 1 comment

Comments

@rafaelmesquita1987
Copy link

rafaelmesquita1987 commented Nov 26, 2020

Running on Ubuntu, Jupyter Notebook, Python3:

%%%%%%%
def DTtoUNIX(UTC):
import time
SKUNIXTim = []
for i in range(np.size(UTC)):
SKUNIXTim.append(time.mktime(UTC[i].timetuple()))
SKUNIXTim = np.array(SKUNIXTim)
return SKUNIXTim

timestamp = DTtoUNIX([datetime(2015,1,1), datetime(2018,1,1)])
print(timestamp)
timestamps = np.arange(1.4200884e+09,1.5147828e+09,86400*2)
msisalts = np.arange(80,500.1,1)

lat, lon = 0,0
U,V = [],[]
for i in range(np.size(timestamps)):
auxU, auxV=[],[]
dt_object = datetime.fromtimestamp(timestamps[i])
for j in range(np.size(msisalts)):
pt = pyglow.Point(dt_object, lat, lon, msisalts[j])
pt.run_hwm(version=2014)
auxU.append(pt.u)
auxV.append(pt.v)
U.append(auxU)
V.append(auxV)
print(np.shape(U))
%%%%%%%%%%%%%%%%%

I get the error: ValueError: Must supply ap for HWM14

Can't figure out why... Any suggestion?

All indices are up to date. Can't quite understand what's going on...

@bharding512
Copy link
Collaborator

I get the same error. This is issue #121

It will be a simple fix, but in the meantime, a bandaid like this would work for now:

pt = pyglow.Point(dt_object, lat, lon, msisalts[j])
if pt.ap == 0.0:
    pt.ap = -1
pt.run_hwm(version=2014)

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