GRAS
Model API name: gras
GEANT4 Radiation Analysis Software (GRAS)
Version: v1
Model example
# coding=utf-8
import json
from os import path
from pathlib import Path
from nom_client.nom_client import NoMClient
_here = path.abspath(path.dirname(__file__))
with Path(_here + "/test/test1.g4mac").open() as f:
macro_str = f.read()
with Path(_here + "/test/test1_source_ar36_95mev.g4mac").open() as f:
aux_macro_str1 = f.read()
with Path(_here + "/test/test1_analysis.g4mac").open() as f:
aux_macro_str2 = f.read()
with Path(_here + "/test/mainfile.gdml").open() as f:
aux_gdml_mainFile = f.read()
with Path(_here + "/test/28nm.gdml").open() as f:
aux_gdml_str1 = f.read()
with Path(_here + "/test/defines.txt").open() as f:
aux_gdml_str2 = f.read()
with Path(_here + "/test/elements.txt").open() as f:
aux_gdml_str3 = f.read()
with Path(_here + "/test/isotopes.txt").open() as f:
aux_gdml_str4 = f.read()
with Path(_here + "/test/materials.txt").open() as f:
aux_gdml_str5 = f.read()
with Path(_here + "/test/solids.txt").open() as f:
aux_gdml_str6 = f.read()
with Path(_here + "/test/volumes.txt").open() as f:
aux_gdml_str7 = f.read()
with Path(_here + "/test/world.txt").open() as f:
aux_gdml_str8 = f.read()
nom_client = NoMClient(project_name="GRAS example", client_configuration=conf,
default_server_id="ext_dev_rest_server")
gras_model = nom_client.get_model('gras')
gras_model.set_params(
macro=json.dumps({"test1.g4mac": macro_str}),
aux_files=json.dumps({"test1_source_ar36_95mev.g4mac": aux_macro_str1,
"test1_analysis.g4mac": aux_macro_str2,
"mainfile.gdml": aux_gdml_mainFile,
"28nm.gdml": aux_gdml_str1,
"defines.gdml": aux_gdml_str2,
"elements.gdml": aux_gdml_str3,
"isotopes.gdml": aux_gdml_str4,
"materials.gdml": aux_gdml_str5,
"solids.gdml": aux_gdml_str6,
"volumes.gdml": aux_gdml_str7,
"world.gdml": aux_gdml_str8
})
)
gras_result = nom_client.run_model(gras_model)
print(gras_result)
print(gras_result.file_outputs.keys())
nom_client.write_output_files("gras",
file_key=None,
location=_here)
Model references
No references