Warning: Trying to access array offset on value of type null in /home/site/wwwroot/lib/plugins/move/action/rename.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/actions.php on line 38
include_and_ingest [topas wiki]

User Tools

Site Tools


include_and_ingest

#include and #ingest

The TOPAS #include and #ingest commands let you bring extra information into an INP file. #ingest will be available from TA v8 onwards.

#include FILE_NAME

Putting command “#include FILE_NAME” in an INP file will read any topas instructions in FILE_NAME when you run a refinement. It's useful for storing information that needs to be read, but is not part of a refinement. One example would be putting a long #list of information about a set of datafiles to be analysed in a separate file to keep the INP file readable. Information like fixed instrumental parameters could also be read using #include.

#ingest FILE_NAME

“#ingest FILE_NAME” is similar, but puts the information in the external file directly into the INP file. The information and refined values then get written to the OUT file, and can be analysed or used in subsequent refinements. Thanks to Peter Khalifah for the idea.

The FILE_NAME can also be a macro name. The macro itself can come from the following sources:

  • From TOPAS.INC
  • From the command line, for example type: tc ingest-1.inp “macro Name_Of_Macro { FILE_NAME_CONTAINING_INPTEXT.inc } “
  • From a #include file included at the command line, for example: tc ingest-1.inp “#include SOME_INCLUDE_FILE “

Any macro defined in SOME_INCLUDE_FILE can be used as a FILE_NAME for #ingest.

Macros define in the INP file itself cannot be used as a #ingest FILE_NAME.

Macros used as a FILE_NAME for #ingest can use the internal items:

  • ROOT : Returns the root directory of the program.
  • INP_File : Returns current INP file name without a path or extension.
  • Run_Number : Returns the current run number.
  • File_Can_Open($file) : Returns 1 if $file can be opened or 0 of it can't be opened.

The above means that #ingest can be used with num_rums etc.

Examples will be in test_examples\ingest\.

include_and_ingest.txt · Last modified: 2024/07/20 06:32 by johnsoevans