\(\renewcommand\AA{\unicode{x212B}}\)

HasUB v1

../_images/HasUB-v1_dlg.png

HasUB dialog.

Summary

Determines whether the workspace has one or more UB Matrix

Properties

Name Direction Type Default Description
Workspace Input Workspace Mandatory Workspace to clear the UB from.
HasUB Output boolean   Indicates action performed, or predicted to perform if DryRun.

Description

Determine if a workspace has a UB matrix on any of it’s samples. Returns True if one is found. Returns false if none can be found, or if the workspace type is incompatible.

Usage

Example

# create histogram workspace
ws=CreateSampleWorkspace()

returnVal = HasUB(ws)
print('Before SetUB does {} have a UB Matrix? {}'.format(ws,returnVal))

SetUB(ws,1,1,1,90,90,90)
returnVal = HasUB(ws)
print('After SetUB does {} have a UB Matrix? {}'.format(ws,returnVal))

#This python call to the workspace gives the same information
returnVal = ws.sample().hasOrientedLattice()
print('Using ws.sample().hasOrientedLattice() does {} have a UB Matrix? {}'.format(ws,returnVal))

Output:

Before SetUB does ws have a UB Matrix? False
After SetUB does ws have a UB Matrix? True
Using ws.sample().hasOrientedLattice() does ws have a UB Matrix? True

Categories: AlgorithmIndex | Crystal\UBMatrix

Source

C++ header: HasUB.h (last modified: 2021-03-31)

C++ source: HasUB.cpp (last modified: 2021-03-31)