\(\renewcommand\AA{\unicode{x212B}}\)
Extracting Algorithm PropertiesΒΆ
After an algorithm has been executed, the properties remain accessible for as long as the output workspace exists. Algorithms return their output properties as a tuple, which python can unpack automatically, for example:
sample = Load('MAR11015.raw')
ei, mon_peak, mon_index, tzero = GetEi(sample, Monitor1Spec=2,Monitor2Spec=3,EnergyEstimate=12)
sample = ConvertUnits(sample, Target='DeltaE', Emode='Direct',EFixed=ei)
To access input properties, use the workspace history. Using this handle allows the properties to be extracted by their name using the getPropertyValue() function:
sample = Load('MAR11015.raw')
algorithm = sample.getHistory().lastAlgorithm()
filename = algorithm.getPropertyValue("Filename")
For some algorithms, such as Rebin v1, you can get properties without accessing algorithm history.
rebin_alg = Rebin('input_ws',Params='1,5,100')
params = rebin_alg.getProperty('Params').value