Skip to content

Commit

Permalink
remove hard-coded time parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 1, 2018
1 parent b305180 commit 40e24fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions examples/iri_timeprofile.py → examples/TimeProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

""" Time Profile Example """

hrlim = [0, 24]
hrstp = 0.25
lat = -11.95; lon = -76.77
lat = 38; lon = -100
hrlim = [0, 24] # [0,24] does whole day(s)
hrstp = 0.1 # time step [decimal hours]
#lat = -11.95; lon = -76.77
lat = 65; lon = -147.5
alts = arange(100, 200, 10)
sim = IRI2016Profile(hrlim=hrlim, hrstp=hrstp, lat=lat, lon=lon, alt=150.,
option='time', verbose=False, time='2017-08-21')

Expand Down Expand Up @@ -57,11 +58,11 @@
if Nplot > 2:
pn = axs[2]

for alt in arange(100,250,10):
for alt in alts:
sim = IRI2016Profile(hrlim=hrlim, hrstp=hrstp, lat=lat, lon=lon, alt=alt,
option='time', verbose=False, time='2017-08-10')

pn.plot(sim.out.time, sim.out.loc[:,'ne'], label=alt)
pn.plot(sim.out.time, sim.out.loc[:,'ne'], marker='.', label=alt)
pn.set_xlabel('time UTC (hours)')
pn.set_ylabel('[m$^{-3}$]')
pn.set_title(f'$N_e$ vs. altitude and time')
Expand Down
4 changes: 2 additions & 2 deletions pyiri2016/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _RmNeg(self, inputs):
class IRI2016Profile(IRI2016):

def __init__(self, alt=None, altlim=[90.,150.], altstp=2., htecmax=0,
time=datetime.datetime.now(), hrlim=[0., 24.], hrstp=.25,
time=datetime.datetime.now(), hrlim=[0., 24.], hrstp=None,
iut=1, jmag=0,
lat=0., latlim=[-90, 90], latstp=10.,
lon=0., lonlim=[-180,180], lonstp=20.,
Expand Down Expand Up @@ -338,7 +338,7 @@ def HrProfile(self):

t = arange(self.vbeg,self.numstp*self.vstp,self.vstp)

self.out = xarray.DataArray(self.a[:9,:97].T,
self.out = xarray.DataArray(self.a[:9,:t.size].T,
coords={'time':t,
'sim':['ne','Tn','Ti','Te','nO+','nH+','nHe+','nO2+','nNO+']},
dims=['time','sim'])
Expand Down

0 comments on commit 40e24fd

Please sign in to comment.