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

CheckForSampleLogs v1

Summary

Check if the workspace has some given sample logs

See Also

CompareSampleLogs, CopyLogs

Properties

Name

Direction

Type

Default

Description

Workspace

Input

Workspace

Mandatory

The workspace to check.

LogNames

Input

string

Names of the logs to look for

Result

Output

string

Description

Check if the workspace has some given sample logs. An empty string will be returned if all the logs are found, otherwise the result is an error message

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.

#load a workspace with logs
ws=Load("CNCS_7860")

sampleLogs="Phase1,Phase3"
result=CheckForSampleLogs(ws,sampleLogs)
if len(result)==0:
    print("We found logs for {}".format(sampleLogs))
sampleLogs="DJIA"
result=CheckForSampleLogs(ws,sampleLogs)
print(result.strip())

Output:

We found logs for Phase1,Phase3
Property DJIA not found

Categories: AlgorithmIndex | Utility\Workspaces

Source

Python: CheckForSampleLogs.py