--- myst: substitutions: bloc1: python: 1-5,15-26,28-43,45-49,53 cpp: 1,6-16,20-29,31-46,48-52,56-57 bloc2: python: "20" cpp: "23" bloc3: python: 26,28 cpp: 29,31 bloc4: python: 38-39 cpp: 39,41-42 bloc5: python: 43,45 cpp: 46,48 bloc6: python: 2- cpp: 4- --- (use_cases_macro_dataserver_load_ascii_file_pasture)= # Macro "**dataserverLoadASCIIFilePasture.{{extension}}**" ## Objective The objective of this macro is to load two {{tds}} objects using two different ways: either with an ASCII file `"pasture.dat"` or with a {{doe}}. Then, we evaluate the analytic function `ModelPasture` on this two {{tds}}. The data file `"pasture.dat"` is written in the "Salome-table" format of {{uranie}}: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/references/dataserver/pasture.dat" + "\n" + ":language: none\n" + "```" }} ## Macro {{uranie}} {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} The design `ModelPasture` is defined in a function ````{only} py {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/UserFunctions.C" + "\n" + ":language: cpp\n" + ":lines: 178-184\n" + "```" }} Which is C++ and is loaded thanks to the function `ROOT.gROOT.LoadMacro("UserFunctions.C")`. ```` ````{only} cpp {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/cpp/dataserverLoadASCIIFilePasture.C" + "\n" + ":language: cpp\n" + ":lines: 7-13\n" + "```" }} ```` The first {{tds}} is filled with the ASCII file `"pasture.dat"` through the `fileDataRead` method {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} The design is evaluated with the function `ModelPasture` applied on the input attribute *time*, leading to the output attribute named *yhat*. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} A `TAttribute`, obeying an uniform law on [9;80] is added to the second {{tds}} which is filled with a {{doe}} of 1000 patterns, using the LHS method. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + "```" }} The design is now evaluated with this {{tds}} on the attribute **time2** {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc5[language] + "\n" + "```" }} ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/dataserver/use_cases/" + language + "/pasture.png\n" ":align: center\n" ":name: usecases_dataserverLoadASCIIFilePasture\n" + figure_scale + "\n" "\n" "Graph of the macro `\"dataserverLoadASCIIFilePasture." + extension + "\"`\n" "```" }} ## Console {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/dataserver/use_cases/" + language + "/dataserverLoadASCIIFilePasture_clean.log" + "\n" + ":language: none\n" + ":lines: " + bloc6[language] + "\n" + "```" }}