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 %s have a UB Matrix? %s" % (ws,returnVal)

SetUB(ws,1,1,1,90,90,90)
returnVal = HasUB(ws)
print "After SetUB does %s have a UB Matrix? %s" % (ws,returnVal)

#This python call to the workspace gives the same information
returnVal = ws.sample().hasOrientedLattice()
print "Using ws.sample().hasOrientedLattice() does %s have a UB Matrix? %s" % (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: Algorithms | Crystal\UBMatrix

Source

C++ source: HasUB.cpp

C++ header: HasUB.h