The AURIC environment is handled through AURICManager
. It will assume that you either have an AURIC_ROOT
environment variable or that you keep auric in ~/auric
. If this is not the case or you want to run use another dierctory as the root, pass it as an argument.
In [1]:
import pyauric
auric = pyauric.AURICManager()
# reset the parameters to a default setting
with open(auric.pathto('param.inp'),'w') as f:
f.writelines(pyauric._param_format)
pyauric
can be used to set the input parameters for an AURIC batch run, which end up in the various .inp
files. For example, here are some example parameters which produce a nightglow batch run.
In [2]:
print("AURIC input parameters:\n")
for line in auric.params.items():
print(" ",line)
auric.runbatch();
print("\n\nLines computed in AURIC batch run:\n")
print(" ",auric.load("dayglo.ver").columns)
In [3]:
auric.set_params({"UTSEC":0*3600})
print(auric.params['UTSEC'])
In order to compute the derived parameters, use auric.run_geoparm
. It takes an argument to tell it whether to compute F10.7 and Ap or to leave whatever is already in param.inp
alone. This allows the user to manually specify F10.7 or Ap.
In [4]:
print(auric.params['F10AVE'], auric.params['AP(1)'])
auric.run_geoparm(True)
print(auric.params['F10AVE'], auric.params['AP(1)'])
Running the batch script again will produce dayglow instead.
In [5]:
auric.runbatch();
print("Lines computed in AURIC batch run:")
print(" ",auric.load("niteglo.ver").columns)
In [6]:
ni = auric.load("niteglo.int")
nv = auric.load("niteglo.ver")
Data loaded in this way will define a title and ylabel for plotting.
In [7]:
%matplotlib inline
import matplotlib.pyplot as plt
def outside_legend(ax):
return ax.legend(loc='center right', bbox_to_anchor=(1.7, 0.5))
nv.plot()
lgd = outside_legend(plt.gca())
plt.yscale('log')
plt.title(nv.title)
plt.ylabel(nv.ylabel);
We can use list comprehensions to pick out different types features to look at.
In [8]:
herzberg = [ c for c in nv.columns if "Herzberg" in c ]
nv[herzberg].plot()
plt.yscale('log')
outside_legend(plt.gca())
plt.ylabel(nv.ylabel)
plt.title("O2 Herzberg lines");
thin_O = [ c for c in nv.columns if "O2" not in c and "final" not in c ]
nv[thin_O].plot()
plt.yscale('log')
outside_legend(plt.gca())
plt.ylabel(nv.ylabel)
plt.title("Optically thin atomic oxygen nightglow");
In [ ]: