\(\renewcommand\AA{\unicode{x212B}}\)
ISIS Powder Diffraction Scripts - OSIRIS Reference¶
Creating OSIRIS Object¶
This method assumes you are familiar with A quick introduction to objects
To create a OSIRIS object the following parameters are required:
Optionally a configuration file may be specified if one exists using the following parameter:
See Using configuration files on YAML configuration files for more details
Example¶
from isis_powder.osiris import Osiris
calibration_dir = r"C:\path\to\calibration_dir"
output_dir = r"C:\path\to\output_dir"
config_dir = r"C:\path\to\config.yaml"
osiris_example = Osiris(user_name="Calib",
calibration_directory=calibration_dir,
output_directory=output_dir,
config_file=config_dir)
Methods¶
The following methods can be executed on a OSIRIS object:
For information on creating a OSIRIS object see: Creating OSIRIS Object
create_vanadium¶
The create_vanadium method allows a user to process a vanadium run.
On OSIRIS the following parameters are required when executing create_vanadium:
Example¶
osiris_example.create_vanadium(run_number="119977", subtract_empty_can=False)
focus¶
The focus method allows a user to process a series of runs into a focused dSpace workspace. Whilst processing the runs the scripts can apply any corrections the user enables.
The available corrections are:
empty container subtraction, which can be enabled using subtract_empty_can parameter.
vanadium normalization, which can be enabled using do_van_normalisation parameter.
On OSIRIS the following parameters are required when executing focus:
Example¶
# Notice how the filename ends with .yaml
cal_mapping_file = r"C:\path\to\cal_mapping.yaml"
osiris_example.run_diffraction_focusing(run_number="119977-119988",
merge_drange=True,
subtract_empty_can=True,
vanadium_normalisation=True,
calibration_mapping_file=cal_mapping_file)
Calibration Mapping File¶
The calibration mapping file holds the mapping between run numbers, current label, offset filename, empty can run numbers, and vanadium run numbers.
For more details on the calibration mapping file see: Cycle mapping files
The layout on OSIRIS should look as follows for each block:
11-120:
2 label: "1_1"
3 offset_file_name: "offset_file.cal"
4 vanadium_drange1 : "13"
5 vanadium_drange2 : "14"
6 vanadium_drange3 : "15"
7 vanadium_drange4 : "16"
8 vanadium_drange5 : "17"
9 vanadium_drange6 : "18"
10 vanadium_drange7 : "19"
11 vanadium_drange8 : "20"
12 vanadium_drange9 : "21"
13 vanadium_drange10 : "22"
14 vanadium_drange11 : "23"
15 vanadium_drange12 : "24"
16 vanadium_run_numbers : "13-24"
17 empty_drange1 : "1"
18 empty_drange2 : "2"
19 empty_drange3 : "3"
20 empty_drange4 : "4"
21 empty_drange5 : "5"
22 empty_drange6 : "6"
23 empty_drange7 : "7"
24 empty_drange8 : "8"
25 empty_drange9 : "9"
26 empty_drange10 : "10"
27 empty_drange11 : "11"
28 empty_drange12 : "12"
29 empty_can_run_numbers : "1-12"
For each drange, any empty containers and vanadium runs must be listed with the associated drange.
Parameters¶
The following parameters for OSIRIS are intended for regular use when using the ISIS Powder scripts.
calibration_directory¶
This parameter should be the full path to the calibration folder. Within the folder the following should be present:
Grouping .cal file
Folder(s) with the label name specified in mapping file (e.g. “1_1”) - Inside each folder should be the offset file with name specified in the mapping file
Example Input:
osiris_example = Osiris(calibration_directory=r"C:\path\to\calibration_dir", ...)
calibration_mapping_file¶
This parameter gives the full path to the YAML file containing the calibration mapping. For more details on this file see: Calibration Mapping File
Note: This should be the full path to the file including extension
Example Input:
# Notice the filename always ends in .yaml
osiris_example = Osiris(calibration_mapping_file=r"C:\path\to\file\calibration_mapping.yaml", ...)
config_file¶
The full path to the YAML configuration file. This file is described in detail here: Using configuration files It is recommended to set this parameter at object creation instead of on a method as it will warn if any parameters are overridden in the scripting window.
Note: This should be the full path to the file including extension
Example Input:
# Notice the filename always ends in .yaml
osiris_example = Osiris(config_file=r"C:\path\to\file\configuration.yaml", ...)
do_van_normalisation¶
Indicates whether to divide the focused workspace within focus mode with an associated vanadium run.
Accepted values are: True or False
Example Input:
osiris_example = Osiris(do_van_normalisation=True, ...)
file_ext¶
Optional
Specifies a file extension to use for the focus method.
This should be used to process partial runs. When processing full runs (i.e. completed runs) it should not be specified as Mantid will automatically determine the best extension to use.
Note: A leading dot (.) is not required but is preferred for readability
Example Input:
osiris_example = Osiris(file_ext=".s01", ...)
merge_drange¶
Indicates whether to merge summed workspaces of different dranges after running the focus method.
Accepted values are: True or False
Example Input:
osiris_example = Osiris(merge_drange=True, ...)
output_directory¶
Specifies the path to the output directory to save resulting files into. The script will automatically create a folder with the label determined from the calibration_mapping_file and within that create another folder for the current user_name.
Within this folder processed data will be saved out in several formats.
Example Input:
osiris_example = Osiris(output_directory=r"C:\path\to\output_dir", ...)
run_number¶
Specifies the run number(s) to process when calling the focus method.
This parameter accepts a single value or a range of values with the following syntax:
- : Indicates an inclusive range of runs (e.g. 1-10 would process 1, 2, 3….8, 9, 10)
, : Indicates a gap between runs (e.g. 1, 3, 5, 7 would process run numbers 1, 3, 5, 7)
These can be combined like so: 1-3, 5, 8-10 would process run numbers 1, 2, 3, 5, 8, 9, 10.
In addition the input_mode parameter determines what effect a range of inputs has on the data to be processed
Example Input:
# Process run number 1, 3, 5, 6, 7
osiris_example = Osiris(run_number="1, 3, 5-7", ...)
# Or just a single run
osiris_example = Osiris(run_number=100, ...)
user_name¶
Specifies the name of the current user when creating a new OSIRIS object. This is only used when saving data to sort data into respective user folders.
Example Input:
osiris_example = Osiris(user_name="Mantid", ...)
subtract_empty_can¶
Provides the option to disable subtracting empty canister runs from the run being focused. Set to False to disable empty subtraction.
Example Input:
subtract_empty_can: True
Category: Techniques