TREP
Model API name: trep
TREP grouped trapped radiation models
Version: v1
Category: model/environment/radiation/trapped
Keywords: radiation, trapped, proton, electron
External Input: trajectory
Trajectory data.
Input | Value |
---|---|
Model name |
sapre
sapre_upload
|
trajectory
|
Model result name | trajectory |
Quantity | trajectory |
Input group: trep / multiplicity: one
Proton model
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
trappedProtonModel |
Trapped proton model
This selects the main trapped proton model |
1=AP-8 2=CRRESPRO 3=SAMPEX/PET |
1 | number |
trappedProtonSubModel |
Solar maximum or solar minimum model
Used if trappedProtonModel==1 |
1=AP-8 MAX 2=AP-8 MIN |
2 | number |
protonEnergies | Proton energies array (of length 'numberProtonEnergies') in MeV |
min: 1 max: unbounded |
[0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 100.0, 150.0, 200.0, 300.0, 400.0, 500.0] | energy |
numberProtonEnergies | Number of proton energies in 'protonEnergies' |
min: 1 max: unbounded |
30 | number |
protonThresholdFlux | Flux thresholds for protons |
min: 1 max: 1000 |
1.0 | number |
Electron model
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
trappedElectronModel | Trapped electron model |
1=AE-8 2=AE-8MIN Update ESA-SEE1 3=CRRESELE 4=IGE-2006/POLE |
1 | number |
CRRESELESubModel |
CRRESELE sub-model
Used if trappedElectronModel==3 |
1=Ap 5.0-7.5 2=Ap 7.5-10 3=Ap 10-15 4=Ap 15-20 5=Ap 20-25 6=Ap 25-55 7=Average Flux 8=Maximum Flux |
7 | number |
AE8SubModel |
AE-8 sub-model
Used if trappedElectronModel==1 |
1=AE-8 MAX 2=AE-8 MIN |
1 | number |
IGESubModel |
IGE-2006/POLE sub-model
Used if trappedElectronModel==4 |
2=POLE-V1 3=POLE-V2 1=IGE-2006 |
1 | number |
IGECase |
IGE-2006/POLE case
Used if trappedElectronModel==4 |
1=Lower 2=Mean 3=Upper |
3 | number |
electronEnergies |
Electron energies
Number of energies must equal numberElectronEnergies (NENERE) |
min: 0 max: unbounded |
[0.04, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 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 |
numberElectronEnergies | Electron energies (MeV) |
min: 1 max: unbounded |
30 | number |
electronThresholdFlux | Flux thresholds for electrons |
min: 0 max: 1000 |
1.0 | number |
General
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
includeLocalTimeVariation | Include local time variation |
1=Yes 0=No |
0 | number |
|
None
Model example
import matplotlib.pyplot as plt
from nom_client.nom_client import NoMClient
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("TREP model example", default_server_id="ext_rest_server")
sapre_model = nom_client.get_model('sapre')
sapre_model.set_params(orbitType="GEN")
sapre_result = nom_client.run_model(sapre_model)
print("Running trapped model")
trep_model = nom_client.get_model('trep')
trep_model.set_params(trappedProtonModel=1, trappedElectronModel=1)
trep_model.set_external_input(external_input_name="trajectory", external_input=sapre_result)
trep_results = nom_client.run_model(trep_model)
print(trep_results)
energy1_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="energy")
int_flux1_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="integral_flux")
diff_flux1_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="differential_flux")
print("Running trapped model")
trep_model = nom_client.get_model('trep')
trep_model.set_params(trappedProtonModel=2, trappedElectronModel=1)
trep_model.set_external_input(external_input_name="trajectory", external_input=sapre_result)
trep_results = nom_client.run_model(trep_model)
print(trep_results)
energy2_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="energy")
int_flux2_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="integral_flux")
diff_flux2_ax8 = trep_results['orbit_averaged_proton_spectrum'].get_variable_data(variable_name="differential_flux")
plot(x_data=[energy1_ax8.T, energy2_ax8.T],
y_data=[diff_flux1_ax8.T, diff_flux2_ax8.T],
plot_types="loglog",line_types="solid",xlabel="Energy (MeV)",
ylabel=f"Differential flux ()",
labels=['AP8', 's'], title="AP8")
Model references
No references