Data reduction script of the SPODI multi-detector data in the ctxt format.
Example of running the script under Linux:
#!/bin/bash
export PATH_SPODI_PARSER=/home/user/opt/SpodiDataParser
# this script is supposed to be run from the script folder
# to correctly identify the location of the correction files
cd ${PATH_SPODI_PARSER}
python3 ./DataParser.py -i ${FOLDER_IN} -o ${FOLDER_OUT}and under Windows:
@echo off
setlocal enabledelayedexpansion
set PATH_SPODI_PARSER=d:\Scripts\SpodiDataParser
REM convert mcstas output to ctxt experimental file
python !PATH_SPODI_PARSER!\WriteCTXTfromMcStas.py !FOLDER_OUT! 9999
cd /d !PATH_SPODI_PARSER!
python DataParser.py -i !FOLDER_IN! -o !FOLDER_OUT!
endlocal-ispecifies the input folder containingctxtfiles,-ospecifies the output path for the integrated data.
Additional flags are
-sfor the sample height (0.04 [m] by default),-ffor input file mask ("run[0-9]*.ctxt"by default).
The program folder also contains the WriteCTXTfromMcStas.py script.
The script parses the output of an McStas simulation, using either the simplified banana- or multi-detector version of the instrument, and converts it to the ctxt format.
The script can be run simply as
python3 WriteCTXTfromMcStas.py ${ROOT_DIR} 9999where the last argument is a normalization factor corresponding to maximum neutron count in the ctxt file.
- function simpson_rule may work slower than the analogue from scipy /check
- calculation of LorentzFactor in MatrixHeightOut
- MatrixHeightOutHB has very STRANGE structure
- summation of sigma
- no Lorenz factor correction