Skip to content

Commit

Permalink
fixed time profile too
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 30, 2018
1 parent 95082c2 commit 2720d13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/TimeProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
fig = figure(figsize=(16,6))
axs = fig.subplots(1,2).ravel()

fig.suptitle(f'{np.datetime_as_string(sim.time[0])[:-13]} to {np.datetime_as_string(sim.time[-1])[:-13]}\n Glat, Glon: {sim.attrs["glat"]}, {sim.attrs["glon"]}')
fig.suptitle(f'{str(sim.time[0].values)[:-13]} to {str(sim.time[-1].values)[:-13]}\n Glat, Glon: {sim.glat}, {sim.glon}')

ax = axs[0]
#NmF1 = pyiri2016.IRI2016()._RmNeg(sim.b[2, :])
Expand Down
14 changes: 7 additions & 7 deletions pyiri2016/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ def IRI( time, altkm, glat, glon, ap=None, f107=None, ssn=None, var=None):
proot/'data/')

# %% collect output
dsf = {k: ('alt_km',v) for (k,v) in zip(simout, outf[:9,:])}
dsf = {k: (('time','alt_km'),np.atleast_2d(v)) for (k,v) in zip(simout, outf[:9,:])}

iri = xarray.Dataset(dsf,
coords={'alt_km':altkm},
coords={'time':[time],'alt_km':altkm},
attrs={'f107':oarr[40], 'ap':oarr[50],
'glat':glat,'glon':glon,'time':time,
'NmF2':oarr[0], 'hmF2':oarr[1],
Expand Down Expand Up @@ -189,11 +189,11 @@ def timeprofile(tlim:tuple, dt:timedelta,
B0.append(iri.B0)

iono.attrs = iri.attrs
iono.f107 = f107
iono.ap = ap
iono.NmF2 = NmF2
iono.hmF2 = hmF2
iono.B0 = B0
iono.attrs['f107'] = f107
iono.attrs['ap'] = ap
iono.attrs['NmF2'] = NmF2
iono.attrs['hmF2'] = hmF2
iono.attrs['B0'] = B0

return iono

Expand Down

0 comments on commit 2720d13

Please sign in to comment.