TREPEM 2S
Model API name: trepem-2s
TREPEM 2S model.
Version: v1
Model developer:
Model provision:
Model references:
External Input: trajectory
Input | Value |
---|---|
Model result name | trajectory |
Quantity | trajectory |
Input group: trepem2s / multiplicity: one
general
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
electronEnergies | Electron energies. |
note: Array of doubles |
[1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.5, 6.0, 6.5, 7.0] | energy |
IRENE
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
mode | Model mode |
mean=Mean min=Minimum q80=Maximum count=Count |
mean | text |
percentiles | Percentile(s) |
note: Between 1 and 99 min: 1 max: 99 |
[] | number |
|
None
# coding=utf-8
from os import path
import matplotlib.pyplot as plt
from nom_client.nom_client import NoMClient
here = path.abspath(path.dirname(__file__))
plt.rcParams['figure.figsize'] = [15, 10]
plt.rc('font', size=18)
def plot(x_data, y_data, plot_types, line_types, xlabel, ylabel, labels, title):
if not isinstance(plot_types, list):
plot_types = [plot_types] * len(x_data)
if not isinstance(line_types, list):
line_types = [line_types] * len(x_data)
if not isinstance(labels, list):
labels = [labels] * len(x_data)
for data_index in range(len(x_data)):
if plot_types[data_index] == 'loglog':
plt.loglog(x_data[data_index], y_data[data_index], linestyle=line_types[data_index], linewidth=2.0,
markersize=12.0,
label=labels[data_index])
elif plot_types[data_index] == 'semilogy':
plt.semilogy(x_data[data_index], y_data[data_index], linestyle=line_types[data_index], linewidth=2.0,
markersize=12.0,
label=labels[data_index])
elif plot_types[data_index] == 'semilogx':
plt.semilogx(x_data[data_index], y_data[data_index], linestyle=line_types[data_index], linewidth=2.0,
markersize=12.0,
label=labels[data_index])
else:
plt.plot(x_data[data_index], y_data[data_index], linestyle=line_types[data_index], linewidth=2.0,
markersize=12.0,
label=labels[data_index])
plt.title(title, fontsize=18)
plt.grid(True)
plt.legend(bbox_to_anchor=(0.95, 0.95), loc=1, borderaxespad=0.,
fancybox=True, fontsize=18, shadow=True)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.show()
nom_client = NoMClient("TREPEM 2S")
greet_model = nom_client.get_model("trajectory")
greet_model.set_params(orbitSpecificationCode=205, startDate="2020-01-01 00:00:00",
missionDuration=.5, perigeeAltitude=700, apogeeAltitude=7000)
greet_res = nom_client.run_model(greet_model)
print(greet_res)
trepem_2s_model = nom_client.get_model('trepem-2s')
trepem_2s_model.set_external_input(external_input_name="trajectory",
external_input=greet_res['trajectory'])
trepem_2s_model.set_params(mode="q80")
trepem_results = nom_client.run_model(trepem_2s_model)
print(trepem_results)
electron_spectrum_over_trajectory = trepem_results.get_model_result_by_name(result_name="orbit_averaged_electron_spectrum")
energy = electron_spectrum_over_trajectory.get_variable_data(variable_name="energy")
differential_flux = electron_spectrum_over_trajectory.get_variable_data(variable_name="differential_fluence")
print(energy)
print(differential_flux)
plot(energy, differential_flux, plot_types=["loglog"], line_types="solid", xlabel="None", ylabel="None", labels="None", title="title")
No references