User-defined trapped particle spectrum
Model API name: trapped-spectrum-ud
User-defined trapped particle spectrum.
Version: v1
Category: model/environment/radiation/trapped
Keywords: radiation, trapped, proton, electron, user-defined
Input group: trapped_userdefined / multiplicity: one
Input | Description | Valid values | Default | Quantity |
---|---|---|---|---|
trajectoryDuration | Form of the proton spectrum. |
|
365 | text |
protonSpectrumForm | Form of the proton spectrum. |
user_table=User table |
user_table | text |
protonEnergies | Vector of proton energies |
|
[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 |
electronEnergies | Vector of electron energies |
|
[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 |
differentialProtonData | Differential flux data [nrows == number of energies, ncols == number of species] |
|
[] | number_flux |
differentialElectronData | Differential flux data [nrows == number of energies, ncols == number of species] |
|
[] | number_flux |
integralProtonData | Integral flux data [nrows == number of energies, ncols == number of species] |
|
[] | number_flux |
integralElectronData | Integral flux data [nrows == number of energies, ncols == number of species] |
|
[] | number_flux |
|
None
# coding=utf-8
import matplotlib.pyplot as plt
from nom_client.nom_client import NoMClient
nom_client = NoMClient("trapped-user-defined-spectrum", default_server_id="ext_rest_server")
sapre_model = nom_client.get_model('sapre')
sapre_model.set_params(missionDuration=100, missionDurationUnits=1)
sapre_result = nom_client.run_model(model=sapre_model)
ae8ap8_model = nom_client.get_model('ae8ap8')
ae8ap8_model.set_external_input(external_input_name="trajectory", external_input=sapre_result)
ae8ap8_results = nom_client.run_model(ae8ap8_model)
print(ae8ap8_results)
proton_res = ae8ap8_results['orbit_averaged_proton_spectrum']
proton_energies = proton_res['energy'].values
proton_integral_fluence = proton_res['integral_flux'].values
proton_differential_fluence = proton_res['differential_flux'].values
electron_res = ae8ap8_results['orbit_averaged_electron_spectrum']
electron_energies = electron_res['energy'].values
electron_integral_fluence = electron_res['integral_flux'].values
electron_differential_fluence = electron_res['differential_flux'].values
ud_trapped_model = nom_client.get_model('trapped-spectrum-ud')
ud_trapped_model.set_params(protonEnergies=proton_energies.squeeze(),
integralProtonData=proton_integral_fluence.squeeze(),
differentialProtonData=proton_differential_fluence.squeeze(),
electronEnergies=electron_energies.squeeze(),
integralElectronData=electron_integral_fluence.squeeze(),
differentialElectronData=electron_differential_fluence.squeeze(),
trajectoryDuration=100)
ud_trapped_results = nom_client.run_model(ud_trapped_model)
print(ud_trapped_results)
sd_model = nom_client.get_model('sd2')
sd_model.set_external_input(external_input_name="trappedParticleSpectrum", external_input=ae8ap8_results)
sd_result = nom_client.run_model(sd_model)
print(sd_result)
sd2_model = nom_client.get_model('sd2')
sd2_model.set_external_input(external_input_name="trappedParticleSpectrum", external_input=ud_trapped_results)
sd2_result = nom_client.run_model(sd2_model)
print(sd2_result)
eqflux_model = nom_client.get_model('eqflux')
eqflux_model.set_external_input(external_input_name="trappedParticleSpectrum",
external_input=ud_trapped_results)
eqflux_result = nom_client.run_model(eqflux_model)
print(eqflux_result)
depth1 = sd_result['dose_depth_curve'].get_variable_data(variable_name="thickness")
dose1 = sd_result['dose_depth_curve'].get_variable_data(variable_name="absorbed_dose")
depth2 = sd2_result['dose_depth_curve'].get_variable_data(variable_name="thickness")
dose2 = sd2_result['dose_depth_curve'].get_variable_data(variable_name="absorbed_dose")
plt.rcParams['figure.figsize'] = [15, 10]
plt.rc('font', size=18)
plt.semilogy(depth1.T, dose1[0], linewidth=2.0, markersize=12.0, label='SPENVIS models')
plt.semilogy(depth1.T, dose2[0], linewidth=2.0, markersize=12.0, label='User defined')
plt.title('Trapped Dose depth', 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("Thickness (mm Al)")
plt.ylabel("Dose (rad(Si))")
plt.show()
No references