LoadLogPropertyTable v1

../_images/LoadLogPropertyTable-v1_dlg.png

LoadLogPropertyTable dialog.

Summary

Creates a table of Run number against the log values for that run for a range of files. It can use a single log value or a list of log values.

Properties

Name Direction Type Default Description
FirstFile Input string Mandatory The first file to load from. Allowed values: [‘nxs’, ‘raw’]
LastFile Input string Mandatory The Last file to load from, must be in the same directory, all files in between will also be used. Allowed values: [‘nxs’, ‘raw’]
LogNames Input str list   The comma seperated list of properties to include. The full list will be printed if an invalid value is used.
OutputWorkspace Output Workspace Mandatory Table of results

Description

Creates a table workspace of the average values of log values against the run number.

There are special cases for:

  • beamlog_(counts, frames, etc): last few points end up in next run’s log. Find Maximum.
  • comment (separate function)
  • time series, take average for t>0 (if available)

It should:

  1. Load any file type that Load v1 can handle.
  2. Not crash with multiperiod data - although values will be from period 1
  3. Handle gaps in the file structure (although this can be slow over a network if you choose a range of 100s)
  4. Load only a single spectra of the data (if the file loader supports this).
  5. Print out the list of acceptable log names if one is entered incorrectly.
  6. Use a hidden workspace for the temporary loaded workspaces, and clean up after itself.

Usage

Example:

def print_table_workspace(wsOut):
    print(" ".join(wsOut.getColumnNames()[i]
          for i in range(wsOut.columnCount())))

    for rowIndex in range(wsOut.columnCount()):
        print(" ".join(str(wsOut.column(i)[rowIndex])
              for i in range(wsOut.columnCount())))

wsComment = LoadLogPropertyTable(FirstFile = "MUSR00015189.nxs",
            LastFile = "MUSR00015193.nxs", LogNames="comment")
print("The comments of all the files")
print_table_workspace(wsComment)

wsMultiple = LoadLogPropertyTable(FirstFile = "MUSR00015189.nxs",
            LastFile = "MUSR00015193.nxs", LogNames="Temp_Sample,dur")
print("\nThe Temp_Sample and dur logs")
print_table_workspace(wsMultiple)

Output:

The comments of all the files
RunNumber comment
15189 18.95MHz 100W
15190 18.95MHz 100W

The Temp_Sample and dur logs
RunNumber Temp_Sample dur
15189 0.0 100
15190 0.0 100
15191 0.0 101

Categories: AlgorithmIndex | DataHandling\Logs | Muon\DataHandling

Source

Python: LoadLogPropertyTable.py (last modified: 2018-10-05)