The Experiment Handler Reference
- class neutronbraggedge.experiment_handler.experiment.Experiment(tof=None, lambda_array=None, distance_source_detector_m=None, detector_offset_micros=None)[source]
Class that allows: - convert the TOF scale into Lambda - distance source - detector - detector time offset
Arguments: * tof: tof array in s * lambda_array: mandatory only if detector_offset or distance_source_detector are unknown * distance_source_detector: mandatory only if lambda is the unknown parameter (m) * detector_offset: mandatory only if lambda is the unknown parameter (micros)
- Parameters:
- __init__(tof=None, lambda_array=None, distance_source_detector_m=None, detector_offset_micros=None)[source]
- calculate_distance_source_detector()[source]
return the distance source detector
If lambda_array and tof_array are provided, the distance is calculated Otherwise, the distance_source_detector must be provided
- Return type:
None
- calculate_detector_offset()[source]
return the detector time offset value
If lambda_array and tof_array are provided, the offset is calculated Otherwise, the detector_offset argument must be provided
- Return type:
None
- class neutronbraggedge.experiment_handler.tof.TOF(filename=None, tof_array=None, units='s')[source]
This class handles the loading of the TOF and the automatic conversion to ‘s’
- Parameters:
- __init__(filename=None, tof_array=None, units='s')[source]
Constructor of the TOF class
Arguments: * filename: optional input file name. If file exist, data will be automatically loaded (only CSV file is supported so far)
- example: file_tof.txt
#first row of the file 1.0 34 2.2 31 3.4 5 4.5 10 5.6 22 …
- or #first column, second column
1.0,34 2.2,31 3.4,5 4.5,10 5.6,22 …
tof_array: optional tof array. This argument will be ignored if filename is not None
units: optional units of the input tof array (default to ‘seconds’)
Raises: * ValueError: - input file provided as the wrong format
neither input file and tof_array are provided
IOError: - file does not exist
- class neutronbraggedge.experiment_handler.lambda_wavelength.LambdaWavelength(filename=None, data=None)[source]
This class handles the loading of the Lambda
- Parameters:
filename (str)
data (ArrayLike | None)
- __init__(filename=None, data=None)[source]
Constructor of the LambdaWavelength class
Arguments: * filename: optional input file name if data array is provided If file exist, data will be automatically loaded (only CSV file is supported so far)
- example: file_lambda.txt
#first row of the file 1. 2. 3. 4. 5.
data: optional if filename name provided. Array of lambda
Raises: * ValueError: - input file provided as the wrong format
neither input file and tof_array are provided
IOError: - file does not exist
- Parameters:
filename (str | None)
data (ArrayLike | None)
- Return type:
None