mcstasscript.instr_reader.read_trace.TraceReader
mcstasscript.instr_reader.read_trace.TraceReader¶
- class mcstasscript.instr_reader.read_trace.TraceReader(Instr, write_file, product_filename, get_next_line, return_line)¶
Reads the trace section of a McStas instrument file. For each component a McStasScript component instance is created and the parameters/keywords are applied to this instance. When the next component is found, the previous component is written to the python file for reproduction of the McStas instrument.
- __init__(Instr, write_file, product_filename, get_next_line, return_line)¶
Methods
__init__
(Instr, write_file, ...)read_trace_line
(line)Reads line of McStas file from TRACE section.
sanitize_line
(line)Removes comments, the starting blok and newline characters
set_instr_name
(name)- read_trace_line(line)¶
Reads line of McStas file from TRACE section. Has the responsibility of setting continue_trace to false when finding the end of the TRACE section. May take extra lines through get_new_line if statements are spaced out over several lines.
- sanitize_line(line)¶
Removes comments, the starting blok and newline characters