Model discovery
You can find out what models are available on a particular server by going to the servers model pages, e.g.
To find out what models are available on a particular server you can use the list_models method.
This will list the models registered on a particular server.
list_models method:
Parameter | Optional / default | Comment |
---|---|---|
server_id | Yes / âdefaultâ | A particular server ID |
categories | Yes | Array of category strings |
keywords | Yes | Array of keyword strings |
The categories and keywords for the models are documented in the model specifications and the model webpage on the particular server.
Example:
""" List the models available on a particular server """
""" Models containing keyword 'radiation' """
with_keyword_radiation = nom_client.list_models(server_id="local_server", keywords=["radiation"])
""" Models containing keyword 'trapped' """
with_keyword_trapped = nom_client.list_models(server_id="local_server", keywords=["trapped"])
""" Models containing keyword 'radiation' OR 'trapped' """
with_keyword_radiation_or_trapped = nom_client.list_models(server_id="local_server", keywords=["radiation", "trapped"])
""" Models containing keyword 'radiation' AND 'trapped' """
with_keyword_radiation_and_trapped = with_keyword_radiation.keys() & with_keyword_trapped.keys()
print(with_keyword_radiation_and_trapped)
The has_model method can be used determine if a particular model is registered on a server:
has_model method:
Parameter | Optional / default | Comment |
---|---|---|
model_name | No | The name of the model as specified in the model specification |
server_id | Yes / âdefaultâ | A particular server ID |
Returns boolean depending upon the existence of the model on the specified server.
Example:
has_sapre_model = nom_client.has_model(model_name="sapre")
if has_sapre_model:
sapre_model = nom_client.get_model(model_name="sapre")
You can explore individual models to determine their inputs etc:
# Explore the NIEL model
# List the model inputs and their defaults
niel_model = nom_client.get_model(model_name='niel')
print(niel_model.describe_inputs())
>> ----------------------------------------
>> Input: shieldThicknessUnits
>> Valid values: mils=0,g cm-2=1,mm=2
>> Default: 2
>> ----------------------------------------
>> Input: relativeDegradation
>> Valid values: {'min': 1e-15, 'max': 1e-05}
>> Default: 3.9e-11
>> ----------------------------------------
>> Input: equivalentProtonEnergy
>> Valid values: {'min': 0.1, 'max': 200.0}
>> Default: 10.0
>> ----------------------------------------
>> Input: damageCurve
>> Valid values: JPL Si=1,Dale Si=2,Akkerman Si=3,Huhtinen Si=4,Summers Si (21 MeV)=5,Summers Si (12.9 MeV)=6,Summers GaAs=7,Summers InP=8,Messenger Si=9,Messenger GaAs=10,Messenger InP=11
>> Default: 1
...
# This information can be used to set the model parameters, e.g. set the damageCurve to Huhtinen Si
niel_model.set_params(damageCurve=4)
# The NIEL model requires some external inputs to be satisfied before we can run it. We can print out the details of the required external inputs.
# For details on NoM modle inputs please see the Configuring models documentation page
pprint(niel_model.get_external_inputs())
>> {'gcrSpectrum': {'input_type': 'external',
>> 'model_name': ['iso_15390',
>> 'creme-86-gcr',
>> 'creme-96-gcr',
>> 'nymmik-96-gcr'],
>> 'name': 'gcrSpectrum',
>> 'quantity': 'energy_flux_spectrum'},
>> 'solarParticleSpectrum': {'input_type': 'external',
>> 'model_name': ['creme-86-sep',
>> 'creme-96-sep',
>> 'esp-psychic-total-fluence',
>> 'sapphire-1-in-n-event-fluence',
>> 'sapphire-worst-event-fluence',
>> 'sapphire-total-fluence',
>> 'sep-spectrum-ud'],
>> 'name': 'solarParticleSpectrum',
>> 'quantity': 'energy_fluence_spectrum'},
>> 'trappedParticleSpectrum': {'description': 'The trapped particle spectra '
>> '(optional)',
>> 'input_type': 'external',
>> 'model_name': ['ae8ap8',
>> 'trapped-spectrum-ud',
>> 'irene',
>> 'jorem-trapped'],
>> 'name': 'trappedParticleSpectrum',
>> 'quantity': 'energy_flux_spectrum'}}
This indicates that the NIEL model requires 3 external inputs in addition to the model parameters.
More information can found in the Configuring models page.