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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
include_and_ingest [2024/07/19 11:06] – created johnsoevansinclude_and_ingest [2024/07/20 06:32] (current) johnsoevans
Line 2: Line 2:
 The TOPAS #include and #ingest commands let you bring extra information into an INP file.  #ingest will be available from TA v8 onwards. The TOPAS #include and #ingest commands let you bring extra information into an INP file.  #ingest will be available from TA v8 onwards.
  
-Putting command "#include filename.inc" will include any topas instructions in filename.inc 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 #list of information about a set of datafiles to be analysed in a separate file.  Information like fixed instrumental parameters could also be read using #include.+<code topas>#include FILE_NAME</code> 
 +Putting command "#include FILE_NAMEin 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 is similar, but reads information from an external file into the INP file.  Any refined values then get included in the OUT file, and can be analysed or used in subsequent refinements.+<code topas>#ingest FILE_NAME</code> 
 +"#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.1721387202.txt.gz · Last modified: 2024/07/19 11:06 by johnsoevans