Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpodiDataParser

Data reduction script of the SPODI multi-detector data in the ctxt format.

How to use

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
  • -i specifies the input folder containing ctxt files,
  • -o specifies the output path for the integrated data.

Additional flags are

  • -s for the sample height (0.04 [m] by default),
  • -f for input file mask ("run[0-9]*.ctxt" by default).

Auxiliary scripts

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} 9999

where the last argument is a normalization factor corresponding to maximum neutron count in the ctxt file.

To Do

  • function simpson_rule may work slower than the analogue from scipy /check
  • calculation of LorentzFactor in MatrixHeightOut
  • MatrixHeightOutHB has very STRANGE structure

Bugs:

  • summation of sigma
  • no Lorenz factor correction

About

Data reduction from the SPODI instrument

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages