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

HasUB v1

Summary

Determines whether the workspace has one or more UB Matrix

See Also

SetUB, ClearUB

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

C++ source: HasUB.cpp