Operations with trace headers

It is a common practice in SIA to use trace header values for parameterization of the algorithms. This parameterization approach has several advantages: 

A library of header processing modules is available; it includes mathematical operations, measurements of data parameters, exchange of values with the tables (databases), plotting of graphs stored in header entries. 

The simplest way to retrieve a numerical value from the trace header is to use the function returning a double value: 

value = h.value(trace); 

where h is the trace header, declared as AHEADER h, as usual. A casting, and/or the use of the long function round () may be required to cast the value into the proper format. 

It is often  desirable to have an option of using either a constant or a trace header in the job file parameter field. This option is implemented using the class HEADER_PARAM. To retrieve the value from the header of the trace trace during the Process phase, use: 

value = hp.value(trace); 

where hp is the HEADER_PARAM. This function also returns a result of type double. 

To write a value (of type double or character array) into a header we use methods from AHEADER: 

h.set(trace->header, value);

For examples of reading the names and values of AHEADER or HEADER_PARAM from job files during parameter input, see the description of  Edit Phase.